Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Innfør støtte for ny feilhåndtering uten behov #471

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mortenbyhring
Copy link
Contributor

Beholder gammel Behov-logikk og tester foreløpig, for å gjøre en gradvis migrering til å bruke RETRY som key i Fails som publiseres.
Per nå brukes RETRY kun i JournalfoerIMRiver-klassen.

@mortenbyhring mortenbyhring requested a review from a team as a code owner March 15, 2024 12:54
Comment on lines +111 to +112
val harRetry = fail.utloesendeMelding.toMap()[Key.RETRY]?.fromJson(String.serializer())
val skalHaandteres = harRetry != null || behovSomHaandteres.contains(behovFraMelding)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hvis du stoler på at Key.RETRY har verdi så kan du erstatte harRetry != null med Key.RETRY in fail.utloesendeMelding.toMap().

@@ -38,16 +41,19 @@ data class JournalfoerImMelding(

class JournalfoerImRiver(
private val dokArkivClient: DokArkivClient
) : ObjectRiver<JournalfoerImMelding>() {
) : ObjectRiver<JournalfoerImMelding>(), Retriable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jeg ville foretrukket å ikke ha dette interfacet, ettersom man helt fint kan være Retriable, men faktisk ikke akseptere meldinger med retry. Da blir det forvirrende.

return if (
setOf(Key.DATA, Key.FAIL).any(json::containsKey) ||
(behovType != null && behovType != BehovType.JOURNALFOER)
(behovType != null && behovType != BehovType.JOURNALFOER) || // TODO: kan fjernes
(!erRetryOgMatcherLytteren(LISTENER_ID, retry))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foreslår å bytte ut !erRetryOgMatcherLytteren(LISTENER_ID, retry) med retry.isNullOrNotValue(LISTENER_ID).


private val logger = logger()
private val sikkerLogger = sikkerLogger()
private val LISTENER_ID = RetryID.JOURNALFOER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LISTENER_ID -> riverId?
Siden vi har rivers, som er en slags subklasse av listeners. Og camelCase siden verdien ikke er en const.

@@ -106,7 +106,7 @@ class NotifikasjonHentIdLoeser(
)
} else {
"Fant ikke sakId.".also {
logger.error(it)
logger.error(it) // TODO: bare logg en notis?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fint med error her så lenge vi har klassen. Det er strengt tatt en feil vi burde være klar over, selv om vi ikke gjør stort for å rette den opp om dagen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants