Skip to content

Commit ba7dc65

Browse files
committed
oppgraderer versjoner
fjerner call logging for /isalive og /isready
1 parent 97d0789 commit ba7dc65

File tree

6 files changed

+28
-15
lines changed

6 files changed

+28
-15
lines changed

build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22

33
plugins {
4-
kotlin("jvm") version "1.6.21"
4+
kotlin("jvm") version "1.7.21"
55
}
66

77
group = "no.nav.hjelpemidler"
@@ -15,22 +15,22 @@ repositories {
1515
dependencies {
1616
implementation("com.natpryce:konfig:1.6.10.0")
1717
implementation("org.influxdb:influxdb-java:2.22")
18-
implementation("com.github.navikt:rapids-and-rivers:2022.05.11-08.56.814d601f572e") {
18+
implementation("com.github.navikt:rapids-and-rivers:2022110411121667556720.8a951a765583") {
1919
exclude(group = "ch.qos.logback")
2020
}
2121

2222
// Logging
23-
implementation("io.github.microutils:kotlin-logging:2.1.21")
24-
runtimeOnly("ch.qos.logback:logback-classic:1.2.11")
25-
runtimeOnly("net.logstash.logback:logstash-logback-encoder:7.1.1")
23+
implementation("io.github.microutils:kotlin-logging:3.0.4")
24+
runtimeOnly("ch.qos.logback:logback-classic:1.4.4")
25+
runtimeOnly("net.logstash.logback:logstash-logback-encoder:7.2")
2626

2727
// Jackson
28-
val jacksonVersion = "2.13.3"
28+
val jacksonVersion = "2.14.0"
2929
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion")
3030
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
3131

3232
// Ktor
33-
val ktorVersion = "2.0.1"
33+
val ktorVersion = "2.1.3"
3434
implementation("io.ktor:ktor-server-auth:$ktorVersion")
3535
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
3636
implementation("io.ktor:ktor-server-call-logging:$ktorVersion")
@@ -39,7 +39,7 @@ dependencies {
3939
// Testing
4040
testImplementation(kotlin("test"))
4141
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
42-
testImplementation("io.mockk:mockk:1.12.4")
42+
testImplementation("io.mockk:mockk:1.13.2")
4343
}
4444

4545
tasks.withType<KotlinCompile> {

src/main/kotlin/no/nav/hjelpemidler/Application.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import io.ktor.server.auth.Authentication
77
import io.ktor.server.auth.authenticate
88
import io.ktor.server.plugins.callloging.CallLogging
99
import io.ktor.server.plugins.contentnegotiation.ContentNegotiation
10+
import io.ktor.server.request.path
1011
import io.ktor.server.routing.routing
1112
import mu.KotlinLogging
1213
import no.nav.helse.rapids_rivers.KafkaConfig
@@ -52,7 +53,15 @@ fun main() {
5253
)
5354
).withKtorModule {
5455
install(CallLogging) {
56+
disableDefaultColors()
5557
level = Level.DEBUG
58+
filter {
59+
when (it.request.path()) {
60+
"/isalive" -> false
61+
"/isready" -> false
62+
else -> true
63+
}
64+
}
5665
}
5766
install(ContentNegotiation) {
5867
jackson {

src/main/kotlin/no/nav/hjelpemidler/api/HotSak.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fun parseHotsakOrdrelinje(context: Context, ordrelinje: OrdrelinjeOebs) {
2222
sikkerlogg.warn("Vedtak HOTSAK-melding med manglende informasjon: $message")
2323
context.metrics.manglendeFeltForVedtakHOTSAK()
2424

25-
PostToSlack().post(
25+
PostToSlack.post(
2626
Configuration.application["SLACK_HOOK"]!!,
2727
"*${Configuration.profile}* - Manglende felt i Hotsak Oebs ordrelinje: ```$message```",
2828
"#digihot-hotsak-varslinger-dev"

src/main/kotlin/no/nav/hjelpemidler/api/InfotrygdSak.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fun parseInfotrygdOrdrelinje(context: Context, ordrelinje: OrdrelinjeOebs) {
2222
sikkerlogg.warn("Vedtak Infotrygd-melding med manglande informasjon: $message")
2323
context.metrics.manglendeFeltForVedtakInfotrygd()
2424

25-
PostToSlack().post(
25+
PostToSlack.post(
2626
Configuration.application["SLACK_HOOK"]!!,
2727
"*${Configuration.profile}* - Manglande felt i Vedtak Infotrygd-melding: ```$message```",
2828
"#digihot-brukers-hjelpemiddelside-dev"

src/main/kotlin/no/nav/hjelpemidler/configuration/Configuration.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import com.natpryce.konfig.stringType
1010
internal object Configuration {
1111

1212
private val prodProperties = ConfigurationMap(
13-
Profile.PROD.pair(),
13+
Profile.PROD.entry(),
1414

1515
"HTTP_PORT" to "8080",
16+
1617
"kafka.aiven.consumer" to "hm-oebs-listener-v1",
1718
"kafka.aiven.topic" to "teamdigihot.hm-soknadsbehandling-v1",
1819
"kafka.reset.policy" to "latest",
@@ -21,16 +22,19 @@ internal object Configuration {
2122
)
2223

2324
private val devProperties = ConfigurationMap(
24-
Profile.DEV.pair(),
25+
Profile.DEV.entry(),
26+
2527
"HTTP_PORT" to "8080",
28+
2629
"kafka.aiven.consumer" to "hm-oebs-listener-v2",
2730
"kafka.aiven.topic" to "teamdigihot.hm-soknadsbehandling-v1",
2831
"kafka.reset.policy" to "latest",
32+
2933
"SENSU_URL" to "https://digihot-proxy.dev-fss-pub.nais.io/sensu",
3034
)
3135

3236
private val localProperties = ConfigurationMap(
33-
Profile.LOCAL.pair(),
37+
Profile.LOCAL.entry(),
3438

3539
"HTTP_PORT" to "8085",
3640
"OEBSTOKEN" to "abc",
@@ -81,6 +85,6 @@ internal object Configuration {
8185
enum class Profile {
8286
PROD, DEV, LOCAL;
8387

84-
fun pair(): Pair<String, String> = "application.profile" to name
88+
fun entry(): Pair<String, String> = "application.profile" to name
8589
}
8690
}

src/main/kotlin/no/nav/hjelpemidler/slack/PostToSlack.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import java.net.http.HttpClient
66
import java.net.http.HttpRequest
77
import java.net.http.HttpResponse
88

9-
class PostToSlack {
9+
object PostToSlack {
1010
private val username = "hm-oebs-listener"
1111
private val icon_emoji = ":this-is-fine-fire:"
1212
private val objectMapper = jacksonObjectMapper()

0 commit comments

Comments
 (0)