From e6687f469980bba1a7232c93ef3ee8c74b07332f Mon Sep 17 00:00:00 2001 From: david steinsland Date: Tue, 12 Nov 2024 19:46:22 +0100 Subject: [PATCH] bumper r&r og tbd-libs --- build.gradle.kts | 4 ++-- src/main/kotlin/no/nav/helse/AktivitetRiver.kt | 4 +++- src/main/kotlin/no/nav/helse/AnnulleringRiver.kt | 4 +++- .../kotlin/no/nav/helse/FunksjonellFeilOgVarselRiver.kt | 4 +++- .../kotlin/no/nav/helse/GodkjenningL\303\270sningRiver.kt" | 5 +++-- .../no/nav/helse/HendelseIkkeH\303\245ndtertRiver.kt" | 4 +++- src/main/kotlin/no/nav/helse/OppgaveEndretRiver.kt | 4 +++- src/main/kotlin/no/nav/helse/PersonAvstemtRiver.kt | 4 +++- src/main/kotlin/no/nav/helse/RevurderingFerdigstiltRiver.kt | 4 +++- src/main/kotlin/no/nav/helse/RevurderingIgangsattRiver.kt | 4 +++- "src/main/kotlin/no/nav/helse/SendtS\303\270knadRiver.kt" | 4 +++- .../kotlin/no/nav/helse/SkatteinntekterLagtTilGrunnRiver.kt | 6 ++++-- .../no/nav/helse/S\303\270knadH\303\245ndtertRiver.kt" | 4 +++- .../no/nav/helse/TidFraGodkjenningTilUtbetalingRiver.kt | 5 +++-- src/main/kotlin/no/nav/helse/TilstandendringRiver.kt | 4 +++- src/main/kotlin/no/nav/helse/UtkastTilVedtakRiver.kt | 6 ++++-- src/main/kotlin/no/nav/helse/VarselEndretRiver.kt | 4 +++- .../kotlin/no/nav/helse/VedtaksperiodeBehandletRiver.kt | 4 +++- src/main/kotlin/no/nav/helse/VedtaksperiodeEndretRiver.kt | 6 ++++-- .../no/nav/helse/VedtaksperiodeTilGodkjenningRiver.kt | 4 +++- .../helse/ventetilstand/IdentifiserStuckVedtaksperioder.kt | 5 +++-- .../helse/ventetilstand/OppsummerVedtaksperiodeVenter.kt | 4 +++- .../ventetilstand/OppsummerVedtaksperiodeVenterExternal.kt | 4 +++- .../no/nav/helse/ventetilstand/VedtaksperiodeEndretRiver.kt | 4 +++- .../helse/ventetilstand/VedtaksperiodeVenterIkkeRiver.kt | 4 +++- .../no/nav/helse/ventetilstand/VedtaksperiodeVenterRiver.kt | 5 +++-- 26 files changed, 80 insertions(+), 34 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 685803b..d17eeea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ val junitJupiterVersion = "5.11.3" val postgresqlVersion = "42.7.2" -val tbdLibsVersion = "2024.11.07-09.04-76a1afb0" -val rapidsAndRiversVersion = "2024110709231730967802.bf0cda480345" +val tbdLibsVersion = "2024.11.12-11.09-16cf2599" +val rapidsAndRiversVersion = "2024111211071731406062.648687519469" val mockkVersion = "1.13.13" plugins { diff --git a/src/main/kotlin/no/nav/helse/AktivitetRiver.kt b/src/main/kotlin/no/nav/helse/AktivitetRiver.kt index 03492a7..b5c1bb6 100644 --- a/src/main/kotlin/no/nav/helse/AktivitetRiver.kt +++ b/src/main/kotlin/no/nav/helse/AktivitetRiver.kt @@ -5,7 +5,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.intellij.lang.annotations.Language @@ -35,7 +37,7 @@ class AktivitetRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { try { //log.info("Inserter aktiviteter for vedtaksperiodeId: ${json["vedtaksperiodeId"].asText()}") packet["aktiviteter"] diff --git a/src/main/kotlin/no/nav/helse/AnnulleringRiver.kt b/src/main/kotlin/no/nav/helse/AnnulleringRiver.kt index dba4a8d..d4ce3de 100644 --- a/src/main/kotlin/no/nav/helse/AnnulleringRiver.kt +++ b/src/main/kotlin/no/nav/helse/AnnulleringRiver.kt @@ -3,7 +3,9 @@ package no.nav.helse import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import no.nav.helse.Annullering.Companion.insertAnnullering import no.nav.helse.Annullering.Companion.parseAnnullering import no.nav.helse.Util.asUuid @@ -27,7 +29,7 @@ class AnnulleringRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val jsonNode = packet.jsonNode() val annullering = jsonNode.parseAnnullering() diff --git a/src/main/kotlin/no/nav/helse/FunksjonellFeilOgVarselRiver.kt b/src/main/kotlin/no/nav/helse/FunksjonellFeilOgVarselRiver.kt index 1ff7081..48cb707 100644 --- a/src/main/kotlin/no/nav/helse/FunksjonellFeilOgVarselRiver.kt +++ b/src/main/kotlin/no/nav/helse/FunksjonellFeilOgVarselRiver.kt @@ -5,7 +5,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import net.logstash.logback.argument.StructuredArguments.keyValue @@ -33,7 +35,7 @@ class FunksjonellFeilOgVarselRiver( } }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { sikkerlogg.info("Leser inn {}", keyValue("hendelse", packet.toJson())) val opprettet = packet["@opprettet"].asLocalDateTime() packet["aktiviteter"] diff --git "a/src/main/kotlin/no/nav/helse/GodkjenningL\303\270sningRiver.kt" "b/src/main/kotlin/no/nav/helse/GodkjenningL\303\270sningRiver.kt" index f9af215..a80c531 100644 --- "a/src/main/kotlin/no/nav/helse/GodkjenningL\303\270sningRiver.kt" +++ "b/src/main/kotlin/no/nav/helse/GodkjenningL\303\270sningRiver.kt" @@ -4,14 +4,15 @@ import com.fasterxml.jackson.databind.JsonNode import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime -import com.github.navikt.tbd_libs.rapids_and_rivers.be import com.github.navikt.tbd_libs.rapids_and_rivers.isMissingOrNull import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection import com.github.navikt.tbd_libs.result_object.getOrThrow import com.github.navikt.tbd_libs.retry.retryBlocking import com.github.navikt.tbd_libs.speed.SpeedClient import io.micrometer.core.instrument.Counter +import io.micrometer.core.instrument.MeterRegistry import net.logstash.logback.argument.StructuredArguments.kv import java.util.* import javax.sql.DataSource @@ -48,7 +49,7 @@ class GodkjenningLøsningRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { if (godkjenningAlleredeLagret(packet)) return val ident = packet["fødselsnummer"].asText() diff --git "a/src/main/kotlin/no/nav/helse/HendelseIkkeH\303\245ndtertRiver.kt" "b/src/main/kotlin/no/nav/helse/HendelseIkkeH\303\245ndtertRiver.kt" index f0eab5d..fb736d9 100644 --- "a/src/main/kotlin/no/nav/helse/HendelseIkkeH\303\245ndtertRiver.kt" +++ "b/src/main/kotlin/no/nav/helse/HendelseIkkeH\303\245ndtertRiver.kt" @@ -6,7 +6,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers.isMissingOrNull import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.Session import kotliquery.queryOf import no.nav.helse.Util.withSession @@ -29,7 +31,7 @@ class HendelseIkkeHåndtertRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val hendelseId = UUID.fromString(packet["hendelseId"].asText()) val opprettet = packet["@opprettet"].asLocalDateTime() val årsaker = packet["årsaker"].takeUnless(JsonNode::isMissingOrNull) diff --git a/src/main/kotlin/no/nav/helse/OppgaveEndretRiver.kt b/src/main/kotlin/no/nav/helse/OppgaveEndretRiver.kt index edb6292..9eec137 100644 --- a/src/main/kotlin/no/nav/helse/OppgaveEndretRiver.kt +++ b/src/main/kotlin/no/nav/helse/OppgaveEndretRiver.kt @@ -5,7 +5,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers.isMissingOrNull import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.TransactionalSession import kotliquery.queryOf import kotliquery.sessionOf @@ -31,7 +33,7 @@ class OppgaveEndretRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val oppgaveEndret = OppgaveEndret( id = packet["oppgaveId"].asLong(), fødselsnummer = packet["fødselsnummer"].asText(), diff --git a/src/main/kotlin/no/nav/helse/PersonAvstemtRiver.kt b/src/main/kotlin/no/nav/helse/PersonAvstemtRiver.kt index 316ec22..6e01db6 100644 --- a/src/main/kotlin/no/nav/helse/PersonAvstemtRiver.kt +++ b/src/main/kotlin/no/nav/helse/PersonAvstemtRiver.kt @@ -5,10 +5,12 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDate import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection import com.github.navikt.tbd_libs.result_object.getOrThrow import com.github.navikt.tbd_libs.retry.retryBlocking import com.github.navikt.tbd_libs.speed.SpeedClient +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import no.nav.helse.Util.asUuid @@ -39,7 +41,7 @@ class VedtaksperiodeAvstemt( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val ident = packet["fødselsnummer"].asText() val callId = packet["@id"].asText() val identer = retryBlocking { speedClient.hentFødselsnummerOgAktørId(ident, callId).getOrThrow() } diff --git a/src/main/kotlin/no/nav/helse/RevurderingFerdigstiltRiver.kt b/src/main/kotlin/no/nav/helse/RevurderingFerdigstiltRiver.kt index 0ea1228..e2ffd73 100644 --- a/src/main/kotlin/no/nav/helse/RevurderingFerdigstiltRiver.kt +++ b/src/main/kotlin/no/nav/helse/RevurderingFerdigstiltRiver.kt @@ -5,7 +5,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.intellij.lang.annotations.Language @@ -31,7 +33,7 @@ class RevurderingFerdigstiltRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val revurderingId = UUID.fromString(packet["revurderingId"].asText()) val status = packet["status"].asText() val opprettet = packet["@opprettet"].asLocalDateTime() diff --git a/src/main/kotlin/no/nav/helse/RevurderingIgangsattRiver.kt b/src/main/kotlin/no/nav/helse/RevurderingIgangsattRiver.kt index bbf53a5..6d15aba 100644 --- a/src/main/kotlin/no/nav/helse/RevurderingIgangsattRiver.kt +++ b/src/main/kotlin/no/nav/helse/RevurderingIgangsattRiver.kt @@ -6,7 +6,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDate import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.intellij.lang.annotations.Language @@ -40,7 +42,7 @@ class RevurderingIgangsattRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val revurderingId = packet["revurderingId"].let { UUID.fromString(it.asText()) } val årsak = packet["årsak"].asText() val opprettet = packet["@opprettet"].asLocalDateTime() diff --git "a/src/main/kotlin/no/nav/helse/SendtS\303\270knadRiver.kt" "b/src/main/kotlin/no/nav/helse/SendtS\303\270knadRiver.kt" index 451e283..85eb2a3 100644 --- "a/src/main/kotlin/no/nav/helse/SendtS\303\270knadRiver.kt" +++ "b/src/main/kotlin/no/nav/helse/SendtS\303\270knadRiver.kt" @@ -3,7 +3,9 @@ package no.nav.helse import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import no.nav.helse.Util.asUuid @@ -31,7 +33,7 @@ class SendtSøknadRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val dokumentId = packet["id"].asUuid() val hendelseId = packet["@id"].asUuid() val eventName = packet["@event_name"].asText() diff --git a/src/main/kotlin/no/nav/helse/SkatteinntekterLagtTilGrunnRiver.kt b/src/main/kotlin/no/nav/helse/SkatteinntekterLagtTilGrunnRiver.kt index 6367100..f9444e7 100644 --- a/src/main/kotlin/no/nav/helse/SkatteinntekterLagtTilGrunnRiver.kt +++ b/src/main/kotlin/no/nav/helse/SkatteinntekterLagtTilGrunnRiver.kt @@ -3,8 +3,10 @@ package no.nav.helse import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageProblems import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.postgresql.util.PSQLException @@ -24,7 +26,7 @@ class SkatteinntekterLagtTilGrunnRiver(rapidsConnection: RapidsConnection, priva }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { sikkerlogg.info("Leste melding: ${packet.toJson()}") val vedtaksperiodeId = packet["vedtaksperiodeId"].asText().let { UUID.fromString(it) } val behandlingId = packet["behandlingId"].asText().let { UUID.fromString(it) } @@ -53,7 +55,7 @@ class SkatteinntekterLagtTilGrunnRiver(rapidsConnection: RapidsConnection, priva } } - override fun onError(problems: MessageProblems, context: MessageContext) { + override fun onError(problems: MessageProblems, context: MessageContext, metadata: MessageMetadata) { sikkerlogg.error(problems.toExtendedReport()) } } diff --git "a/src/main/kotlin/no/nav/helse/S\303\270knadH\303\245ndtertRiver.kt" "b/src/main/kotlin/no/nav/helse/S\303\270knadH\303\245ndtertRiver.kt" index 585a16d..126b871 100644 --- "a/src/main/kotlin/no/nav/helse/S\303\270knadH\303\245ndtertRiver.kt" +++ "b/src/main/kotlin/no/nav/helse/S\303\270knadH\303\245ndtertRiver.kt" @@ -4,7 +4,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.intellij.lang.annotations.Language @@ -26,7 +28,7 @@ class SøknadHåndtertRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val søknadHendelseId = UUID.fromString(packet["søknadId"].asText()) val vedtaksperiodeId = UUID.fromString(packet["vedtaksperiodeId"].asText()) val opprettet = packet["@opprettet"].asLocalDateTime() diff --git a/src/main/kotlin/no/nav/helse/TidFraGodkjenningTilUtbetalingRiver.kt b/src/main/kotlin/no/nav/helse/TidFraGodkjenningTilUtbetalingRiver.kt index e485e74..e058de6 100644 --- a/src/main/kotlin/no/nav/helse/TidFraGodkjenningTilUtbetalingRiver.kt +++ b/src/main/kotlin/no/nav/helse/TidFraGodkjenningTilUtbetalingRiver.kt @@ -5,11 +5,12 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import io.micrometer.core.instrument.Timer import kotliquery.queryOf import kotliquery.sessionOf -import kotliquery.using import java.time.LocalDateTime import java.time.format.DateTimeFormatter import java.time.format.DateTimeParseException @@ -39,7 +40,7 @@ class TidFraGodkjenningTilUtbetalingRiver( } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val json = objectMapper.readTree(packet.toJson()) val vedtaksperiodeId = UUID.fromString(json["vedtaksperiodeId"].asText()) diff --git a/src/main/kotlin/no/nav/helse/TilstandendringRiver.kt b/src/main/kotlin/no/nav/helse/TilstandendringRiver.kt index 05e62fc..ac19b31 100644 --- a/src/main/kotlin/no/nav/helse/TilstandendringRiver.kt +++ b/src/main/kotlin/no/nav/helse/TilstandendringRiver.kt @@ -5,7 +5,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.intellij.lang.annotations.Language @@ -34,7 +36,7 @@ class TilstandendringRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val vedtaksperiodeId = UUID.fromString(packet["vedtaksperiodeId"].asText()) insertTilstandsendring( id = UUID.fromString(packet["@id"].asText()), diff --git a/src/main/kotlin/no/nav/helse/UtkastTilVedtakRiver.kt b/src/main/kotlin/no/nav/helse/UtkastTilVedtakRiver.kt index 6668bcb..b4b3eda 100644 --- a/src/main/kotlin/no/nav/helse/UtkastTilVedtakRiver.kt +++ b/src/main/kotlin/no/nav/helse/UtkastTilVedtakRiver.kt @@ -4,8 +4,10 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageProblems import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.intellij.lang.annotations.Language @@ -28,7 +30,7 @@ class UtkastTilVedtakRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val vedtaksperiodeId = UUID.fromString(packet["vedtaksperiodeId"].asText()) val behandlingId = UUID.fromString(packet["behandlingId"].asText()) val opprettet = packet["@opprettet"].asLocalDateTime() @@ -38,7 +40,7 @@ class UtkastTilVedtakRiver( logg.info("Lagret utkast_til_vedtak for vedtaksperiodeId=$vedtaksperiodeId") } - override fun onError(problems: MessageProblems, context: MessageContext) { + override fun onError(problems: MessageProblems, context: MessageContext, metadata: MessageMetadata) { sikkerlogg.error("Klarte ikke å lese utkast_til_vedtak event! ${problems.toExtendedReport()}") } diff --git a/src/main/kotlin/no/nav/helse/VarselEndretRiver.kt b/src/main/kotlin/no/nav/helse/VarselEndretRiver.kt index 8772d21..2d39d63 100644 --- a/src/main/kotlin/no/nav/helse/VarselEndretRiver.kt +++ b/src/main/kotlin/no/nav/helse/VarselEndretRiver.kt @@ -4,7 +4,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.Session import kotliquery.queryOf import kotliquery.sessionOf @@ -35,7 +37,7 @@ class VarselEndretRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val vedtaksperiodeId = UUID.fromString(packet["vedtaksperiode_id"].asText()) val tittel = packet["varseltittel"].asText() val meldingOpprettet = packet["@opprettet"].asLocalDateTime() diff --git a/src/main/kotlin/no/nav/helse/VedtaksperiodeBehandletRiver.kt b/src/main/kotlin/no/nav/helse/VedtaksperiodeBehandletRiver.kt index 8d3e9a2..f11f24a 100644 --- a/src/main/kotlin/no/nav/helse/VedtaksperiodeBehandletRiver.kt +++ b/src/main/kotlin/no/nav/helse/VedtaksperiodeBehandletRiver.kt @@ -5,7 +5,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.Session import kotliquery.queryOf import kotliquery.sessionOf @@ -31,7 +33,7 @@ class VedtaksperiodeBehandletRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val json = objectMapper.readTree(packet.toJson()) val behovId = UUID.fromString(json["@behovId"].asText()) val vedtaksperiodeId = UUID.fromString(json["vedtaksperiodeId"].asText()) diff --git a/src/main/kotlin/no/nav/helse/VedtaksperiodeEndretRiver.kt b/src/main/kotlin/no/nav/helse/VedtaksperiodeEndretRiver.kt index d18f53c..5107efe 100644 --- a/src/main/kotlin/no/nav/helse/VedtaksperiodeEndretRiver.kt +++ b/src/main/kotlin/no/nav/helse/VedtaksperiodeEndretRiver.kt @@ -4,10 +4,12 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDate import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection import com.github.navikt.tbd_libs.result_object.getOrThrow import com.github.navikt.tbd_libs.retry.retryBlocking import com.github.navikt.tbd_libs.speed.SpeedClient +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.postgresql.util.PSQLException @@ -40,7 +42,7 @@ class VedtaksperiodeEndretRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { lagreVedtaksperiodedata(speedClient, packet["gjeldendeTilstand"].asText(), packet, dataSource) } } @@ -67,7 +69,7 @@ class VedtaksperiodeOpprettetRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { lagreVedtaksperiodedata(speedClient, "START", packet, dataSource) } } diff --git a/src/main/kotlin/no/nav/helse/VedtaksperiodeTilGodkjenningRiver.kt b/src/main/kotlin/no/nav/helse/VedtaksperiodeTilGodkjenningRiver.kt index f355e63..08bec9a 100644 --- a/src/main/kotlin/no/nav/helse/VedtaksperiodeTilGodkjenningRiver.kt +++ b/src/main/kotlin/no/nav/helse/VedtaksperiodeTilGodkjenningRiver.kt @@ -4,7 +4,9 @@ import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import kotliquery.queryOf import kotliquery.sessionOf import org.intellij.lang.annotations.Language @@ -29,7 +31,7 @@ class VedtaksperiodeTilGodkjenningRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val json = objectMapper.readTree(packet.toJson()) val vedtaksperiodeId = UUID.fromString(json["vedtaksperiodeId"].asText()) val behovOpprettet = json["@opprettet"].asLocalDateTime() diff --git a/src/main/kotlin/no/nav/helse/ventetilstand/IdentifiserStuckVedtaksperioder.kt b/src/main/kotlin/no/nav/helse/ventetilstand/IdentifiserStuckVedtaksperioder.kt index a6eea0d..1759a15 100644 --- a/src/main/kotlin/no/nav/helse/ventetilstand/IdentifiserStuckVedtaksperioder.kt +++ b/src/main/kotlin/no/nav/helse/ventetilstand/IdentifiserStuckVedtaksperioder.kt @@ -3,9 +3,11 @@ package no.nav.helse.ventetilstand import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection import com.github.navikt.tbd_libs.spurtedu.SkjulRequest import com.github.navikt.tbd_libs.spurtedu.SpurteDuClient +import io.micrometer.core.instrument.MeterRegistry import no.nav.helse.objectMapper import no.nav.helse.ventetilstand.Slack.sendPåSlack import org.slf4j.LoggerFactory @@ -44,8 +46,7 @@ internal class IdentifiserStuckVedtaksperioder( }.register(this) } - @ExperimentalTime - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { try { val (stuck, tidsbruk) = measureTimedValue { dao.stuck() } if (stuck.isEmpty()) return ingentingStuck(packet, context, tidsbruk) diff --git a/src/main/kotlin/no/nav/helse/ventetilstand/OppsummerVedtaksperiodeVenter.kt b/src/main/kotlin/no/nav/helse/ventetilstand/OppsummerVedtaksperiodeVenter.kt index 358ac31..eb32b05 100644 --- a/src/main/kotlin/no/nav/helse/ventetilstand/OppsummerVedtaksperiodeVenter.kt +++ b/src/main/kotlin/no/nav/helse/ventetilstand/OppsummerVedtaksperiodeVenter.kt @@ -3,7 +3,9 @@ package no.nav.helse.ventetilstand import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import no.nav.helse.ventetilstand.OppsummeringDao.Ventegruppe import no.nav.helse.ventetilstand.Slack.sendPåSlack import org.slf4j.LoggerFactory @@ -34,7 +36,7 @@ internal class OppsummerVedtaksperiodeVenter ( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { try { val (oppsummering, antallPersoner) = dao.oppsummering() val melding = lagMelding(oppsummering, antallPersoner) diff --git a/src/main/kotlin/no/nav/helse/ventetilstand/OppsummerVedtaksperiodeVenterExternal.kt b/src/main/kotlin/no/nav/helse/ventetilstand/OppsummerVedtaksperiodeVenterExternal.kt index cc89bee..0be80ed 100644 --- a/src/main/kotlin/no/nav/helse/ventetilstand/OppsummerVedtaksperiodeVenterExternal.kt +++ b/src/main/kotlin/no/nav/helse/ventetilstand/OppsummerVedtaksperiodeVenterExternal.kt @@ -3,7 +3,9 @@ package no.nav.helse.ventetilstand import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import no.nav.helse.ventetilstand.OppsummeringDao.VentegruppeExternal import org.slf4j.LoggerFactory @@ -30,7 +32,7 @@ internal class OppsummerVedtaksperiodeVenterExternal ( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { try { val oppsummering = dao.oppsummeringExternal() val melding = lagMelding(oppsummering) diff --git a/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeEndretRiver.kt b/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeEndretRiver.kt index 1cd85c5..d43c13a 100644 --- a/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeEndretRiver.kt +++ b/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeEndretRiver.kt @@ -3,7 +3,9 @@ package no.nav.helse.ventetilstand import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import net.logstash.logback.argument.StructuredArguments.keyValue import org.slf4j.LoggerFactory import java.util.* @@ -28,7 +30,7 @@ internal class VedtaksperiodeEndretRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val gjeldendeTilstand = packet["gjeldendeTilstand"].asText() val forrigeTilstand = packet["forrigeTilstand"].asText() if (gjeldendeTilstand == forrigeTilstand) return diff --git a/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeVenterIkkeRiver.kt b/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeVenterIkkeRiver.kt index 1423a36..1a957ad 100644 --- a/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeVenterIkkeRiver.kt +++ b/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeVenterIkkeRiver.kt @@ -3,7 +3,9 @@ package no.nav.helse.ventetilstand import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection +import io.micrometer.core.instrument.MeterRegistry import net.logstash.logback.argument.StructuredArguments.keyValue import org.slf4j.LoggerFactory import java.util.* @@ -20,7 +22,7 @@ internal class VedtaksperiodeVenterIkkeRiver( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { val vedtaksperiodeId = UUID.fromString(packet["vedtaksperiodeId"].asText()) dao.venterIkke(vedtaksperiodeId, packet.hendelse) logger.info("Venter ikke lenger for {}. Har fått eksplisitt signal om at den ikke venter", keyValue("vedtaksperiodeId", vedtaksperiodeId)) diff --git a/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeVenterRiver.kt b/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeVenterRiver.kt index d83d758..258dbd0 100644 --- a/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeVenterRiver.kt +++ b/src/main/kotlin/no/nav/helse/ventetilstand/VedtaksperiodeVenterRiver.kt @@ -2,12 +2,13 @@ package no.nav.helse.ventetilstand import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageContext -import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageProblems import com.github.navikt.tbd_libs.rapids_and_rivers.River import com.github.navikt.tbd_libs.rapids_and_rivers.JsonMessage import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDateTime import com.github.navikt.tbd_libs.rapids_and_rivers.asLocalDate import com.github.navikt.tbd_libs.rapids_and_rivers.isMissingOrNull +import com.github.navikt.tbd_libs.rapids_and_rivers_api.MessageMetadata +import io.micrometer.core.instrument.MeterRegistry import java.util.* internal class VedtaksperiodeVenterRiver ( @@ -37,7 +38,7 @@ internal class VedtaksperiodeVenterRiver ( }.register(this) } - override fun onPacket(packet: JsonMessage, context: MessageContext) { + override fun onPacket(packet: JsonMessage, context: MessageContext, metadata: MessageMetadata, meterRegistry: MeterRegistry) { dao.venter(packet.vedtaksperiodeVenter, packet.hendelse) }