-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
val harRetry = fail.utloesendeMelding.toMap()[Key.RETRY]?.fromJson(String.serializer()) | ||
val skalHaandteres = harRetry != null || behovSomHaandteres.contains(behovFraMelding) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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.
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.