Package org.vertx.java.core.eventbus

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


        Object body = getVertxBody(exchange);
        if (body != null) {
            if (reply) {
                LOG.debug("Sending to: {} with body: {}", address, body);
                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);
View Full Code Here


                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);
                return true;
            }
        }
View Full Code Here

                    @Override
                    public void handle(final YokeRequest request, final Handler<Object> next) {

                        final Random random = ThreadLocalRandom.current();

                        eb.send(address, buildQuery("findone", "world", random.nextInt(10000) + 1), new Handler<Message<JsonObject>>() {
                            @Override
                            public void handle(Message<JsonObject> message) {
                                // get the body
                                final JsonObject body = message.body();
View Full Code Here

                                }
                            }
                        };

                        for (int i = 0; i < count; i++) {
                            eb.send(address, buildQuery("findone", "world", random.nextInt(10000) + 1), dbh);
                        }
                    }
                })
                // Test 4: fortune
                .use("/fortunes", new Middleware() {
View Full Code Here

                    @Override
                    public void handle(final YokeRequest request, final Handler<Object> next) {

                        final List<JsonObject> results = new ArrayList<>();

                        eb.send(address, buildQuery("find", "fortune"), new Handler<Message<JsonObject>>() {
                            @Override
                            public void handle(Message<JsonObject> reply) {
                                String status = reply.body().getString("status");

                                if (status != null) {
View Full Code Here

                                            .putNumber("id", received)
                                            .putNumber("randomNumber", body.getObject("result").getNumber("randomNumber"));
                                    worlds.add(world);

                                    world.putNumber("randomNumber", random.nextInt(10000) + 1);
                                    eb.send(address, buildUpdate("world", world.getInteger("id"), world.getInteger("randomNumber")));
                                }

                                // increase the counter
                                received++;
View Full Code Here

                                }
                            }
                        };

                        for (int i = 0; i < count; i++) {
                            eb.send(address, buildQuery("findone", "world", random.nextInt(10000) + 1), dbh);
                        }
                    }
                })
                // Test 6: plain text
                .use("/plaintext", new Middleware() {
View Full Code Here

        JsonObject createMsg = new JsonObject();
        createMsg.putString("exchange", "raw_xbee_frames");
        createMsg.putString("routingKey", "*.*");
        createMsg.putString("forward", handlerId);

        eb.send(AMQP_BRIDGE_ADDR + ".create-consumer", createMsg);
    }
    // }}}

    // {{{ testInvokeRpcWithSingleReply
    /**
 
View Full Code Here

        }

        // setup is done; fire off the EventBus invocation
        logger.fine("calling .invoke_rpc");

        eb.send(
            AMQP_BRIDGE_ADDR + ".invoke_rpc",
            new JsonObject()
                .putString("routingKey", amqpQueue)
                .putObject("properties", new JsonObject().putString("contentType", "application/json"))
                .putObject("body", new JsonObject().putString("foo", "bar")),
View Full Code Here

        }

        // setup is done; fire off the EventBus invocation
        logger.fine("calling .invoke_rpc");

        eb.send(
            AMQP_BRIDGE_ADDR + ".invoke_rpc",
            new JsonObject()
                .putString("routingKey", amqpQueue)
                .putString("replyTo", handlerId)
                .putObject(
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.