Skip to content

Commit

Permalink
allows eventId to be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
tuantrannav committed Aug 28, 2024
1 parent 2ce4e72 commit abe8cb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ class KafkaRapidService(private val kafkaRapid: KafkaRapid,
}

override fun <T : Any> pushToRapid(key: String?, eventName: String?, payload: T,
keyValues : Map<String, Any>) {
val eventId = UUID.randomUUID()
LOG.debug("push to rapid key: $key, eventId: $eventId, eventName: $eventName, " +
keyValues : Map<String, Any>, eventId: UUID) {
LOG.info("push to rapid with partition key: $key, eventId: $eventId, eventName: $eventName, " +
"payloadType: ${payload::class.java.simpleName}")
produceEvent(key, mapOf("eventId" to eventId, "eventName" to eventName,
"createdTime" to LocalDateTime.now(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package no.nav.hm.rapids_rivers.micronaut

import java.util.UUID

interface RapidPushService {
fun <T : Any> pushToRapid(key: String?=null, eventName: String?=null, payload: T,
keyValues : Map<String, Any> = emptyMap())
keyValues : Map<String, Any> = emptyMap(), eventId: UUID = UUID.randomUUID())
}

0 comments on commit abe8cb9

Please sign in to comment.