Setting headers on messages
Messages sent over the event bus can also contain headers. This can be specified by setting options when sending or publishing:
def options = [
headers: [
"some-header" : "some-value"
]
]
vertx.eventBus().send("news.uk.sport", "Yay! Someone kicked a ball", options);
On the other side, a consumer can retrieve the headers as follows:
vertx.eventBus().consumer("news.uk.sport", { e ->
println e.headers()["some-header"];
});