Skip to content

Commit 7be487f

Browse files
committed
create new hendelse topic and consume new and old topic
1 parent 145dda5 commit 7be487f

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

.github/workflows/topic.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: nais/deploy/actions/deploy@v2
1818
env:
1919
CLUSTER: dev-gcp
20-
RESOURCE: nais/topics/dinesykmeldte-lest-topic.yaml
20+
RESOURCE: nais/topics/dinesykmeldte-hendelser-v2.yaml
2121
VAR: kafka-pool=nav-dev
2222

2323
deploy-topic-to-prod:
@@ -33,5 +33,5 @@ jobs:
3333
uses: nais/deploy/actions/deploy@v2
3434
env:
3535
CLUSTER: prod-gcp
36-
RESOURCE: nais/topics/dinesykmeldte-lest-topic.yaml
36+
RESOURCE: nais/topics/dinesykmeldte-hendelser-v2.yaml
3737
VAR: kafka-pool=nav-prod
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: kafka.nais.io/v1
2+
kind: Topic
3+
metadata:
4+
name: dinesykmeldte-hendelser-v2
5+
namespace: team-esyfo
6+
labels:
7+
team: team-esyfo
8+
spec:
9+
pool: {{kafka-pool}}
10+
config: # optional; all fields are optional too; defaults shown
11+
cleanupPolicy: delete # delete, compact
12+
minimumInSyncReplicas: 3
13+
partitions: 3
14+
replication: 3 # see min/max requirements
15+
retentionBytes: -1 # -1 means unlimited
16+
retentionHours: 2952 # 4 months
17+
acl:
18+
- team: flex
19+
application: sykepengesoknad-narmesteleder-varsler
20+
access: write
21+
- team: team-esyfo
22+
application: esyfovarsel
23+
access: write
24+
- team: teamsykefravr
25+
application: isdialogmote
26+
access: write
27+
- team: team-esyfo
28+
application: syfomotebehov
29+
access: write
30+
- team: team-esyfo
31+
application: dinesykmeldte-backend
32+
access: read

src/main/kotlin/no/nav/syfo/Environment.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ data class Environment(
1515
val narmestelederLeesahTopic: String = "teamsykmelding.syfo-narmesteleder-leesah",
1616
val sendtSykmeldingTopic: String = "teamsykmelding.syfo-sendt-sykmelding",
1717
val sykepengesoknadTopic: String = "flex.sykepengesoknad",
18-
val hendelserTopic: String = "teamsykmelding.dinesykmeldte-hendelser-v2",
18+
val hendelserTopic: String = "esyfo.dinesykmeldte-hendelser-v2",
19+
val hendelserTopicLegacy: String = "teamsykmelding.dinesykmeldte-hendelser-v2",
1920
val syketilfelleEndpointURL: String =
2021
getEnvVar("SYKETILLFELLE_ENDPOINT_URL", "http://flex-syketilfelle.flex"),
2122
val syketilfelleScope: String = getEnvVar("SYKETILLFELLE_SCOPE"),

src/main/kotlin/no/nav/syfo/common/kafka/CommonKafkaService.kt

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class CommonKafkaService(
3838
environment.sendtSykmeldingTopic,
3939
environment.sykepengesoknadTopic,
4040
environment.hendelserTopic,
41+
environment.hendelserTopicLegacy,
4142
),
4243
)
4344
start()
@@ -64,6 +65,7 @@ class CommonKafkaService(
6465
sykmeldingService.handleSendtSykmeldingKafkaMessage(it)
6566
environment.sykepengesoknadTopic -> soknadService.handleSykepengesoknad(it)
6667
environment.hendelserTopic -> hendelserService.handleHendelse(it)
68+
environment.hendelserTopicLegacy -> hendelserService.handleHendelse(it)
6769
else ->
6870
throw IllegalStateException(
6971
"Har mottatt melding på ukjent topic: ${it.topic()}",

0 commit comments

Comments
 (0)