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:
be1ffd5
)
Implementierung des Versands der Header ergänzt
spring/rest-producer--json---2023-06-signal
author
Kai Moritz
<kai@juplo.de>
Thu, 15 Jun 2023 20:54:54 +0000
(22:54 +0200)
committer
Kai Moritz
<kai@juplo.de>
Thu, 15 Jun 2023 20:56:04 +0000
(22:56 +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
0158774
..
e68fe66
100644
(file)
--- a/
src/main/java/de/juplo/kafka/RestProducer.java
+++ b/
src/main/java/de/juplo/kafka/RestProducer.java
@@
-57,6
+57,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();