Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Deletion Components
Import Process Delete
Commits
c00e14c1
Unverified
Commit
c00e14c1
authored
Nov 26, 2020
by
Sebastian Schüpbach
Browse files
use output topic
Signed-off-by:
Sebastian Schüpbach
<
sebastian.schuepbach@unibas.ch
>
parent
d7d756e6
Pipeline
#17910
passed with stages
in 4 minutes and 59 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/scala/ch/memobase/AppSettings.scala
View file @
c00e14c1
...
@@ -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"
)
}
}
src/main/scala/ch/memobase/KProducer.scala
View file @
c00e14c1
...
@@ -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
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment