@Override protected <T, R> void testSend(T val, R received, Consumer<T> consumer, DeliveryOptions options) { eb.<T>consumer(ADDRESS1).handler((Message<T> msg) -> { if (consumer == null) { assertTrue(msg.isSend()); assertEquals(received, msg.body()); if (options != null && options.getHeaders() != null) { assertNotNull(msg.headers()); assertEquals(options.getHeaders().size(), msg.headers().size()); for (Map.Entry<String, String> entry: options.getHeaders().entries()) { assertEquals(msg.headers().get(entry.getKey()), entry.getValue()); } } } else { consumer.accept(msg.body()); } testComplete(); }); if (options != null) { eb.send(ADDRESS1, val, options); } else { eb.send(ADDRESS1, val); } await(); }
assertTrue(msg.isSend()); assertEquals(received, msg.body()); if (options != null) {
@Override protected <T, R> void testReply(T val, R received, Consumer<R> consumer, DeliveryOptions options) { String str = TestUtils.randomUnicodeString(1000); eb.consumer(ADDRESS1).handler(msg -> { assertEquals(str, msg.body()); if (options != null) { msg.reply(val, options); } else { msg.reply(val); } }); eb.send(ADDRESS1, str, onSuccess((Message<R> reply) -> { if (consumer == null) { assertTrue(reply.isSend()); assertEquals(received, reply.body()); if (options != null && options.getHeaders() != null) { assertNotNull(reply.headers()); assertEquals(options.getHeaders().size(), reply.headers().size()); for (Map.Entry<String, String> entry: options.getHeaders().entries()) { assertEquals(reply.headers().get(entry.getKey()), entry.getValue()); } } } else { consumer.accept(reply.body()); } testComplete(); })); await(); }
vertices[0].eventBus().send(ADDRESS1, str, onSuccess((Message<R> reply) -> { if (consumer == null) { assertTrue(reply.isSend()); assertEquals(received, reply.body()); if (options != null && options.getHeaders() != null) {
/** * Signals if this message represents a send or publish event. * @return true if this is a send. */ public boolean isSend() { boolean ret = delegate.isSend(); return ret; }
/** * Signals if this message represents a send or publish event. * @return true if this is a send. */ public boolean isSend() { boolean ret = delegate.isSend(); return ret; }
@Override protected <T, R> void testSend(T val, R received, Consumer<T> consumer, DeliveryOptions options) { eb.<T>consumer(ADDRESS1).handler((Message<T> msg) -> { if (consumer == null) { assertTrue(msg.isSend()); assertEquals(received, msg.body()); if (options != null && options.getHeaders() != null) { assertNotNull(msg.headers()); assertEquals(options.getHeaders().size(), msg.headers().size()); for (Map.Entry<String, String> entry: options.getHeaders().entries()) { assertEquals(msg.headers().get(entry.getKey()), entry.getValue()); } } } else { consumer.accept(msg.body()); } testComplete(); }); if (options != null) { eb.send(ADDRESS1, val, options); } else { eb.send(ADDRESS1, val); } await(); }
@Override protected <T, R> void testReply(T val, R received, Consumer<R> consumer, DeliveryOptions options) { String str = TestUtils.randomUnicodeString(1000); eb.consumer(ADDRESS1).handler(msg -> { assertEquals(str, msg.body()); if (options != null) { msg.reply(val, options); } else { msg.reply(val); } }); eb.send(ADDRESS1, str, onSuccess((Message<R> reply) -> { if (consumer == null) { assertTrue(reply.isSend()); assertEquals(received, reply.body()); if (options != null && options.getHeaders() != null) { assertNotNull(reply.headers()); assertEquals(options.getHeaders().size(), reply.headers().size()); for (Map.Entry<String, String> entry: options.getHeaders().entries()) { assertEquals(reply.headers().get(entry.getKey()), entry.getValue()); } } } else { consumer.accept(reply.body()); } testComplete(); })); await(); }
assertTrue(msg.isSend()); assertEquals(received, msg.body()); if (options != null) {
vertices[0].eventBus().send(ADDRESS1, str, onSuccess((Message<R> reply) -> { if (consumer == null) { assertTrue(reply.isSend()); assertEquals(received, reply.body()); if (options != null && options.getHeaders() != null) {
sendFrame("message", res1.address(), res1.replyAddress(), responseHeaders, res1.isSend(), res1.body(), socket); })); } else {
sendFrame("message", res1.address(), res1.replyAddress(), responseHeaders, res1.isSend(), res1.body(), socket); })); } else {