Skip to content

Instantly share code, notes, and snippets.

@jt70
Created January 19, 2024 19:17
Show Gist options
  • Select an option

  • Save jt70/d19debaa081d93db8a1aa9792fc17a7f to your computer and use it in GitHub Desktop.

Select an option

Save jt70/d19debaa081d93db8a1aa9792fc17a7f to your computer and use it in GitHub Desktop.
vertx-eventbus-bridge-clients test
@Test
public void testSubscribeString(final TestContext ctx) throws Exception {
final Async async = ctx.async();
final EventBusClient client = client(ctx);
client.consumer("client_addr", new Handler<Message<Object>>() {
@Override
public void handle(Message<Object> event) {
ctx.assertEquals("hello", event.body());
async.complete();
client.close();
}
});
vertx.eventBus().consumer("send_to_client", msg -> {
vertx.eventBus().send("client_addr", "hello");
});
client.send("send_to_client", new HashMap<>());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment