Unverified Commit c00e14c1 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

use output topic


Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent d7d756e6
Pipeline #17910 passed with stages
in 4 minutes and 59 seconds
...@@ -25,6 +25,7 @@ import scala.util.Random ...@@ -25,6 +25,7 @@ import scala.util.Random
trait AppSettings { trait AppSettings {
val clientId = s"${sys.env("CLIENT_ID")}-${new Random().alphanumeric.take(5).mkString}" val clientId = s"${sys.env("CLIENT_ID")}-${new Random().alphanumeric.take(5).mkString}"
val inputTopic: String = sys.env("TOPIC_IN") val inputTopic: String = sys.env("TOPIC_IN")
val outputTopic: String = sys.env("TOPIC_OUT")
val pollTimeout: Int = sys.env("POLL_TIMEOUT").toInt val pollTimeout: Int = sys.env("POLL_TIMEOUT").toInt
val producerProps: Properties = { val producerProps: Properties = {
val props = new Properties() val props = new Properties()
...@@ -47,5 +48,4 @@ trait AppSettings { ...@@ -47,5 +48,4 @@ trait AppSettings {
props.put("max.poll.records", "5000") props.put("max.poll.records", "5000")
props props
} }
val reportingTopic: String = sys.env("TOPIC_OUT")
} }
...@@ -30,7 +30,7 @@ abstract class KProducer { ...@@ -30,7 +30,7 @@ abstract class KProducer {
def sendDelete(id: DeleteMessage): Unit = { def sendDelete(id: DeleteMessage): Unit = {
logger.info(s"Sending delete command for $id") logger.info(s"Sending delete command for $id")
val producerRecord = new ProducerRecord[String, String](id.recordId, null) val producerRecord = new ProducerRecord[String, String](outputTopic, id.recordId, null)
producerRecord.headers() producerRecord.headers()
.add("recordSetId", id.recordSetId.getBytes()) .add("recordSetId", id.recordSetId.getBytes())
.add("institutionId", id.institutionId.getBytes()) .add("institutionId", id.institutionId.getBytes())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment