Skip to content

Commit

Permalink
Merge pull request #3 from navikt/deadletter_support_lib
Browse files Browse the repository at this point in the history
Deadletter support lib
  • Loading branch information
tuantrannav authored Jun 28, 2024
2 parents cdbcd0c + 6087631 commit cecb460
Show file tree
Hide file tree
Showing 17 changed files with 568 additions and 271 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,12 @@ Setup R&R for use with Ktor
## Micronaut
Take a look at ApplicationTest to see how to run R&R within Micronaut Framework,

## Deadletter support
This only works for Micronaut. To enable deadletter support, you need to add the following dependency to your project:

```kotlin
implementation("com.github.navikt:hm-rapids-and-rivers-v2-micronaut-deadletter:$rapidsRiversVersion")
```

And create a table in your database using the sql in src/test/resources/db/deadletter/V1:0__create_deadletter_table.sql
Then annotate the onpacket method with @DeadLetterSupport(packet = "packet", messageContext = "context")
10 changes: 8 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.8.22"
kotlin("jvm") version "1.9.21"
kotlin("kapt") version "1.9.21"
id("java")
id("maven-publish")
}
Expand All @@ -11,6 +12,7 @@ plugins {
subprojects {
apply {
plugin("org.jetbrains.kotlin.jvm")
plugin("org.jetbrains.kotlin.kapt")
plugin("java")
plugin("maven-publish")
}
Expand Down Expand Up @@ -76,7 +78,7 @@ subprojects {
}

tasks.withType<Wrapper> {
gradleVersion = "8.0.1"
gradleVersion = "8.5"
}

repositories {
Expand All @@ -85,3 +87,7 @@ subprojects {
maven("https://packages.confluent.io/maven/")
}
}

repositories {
mavenCentral()
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit cecb460

Please sign in to comment.