On a streaming system, the current context is held by the current thread, which is why MDC or any ThreadLocal will do.
On an actor-based system such as Vertx, your context is a message, so you need to add a correlation identifier for each message you send.
/ .
JsonObject, -
vertx.eventBus().send("someAddr",
new JsonObject().put("correlationId", "someId")
.put("payload", yourPayload));
DeliveryOption
vertx.eventBus().send("someAddr", "someMsg",
new DeliveryOptions().addHeader("correlationId", "someId"));
vertx.eventBus().consumer("someAddr", msg -> {
String correlationId = msg.headers().get("correlationId");
...
});
, Interceptor eventbus, Emanuel Idi Zipkin Vert.x, https://github.com/emmanuelidi/vertx-zipkin, .