Open
Description
I am creating this based on smallrye/smallrye-reactive-messaging#214
Allow in-process context propagation between handlers. The API can be used by users to propagate any objects between handlers, but It is also necessary for tracing to propagate span context object to be able to link spans in handlers:
@Incoming("data-processor-in")
@Outgoing("data-processor-out")
public CompletionStage<KafkaMessage<String, String>> send(KafkaMessage<String, String> message) {
CompletableFuture<KafkaMessage<String, String>> future = new CompletableFuture<>();
future.complete(KafkaMessage.ofAndTraced(message.getKey(), message.getPayload().toUpperCase(), message.getSpan()));
return future;
}
links span from data-processor-in
to data-processor-out
topics.
Two solutions have been already discussed:
- Add context object (
Map<String, Object>
)to the message class. Q: How would user get the context? The implementation would have to provide an SPI to initialize TLS. - Integrate with https://github.com/eclipse/microprofile-context-propagation - activate TLS for every user-defined handlers. The correct TLS has to be set
Once the context propagation is in place we could provide tracing for underlying messaging platforms but in addition to also model invocations of the handlers themselves.
Other
Related to #2?