Skip to content
Discussion options

You must be logged in to vote

Take a look here - https://reactiverse.io/reactiverse-contextual-logging/

Contextual data is not propagated over the EventBus. In this case, it must be:

  1. added to message headers on the sender side
  2. retrieved from headers and saved again on the receiver side

This process can be automated with EventBus interceptors:

vertx.eventBus().addOutboundInterceptor(event -> {
  String requestId = ContextualData.get("requestId");
  if (requestId != null) {
    event.message().headers().add("requestId", requestId);
  }
  event.next();
});

vertx.eventBus().addInboundInterceptor(event -> {
  String requestId = event.message().headers().get("requestId");
  if (requestId != null) {
    ContextualData.put…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@CosminBadea1
Comment options

Answer selected by CosminBadea1
Comment options

You must be logged in to vote
4 replies
@tugcesahin
Comment options

@tugcesahin
Comment options

@ashutoshk2206
Comment options

@holomekc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants