-
Notifications
You must be signed in to change notification settings - Fork 1
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
IS-1646: Consume huskelapp-status in personoversiktstatus #316
Conversation
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.
Hvordan kan man evt implementere Repository-konseptet i slike consumers der vi ønsker å ha én connection oppe hele tiden? Jeg føler jo at logikken som skjer inne i forEachen hører hjemme i en service 🤷🏼♂️
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.
Måtte kanskje hatt en repository-metode ala createOrUpdatePersonoppgaver(huskelapp: List<Huskelapp>)
, men lit enig i at den logikken hører mer hjemme her...
if (tombstones.isNotEmpty()) { | ||
val numberOfTombstones = tombstones.size | ||
log.error("Value of $numberOfTombstones ConsumerRecord are null, most probably due to a tombstone. Contact the owner of the topic if an error is suspected") | ||
COUNT_KAFKA_CONSUMER_HUSKELAPP_TOMBSTONE.increment(numberOfTombstones.toDouble()) | ||
} |
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.
Vi sender vel ikke tombstones på denne topicen, så vet ikke om vi trenger dette?
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.
Nei, jeg tenker vi kan fjerne det.
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.
Endret nå, prøvde å ta i bruk en requireNoNulls
, den kaster feil hvis det plutselig skulle komme null-verdier her.
Returns an original collection containing all the non-null elements, throwing an IllegalArgumentException if there are any null elements.
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.
Nice!
) | ||
val consumerProperties = Properties().apply { | ||
putAll(kafkaAivenConsumerConfig(kafkaEnvironment = kafkaEnvironment)) | ||
this[ConsumerConfig.MAX_POLL_RECORDS_CONFIG] = "1" |
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.
Én av gangen, eller skulle vi tatt flere? 🤷🏼♂️
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.
Ser vi går for 1 noen steder og 10 andre steder... husker ikke om det var noen spesielle grunner til at man burde begrense til 1 🤔 Kanskje noe samtidighets-problematikk. Går jo an å prøve 10 (eller enda flere) så skrur vi heller ned hvis det blir et problem.
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.
Okey 👍🏼
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.
Ja, i dette tilfellet går det sikkert bra med 10 eller flere. Vi bør begrense det til 1 dersom konsumeringen gjør noe mer enn å skrive til databasen, feks lager en ny record på et annet topic eller skriver til MQ eller noe annet "eksternt".
import java.util.UUID | ||
|
||
data class KafkaHuskelapp( | ||
val uuid: UUID, |
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.
Så at det var UUID
i ishuskelapp
. Deserialisereren fikser det, eller?
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.
Tror det skal gå bra, men vi får teste i dev 💥
fun toPersonoversiktStatus() = PersonOversiktStatus( | ||
fnr = personIdent.value, | ||
).copy( | ||
huskelappActive = isActive, | ||
) |
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.
Gjorde sånn i stedet for å "fylle ut" det store objektet, nå som vi har default-values.
Hadde det vært penere med en .create()
-metode? I så fall burde man kanskje lage flere, for aktivitetskrav, huskelapp, dialogmøtestatusendring etc etc.
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.
👍 Hadde nok vært fint og ryddet litt opp i det ja, men får ta det i en egen PR.
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.
Ser bra ut!
Hva har blitt lagt til✨🌈
Har satt opp en kafkaconsumer for topicet som
ishuskelapp
konsumerer på. Her kommer det inn huskelapper med et flaggisActive
for en person, som skal bestemme omoppgavenstatusen skal vises i syfooversikt.Funker i dev ✅