Skip to content

Commit

Permalink
Hent ut om det er quiz eller behandling som skal automatisere
Browse files Browse the repository at this point in the history
  • Loading branch information
androa committed Apr 5, 2024
1 parent a76c171 commit b2261e6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions mediator/src/main/kotlin/no/nav/dagpenger/mottak/Unleash.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package no.nav.dagpenger.mottak

import com.natpryce.konfig.Key
import com.natpryce.konfig.stringType
import io.getunleash.DefaultUnleash
import io.getunleash.Unleash
import io.getunleash.util.UnleashConfig
import no.nav.dagpenger.mottak.Config.properties
import java.net.InetAddress

val unleash: Unleash by lazy {
DefaultUnleash(
UnleashConfig.builder()
.appName(properties[Key("NAIS_APP_NAME", stringType)])
.instanceId(runCatching { InetAddress.getLocalHost().hostName }.getOrElse { "ukjent" })
.unleashAPI(properties[Key("UNLEASH_SERVER_API_URL", stringType)] + "/api/")
.apiKey(properties[Key("UNLEASH_SERVER_API_TOKEN", stringType)])
.environment(
when (System.getenv("NAIS_CLUSTER_NAME").orEmpty()) {
"prod-gcp" -> "production"
else -> "development"
},
).build(),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package no.nav.dagpenger.mottak.observers

import mu.KotlinLogging
import no.nav.dagpenger.mottak.InnsendingObserver
import no.nav.dagpenger.mottak.unleash
import no.nav.helse.rapids_rivers.JsonMessage
import org.apache.kafka.clients.producer.KafkaProducer
import org.apache.kafka.clients.producer.Producer
Expand Down Expand Up @@ -38,6 +39,7 @@ internal class FerdigstiltInnsendingObserver internal constructor(private val pr
val payload =
event.toPayload().also {
it["@event_name"] = "innsending_ferdigstilt"
it["bruk-dp-behandling"] = unleash.isEnabled("bruk-dp-behandling")
}

publish(
Expand Down

0 comments on commit b2261e6

Please sign in to comment.