io.vertx.core.eventbus.Message.address()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中io.vertx.core.eventbus.Message.address()方法的一些代码示例,展示了Message.address()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.address()方法的具体详情如下:
包路径:io.vertx.core.eventbus.Message
类名称:Message
方法名:address

Message.address介绍

[英]The address the message was sent to
[中]邮件发送到的地址

代码示例

代码示例来源:origin: eclipse-vertx/vert.x

protected <T> Handler<Message<T>> convertHandler(Handler<AsyncResult<Message<T>>> handler) {
 return reply -> {
  Future<Message<T>> result;
  if (reply.body() instanceof ReplyException) {
   // This is kind of clunky - but hey-ho
   ReplyException exception = (ReplyException) reply.body();
   if (metrics != null) {
    metrics.replyFailure(reply.address(), exception.failureType());
   }
   result = Future.failedFuture(exception);
  } else {
   result = Future.succeededFuture(reply);
  }
  handler.handle(result);
 };
}

代码示例来源:origin: eclipse-vertx/vert.x

log.error("Failed to handleMessage. address: " + message.address(), e);
if (metrics != null) {
 metrics.endHandleMessage(metric, e);

代码示例来源:origin: eclipse-vertx/vert.x

@Test
 public void testMessageBodyInterceptor() throws Exception {
  String content = TestUtils.randomUnicodeString(13);
  startNodes(2);
  waitFor(2);
  CountDownLatch latch = new CountDownLatch(1);
  vertices[0].eventBus().registerCodec(new StringLengthCodec()).<Integer>consumer("whatever", msg -> {
   assertEquals(content.length(), (int) msg.body());
   complete();
  }).completionHandler(ar -> latch.countDown());
  awaitLatch(latch);
  StringLengthCodec codec = new StringLengthCodec();
  vertices[1].eventBus().registerCodec(codec).addOutboundInterceptor(sc -> {
   if ("whatever".equals(sc.message().address())) {
    assertEquals(content, sc.body());
    complete();
   }
   sc.next();
  }).send("whatever", content, new DeliveryOptions().setCodecName(codec.name()));
  await();
 }
}

代码示例来源:origin: io.vertx/vertx-core

protected <T> Handler<Message<T>> convertHandler(Handler<AsyncResult<Message<T>>> handler) {
 return reply -> {
  Future<Message<T>> result;
  if (reply.body() instanceof ReplyException) {
   // This is kind of clunky - but hey-ho
   ReplyException exception = (ReplyException) reply.body();
   if (metrics != null) {
    metrics.replyFailure(reply.address(), exception.failureType());
   }
   result = Future.failedFuture(exception);
  } else {
   result = Future.succeededFuture(reply);
  }
  handler.handle(result);
 };
}

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * The address the message was sent to
 * @return 
 */
public String address() { 
 String ret = delegate.address();
 return ret;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * The address the message was sent to
 * @return 
 */
public String address() { 
 String ret = delegate.address();
 return ret;
}

代码示例来源:origin: org.jboss.weld.vertx/weld-vertx-core

@Override
public String getAddress() {
  return message.address();
}

代码示例来源:origin: weld/weld-vertx

@Override
public String getAddress() {
  return message.address();
}

代码示例来源:origin: io.vertx/vertx-core

log.error("Failed to handleMessage. address: " + message.address(), e);
if (metrics != null) {
 metrics.endHandleMessage(metric, e);

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
public void handle(Message<MessageStatus> event) {
  statusMessage = event.body();
  _logger.debug("Event received: [address:{}, body:{}]", event.address(), event.body());
}

代码示例来源:origin: io.vertx/vertx-core

@Test
 public void testMessageBodyInterceptor() throws Exception {
  String content = TestUtils.randomUnicodeString(13);
  startNodes(2);
  waitFor(2);
  CountDownLatch latch = new CountDownLatch(1);
  vertices[0].eventBus().registerCodec(new StringLengthCodec()).<Integer>consumer("whatever", msg -> {
   assertEquals(content.length(), (int) msg.body());
   complete();
  }).completionHandler(ar -> latch.countDown());
  awaitLatch(latch);
  StringLengthCodec codec = new StringLengthCodec();
  vertices[1].eventBus().registerCodec(codec).addOutboundInterceptor(sc -> {
   if ("whatever".equals(sc.message().address())) {
    assertEquals(content, sc.body());
    complete();
   }
   sc.next();
  }).send("whatever", content, new DeliveryOptions().setCodecName(codec.name()));
  await();
 }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
public void handle(Message<MessageStatus> event) {
  statusMessage = event.body();
  _logger.debug("Event received: [address:{}, body:{}]", event.address(), event.body());
}

代码示例来源:origin: gentics/mesh

/**
 * Register the event handler which can be used to invalidate the LRU cache.
 */
public static void registerEventHandler() {
  Mesh.vertx().eventBus().consumer(EVENT_CLEAR_PERMISSION_STORE, e -> {
    if (log.isDebugEnabled()) {
      log.debug("Clearing permission store due to received event from {" + e.address() + "}");
    }
    PERM_CACHE.invalidateAll();
  });
}

代码示例来源:origin: io.vertx/vertx-stomp

.add(Frame.DESTINATION, msg.address());
if (!"auto".equals(subscription.ackMode)) {

代码示例来源: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 {

代码示例来源:origin: org.swisspush/redisques

final JsonObject body = event.body();
if (null == body) {
  log.warn("Got msg with empty body from event bus. We'll run directly in a NullPointerException now. address={}  replyAddress={} ", event.address(), event.replyAddress());
final String queue = event.body();
if (queue == null) {
  log.warn("Got event bus msg with empty body! _28904718b4af0cc_  uid={}  address={}  replyAddress={}", uid, event.address(), event.replyAddress());

代码示例来源:origin: io.vertx/vertx-amqp-bridge

context.assertEquals(replyContent, reply.result().body().getValue(AmqpConstants.BODY),
  "unexpected reply msg content");
context.assertNotNull(reply.result().address(), "address was not set on reply");
context.assertNull(reply.result().replyAddress(), "reply address was unexpectedly set on the reply");

代码示例来源:origin: io.vertx/vertx-amqp-bridge

context.assertEquals(replyContent, replyMessage.body().getValue(AmqpConstants.BODY),
  "unexpected reply msg content");
context.assertNotNull(replyMessage.address(), "address was not set on the reply");
context.assertNotNull(replyMessage.replyAddress(), "reply address was not set on the reply");

相关文章