Package org.vertx.java.core.eventbus

Examples of org.vertx.java.core.eventbus.EventBus.publish()


                eventBus.send(address, body, new CamelReplyHandler(exchange, callback));
                return false;
            } else {
                if (pubSub) {
                    LOG.debug("Publishing to: {} with body: {}", address, body);
                    eventBus.publish(address, body);
                } else {
                    LOG.debug("Sending to: {} with body: {}", address, body);
                    eventBus.send(address, body);
                }
                callback.done(true);
View Full Code Here


        if (!matcher.matches()) {
          return;
        }
        JsonObject collaborator = getCollaborator(body.getString(WebSocketBus.SESSION));
        collaborator.putBoolean(Key.IS_JOINED, body.getBoolean(Key.IS_JOINED));
        eb.publish(address + matcher.group(1) + Topic.PRESENCE + Topic.WATCH, collaborator);
      }
    }, new Handler<AsyncResult<Void>>() {
      @Override
      public void handle(AsyncResult<Void> ar) {
        if (ar.succeeded()) {
View Full Code Here

        Message in = exchange.getIn();

        JsonObject jsonObject = in.getBody(JsonObject.class);
        if (jsonObject != null) {
            LOG.debug("Publishing to: {} with JsonObject: {}", address, jsonObject);
            eventBus.publish(address, jsonObject);
            return;
        }
        JsonArray jsonArray = in.getBody(JsonArray.class);
        if (jsonArray != null) {
            LOG.debug("Publishing to: {} with JsonArray: {}", address, jsonArray);
View Full Code Here

            return;
        }
        JsonArray jsonArray = in.getBody(JsonArray.class);
        if (jsonArray != null) {
            LOG.debug("Publishing to: {} with JsonArray: {}", address, jsonArray);
            eventBus.publish(address, jsonArray);
            return;
        }

        // and fallback and use string which almost all can be converted
        String text = in.getBody(String.class);
View Full Code Here

        // and fallback and use string which almost all can be converted
        String text = in.getBody(String.class);
        if (text != null) {
            LOG.debug("Publishing to: {} with String: {}", address, text);
            eventBus.publish(address, new JsonObject(text));
            return;
        }
        throw new InvalidPayloadRuntimeException(exchange, String.class);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.