diff --git a/apps/levende-arbeidsforhold-ansettelse/build.gradle b/apps/levende-arbeidsforhold-ansettelse/build.gradle index 42295a05ac3..ac688be0cbe 100644 --- a/apps/levende-arbeidsforhold-ansettelse/build.gradle +++ b/apps/levende-arbeidsforhold-ansettelse/build.gradle @@ -28,8 +28,6 @@ dependencies { runtimeOnly 'org.postgresql:postgresql' runtimeOnly 'org.postgresql:r2dbc-postgresql' - implementation "io.r2dbc:r2dbc-h2" - implementation "io.micrometer:micrometer-registry-prometheus" implementation "org.springdoc:springdoc-openapi-starter-webflux-ui:$versions.springdoc" implementation "io.swagger.core.v3:swagger-annotations-jakarta:$versions.swagger" diff --git a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/DatabaseR2dbcConfiguration.java b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/DatabaseR2dbcConfiguration.java index eee4141022b..b905e2ddc1e 100644 --- a/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/DatabaseR2dbcConfiguration.java +++ b/apps/levende-arbeidsforhold-ansettelse/src/main/java/no/nav/testnav/levendearbeidsforholdansettelse/config/DatabaseR2dbcConfiguration.java @@ -1,6 +1,6 @@ package no.nav.testnav.levendearbeidsforholdansettelse.config; -import io.r2dbc.h2.H2ConnectionFactory; +//import io.r2dbc.h2.H2ConnectionFactory; import io.r2dbc.spi.ConnectionFactory; import lombok.RequiredArgsConstructor; import org.flywaydb.core.Flyway; @@ -14,25 +14,25 @@ @Configuration @Profile("dev") @RequiredArgsConstructor -class DatabaseR2dbcConfiguration extends AbstractR2dbcConfiguration +class DatabaseR2dbcConfiguration /*extends AbstractR2dbcConfiguration*/ { - private final Environment env; - - @Bean - @Primary - public ConnectionFactory connectionFactory() { - return H2ConnectionFactory.inMemory("testdb"); - } - - @Bean(initMethod = "migrate") - public Flyway flyway() { - return new Flyway(Flyway.configure() - .baselineOnMigrate(true) - .dataSource( - env.getRequiredProperty("spring.flyway.url"), - env.getRequiredProperty("spring.flyway.username"), - env.getRequiredProperty("spring.flyway.password")) - ); - } +// private final Environment env; +// +// @Bean +// @Primary +// public ConnectionFactory connectionFactory() { +// return H2ConnectionFactory.inMemory("testdb"); +// } +// +// @Bean(initMethod = "migrate") +// public Flyway flyway() { +// return new Flyway(Flyway.configure() +// .baselineOnMigrate(true) +// .dataSource( +// env.getRequiredProperty("spring.flyway.url"), +// env.getRequiredProperty("spring.flyway.username"), +// env.getRequiredProperty("spring.flyway.password")) +// ); +// } } \ No newline at end of file diff --git a/apps/levende-arbeidsforhold-ansettelse/src/main/resources/application-dev.yml b/apps/levende-arbeidsforhold-ansettelse/src/main/resources/application-dev.yml index d4f6f67bec6..2e655c3818e 100644 --- a/apps/levende-arbeidsforhold-ansettelse/src/main/resources/application-dev.yml +++ b/apps/levende-arbeidsforhold-ansettelse/src/main/resources/application-dev.yml @@ -2,14 +2,18 @@ spring: flyway: # InMemmory database - url: jdbc:h2:mem:testdb - username: sa + url: jdbc:postgresql://localhost:5432/testnav-levende-arbeidsforhold + user: postgres + username: ${spring.flyway.user} password: - driverClassName: org.h2.Driver - sql: - init: - mode: always - data-locations: classpath:/db/dev/h2-default-config.sql + r2dbc: + url: r2dbc:postgresql://localhost:5432/testnav-levende-arbeidsforhold + username: postgres + password: +# sql: +# init: +# mode: always +# data-locations: classpath:/db/dev/h2-default-config.sql # main: # allow-bean-definition-overriding: true diff --git a/apps/levende-arbeidsforhold-ansettelse/src/main/resources/application-prod.yml b/apps/levende-arbeidsforhold-ansettelse/src/main/resources/application-prod.yml index 575a736307e..b4f89d1fd75 100644 --- a/apps/levende-arbeidsforhold-ansettelse/src/main/resources/application-prod.yml +++ b/apps/levende-arbeidsforhold-ansettelse/src/main/resources/application-prod.yml @@ -1,12 +1,7 @@ +debug: true spring: - data: - r2dbc: - repositories: - enabled: true r2dbc: - pool: - enabled: false url: r2dbc:postgresql://${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_HOST}:${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_PORT}/${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_DATABASE}?ssl=true&sslMode=${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_SSLMODE}&sslKey=${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_SSLKEY}&sslCert=${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_SSLCERT}&sslRootCert=${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_SSLROOTCERT} username: ${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_USERNAME} password: ${NAIS_DATABASE_TESTNAV_LEVENDE_ARBEIDSFORHOLD_TESTNAV_LEVENDE_ARBEIDSFORHOLD_PASSWORD} diff --git a/libs/reactive-core/src/main/java/no/nav/testnav/libs/reactivecore/logging/TestnavLogbackEncoder.java b/libs/reactive-core/src/main/java/no/nav/testnav/libs/reactivecore/logging/TestnavLogbackEncoder.java index 544251c47d6..27986d996bf 100644 --- a/libs/reactive-core/src/main/java/no/nav/testnav/libs/reactivecore/logging/TestnavLogbackEncoder.java +++ b/libs/reactive-core/src/main/java/no/nav/testnav/libs/reactivecore/logging/TestnavLogbackEncoder.java @@ -44,7 +44,7 @@ public byte[] encode(ILoggingEvent event) { for (StackTraceElement element : exception.getThrowable().getStackTrace()) { pw.println("\tat " + element); } - var stackTrace = sw.toString().substring(0, 480); //Limit the stack trace to 480 characters + var stackTrace = sw.toString()/*.substring(0, 480)*/; //Limit the stack trace to 480 characters generator.writeStringField("stack_trace", stackTrace); } }