Skip to content

Commit

Permalink
chore: reformat sykmeldinger to new topic
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasDev committed Nov 25, 2024
1 parent 6a15871 commit b104732
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/no/nav/tsm/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ fun main(args: Array<String>) {
fun Application.module() {
configureDependencyInjection()
configureMonitoring()
configureConsumer(get())
configureConsumer(get(), get())
}
7 changes: 4 additions & 3 deletions src/main/kotlin/no/nav/tsm/plugins/Consumer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import io.ktor.server.application.Application
import io.ktor.server.application.ApplicationStopping
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import no.nav.tsm.reformat.sykmelding.SykmeldingReformatService
import no.nav.tsm.sykmeldinger.input.SykmeldingInputConsumer
import no.nav.tsm.sykmeldinger.kafka.SykmeldingConsumer

fun Application.configureConsumer(sykmeldingConsumer: SykmeldingConsumer) {
fun Application.configureConsumer(sykmeldingConsumer: SykmeldingConsumer, sykmeldingReformatService: SykmeldingReformatService) {
val sykmeldingConsumerJob = launch(Dispatchers.IO) { sykmeldingConsumer.start() }
//val sykmeldingReformatJob = launch(Dispatchers.IO) { sykmeldingReformatService.start() }
val sykmeldingReformatJob = launch(Dispatchers.IO) { sykmeldingReformatService.start() }

environment.monitor.subscribe(ApplicationStopping) {
//sykmeldingReformatJob.cancel()
sykmeldingReformatJob.cancel()
sykmeldingConsumerJob.cancel()
}
}
2 changes: 1 addition & 1 deletion src/main/kotlin/no/nav/tsm/plugins/DependencyInjection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fun Application.configureDependencyInjection() {
modules(
environmentModule(),
sykmeldingConsumer,
//sykmeldingReformatService
sykmeldingReformatService
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/no/nav/tsm/plugins/Environment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Environment(
val okSykmeldingTopic: String = "teamsykmelding.ok-sykmelding",
val avvistSykmeldingTopic: String = "teamsykmelding.avvist-sykmelding",
val manuellSykmeldingTopic: String = "teamsykmelding.manuell-behandling-sykmelding",
val sykmeldingOutputTopic: String = "tsm.sykmelding-raw",
val sykmeldingOutputTopic: String = "tsm.sykmeldinger-input",
val teamsykmeldingSykmeldingTopic: String = "tsm.teamsykmelding-sykmeldinger",
val cluster: String = getEnvVar("NAIS_CLUSTER_NAME")
)
Expand Down

0 comments on commit b104732

Please sign in to comment.