Correlation id with Emitter #2130
-
When trying to add a correlation id to my messages. @Channel("foo.created")
Emitter<Message<String>> emitter;
....
String correlationId = UUID.randomUUID().toString();
Message<String> message =
Message.of(jsonMessage)
.addMetadata(OutgoingAmqpMetadata.builder().withCorrelationId(correlationId).build());
emitter.send(message); This returns an exception
Is there a way to add a correlation id to a message using the Emitter? |
Beta Was this translation helpful? Give feedback.
Answered by
marko-lazic
Apr 6, 2023
Replies: 1 comment
-
I solved it by just setting the emitter generic to String. @Channel("foo.created")
Emitter<String> emitter; And the rest of the code is the same. The emitter.send(message) now uses <M extends Message<? extends T>> void send(M msg); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
marko-lazic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solved it by just setting the emitter generic to String.
And the rest of the code is the same. The emitter.send(message) now uses <M extends Message<? extends T>> void send(M msg);