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:
5131379
)
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>
Sat, 17 Jun 2023 16:10:18 +0000
(18:10 +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();