本文整理了Java中io.vertx.core.eventbus.Message.isSend()
方法的一些代码示例,展示了Message.isSend()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.isSend()
方法的具体详情如下:
包路径:io.vertx.core.eventbus.Message
类名称:Message
方法名:isSend
[英]Signals if this message represents a send or publish event.
[中]指示此消息是否代表发送或发布事件。
代码示例来源:origin: eclipse-vertx/vert.x
@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();
}
代码示例来源:origin: eclipse-vertx/vert.x
assertTrue(msg.isSend());
assertEquals(received, msg.body());
if (options != null) {
代码示例来源:origin: eclipse-vertx/vert.x
@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();
}
代码示例来源:origin: eclipse-vertx/vert.x
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) {
代码示例来源:origin: vert-x3/vertx-rx
/**
* 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;
}
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* 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;
}
代码示例来源:origin: io.vertx/vertx-core
@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();
}
代码示例来源:origin: io.vertx/vertx-core
@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();
}
代码示例来源:origin: io.vertx/vertx-core
assertTrue(msg.isSend());
assertEquals(received, msg.body());
if (options != null) {
代码示例来源:origin: io.vertx/vertx-core
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) {
代码示例来源:origin: io.vertx/vertx-tcp-eventbus-bridge
sendFrame("message", res1.address(), res1.replyAddress(), responseHeaders, res1.isSend(), res1.body(), socket);
}));
} else {
代码示例来源:origin: vert-x3/vertx-tcp-eventbus-bridge
sendFrame("message", res1.address(), res1.replyAddress(), responseHeaders, res1.isSend(), res1.body(), socket);
}));
} else {
内容来源于网络,如有侵权,请联系作者删除!