projects
/
demos
/
kafka
/
training
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab74730
)
Implementierung zum Anfügen der Header wiederhergestellt
author
Kai Moritz
<kai@juplo.de>
Mon, 12 Jun 2023 18:48:27 +0000
(20:48 +0200)
committer
Kai Moritz
<kai@juplo.de>
Wed, 14 Jun 2023 19:06:22 +0000
(21:06 +0200)
src/main/java/de/juplo/kafka/RestProducer.java
patch
|
blob
|
history
diff --git
a/src/main/java/de/juplo/kafka/RestProducer.java
b/src/main/java/de/juplo/kafka/RestProducer.java
index
73bec5b
..
cecb980
100644
(file)
--- a/
src/main/java/de/juplo/kafka/RestProducer.java
+++ b/
src/main/java/de/juplo/kafka/RestProducer.java
@@
-42,6
+42,12
@@
public class RestProducer
value // Value
);
+ record.headers().add("source", id.getBytes());
+ if (correlationId != null)
+ {
+ record.headers().add("id", BigInteger.valueOf(correlationId).toByteArray());
+ }
+
producer.send(record, (metadata, e) ->
{
long now = System.currentTimeMillis();