Search in sources :

Example 6 with DeliveryOptions

use of io.vertx.core.eventbus.DeliveryOptions in project vert.x by eclipse.

the class Examples method example10.

public void example10(EventBus eventBus, MessageCodec myCodec) {
    eventBus.registerCodec(myCodec);
    DeliveryOptions options = new DeliveryOptions().setCodecName(myCodec.name());
    eventBus.send("orders", new MyPOJO(), options);
}
Also used : DeliveryOptions(io.vertx.core.eventbus.DeliveryOptions)

Example 7 with DeliveryOptions

use of io.vertx.core.eventbus.DeliveryOptions in project vert.x by eclipse.

the class Examples method headers.

public void headers(EventBus eventBus) {
    DeliveryOptions options = new DeliveryOptions();
    options.addHeader("some-header", "some-value");
    eventBus.send("news.uk.sport", "Yay! Someone kicked a ball", options);
}
Also used : DeliveryOptions(io.vertx.core.eventbus.DeliveryOptions)

Aggregations

DeliveryOptions (io.vertx.core.eventbus.DeliveryOptions)7 Test (org.junit.Test)5 EventBus (io.vertx.core.eventbus.EventBus)4 CountDownLatch (java.util.concurrent.CountDownLatch)4 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 io.vertx.core (io.vertx.core)1 Buffer (io.vertx.core.buffer.Buffer)1 DatagramSocket (io.vertx.core.datagram.DatagramSocket)1 MessageConsumer (io.vertx.core.eventbus.MessageConsumer)1 ReplyFailure (io.vertx.core.eventbus.ReplyFailure)1 FileSystem (io.vertx.core.file.FileSystem)1 io.vertx.core.http (io.vertx.core.http)1 MetricsOptions (io.vertx.core.metrics.MetricsOptions)1 NetSocket (io.vertx.core.net.NetSocket)1 PoolMetrics (io.vertx.core.spi.metrics.PoolMetrics)1 io.vertx.test.fakemetrics (io.vertx.test.fakemetrics)1 InetAddress (java.net.InetAddress)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1