Class EventBus
- java.lang.Object
- 
- io.vertx.mutiny.core.eventbus.EventBus
 
- 
- All Implemented Interfaces:
- Measured
 
 public class EventBus extends Object implements Measured A Vert.x event-bus is a light-weight distributed messaging system which allows different parts of your application, or different applications and services to communicate with each in a loosely coupled way.An event-bus supports publish-subscribe messaging, point-to-point messaging and request-response messaging. Message delivery is best-effort and messages can be lost if failure of all or part of the event bus occurs. Please refer to the documentation for more information on the event bus. NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
- 
- 
Field SummaryFields Modifier and Type Field Description static TypeArg<EventBus>__TYPE_ARG
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> EventBusaddInboundInterceptor(Consumer<DeliveryContext<T>> interceptor)<T> EventBusaddOutboundInterceptor(Consumer<DeliveryContext<T>> interceptor)<T> MessageConsumer<T>consumer(String address)<T> MessageConsumer<T>consumer(String address, Consumer<Message<T>> handler)booleanequals(Object o)io.vertx.core.eventbus.EventBusgetDelegate()inthashCode()booleanisMetricsEnabled()<T> MessageConsumer<T>localConsumer(String address)<T> MessageConsumer<T>localConsumer(String address, Consumer<Message<T>> handler)static EventBusnewInstance(io.vertx.core.eventbus.EventBus arg)EventBuspublish(String address, Object message)EventBuspublish(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options)<T> MessageProducer<T>publisher(String address)<T> MessageProducer<T>publisher(String address, io.vertx.core.eventbus.DeliveryOptions options)EventBusregisterCodec(io.vertx.core.eventbus.MessageCodec codec)<T> EventBusremoveInboundInterceptor(Consumer<DeliveryContext<T>> interceptor)<T> EventBusremoveOutboundInterceptor(Consumer<DeliveryContext<T>> interceptor)<T> io.smallrye.mutiny.Uni<Message<T>>request(String address, Object message)Sends a message and specify areplyHandlerthat will be called if the recipient subsequently replies to the message.<T> io.smallrye.mutiny.Uni<Message<T>>request(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options)Likerequest(java.lang.String, java.lang.Object)but specifyingoptionsthat can be used to configure the delivery.<T> Message<T>requestAndAwait(String address, Object message)Blocking variant ofrequest(String,Object).<T> Message<T>requestAndAwait(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options)Blocking variant ofrequest(String,Object,DeliveryOptions).<T> EventBusrequestAndForget(String address, Object message)Variant ofrequest(String,Object)that ignores the result of the operation.<T> EventBusrequestAndForget(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options)Variant ofrequest(String,Object,DeliveryOptions)that ignores the result of the operation.EventBussend(String address, Object message)EventBussend(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options)<T> MessageProducer<T>sender(String address)<T> MessageProducer<T>sender(String address, io.vertx.core.eventbus.DeliveryOptions options)StringtoString()EventBusunregisterCodec(String name)
 
- 
- 
- 
Constructor Detail- 
EventBuspublic EventBus(io.vertx.core.eventbus.EventBus delegate) 
 - 
EventBuspublic EventBus(Object delegate) 
 
- 
 - 
Method Detail- 
getDelegatepublic io.vertx.core.eventbus.EventBus getDelegate() - Specified by:
- getDelegatein interface- Measured
 
 - 
isMetricsEnabledpublic boolean isMetricsEnabled() - Specified by:
- isMetricsEnabledin interface- Measured
- Returns:
- trueif metrics are enabled
 
 - 
sendpublic EventBus send(String address, Object message) - Parameters:
- address- the address to send it to
- message- the message, may be- null
- Returns:
- a reference to this, so the API can be used fluently
 
 - 
sendpublic EventBus send(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options) - Parameters:
- address- the address to send it to
- message- the message, may be- null
- options- delivery options
- Returns:
- a reference to this, so the API can be used fluently
 
 - 
requestpublic <T> io.smallrye.mutiny.Uni<Message<T>> request(String address, Object message) Sends a message and specify areplyHandlerthat will be called if the recipient subsequently replies to the message.The message will be delivered to at most one of the handlers registered to the address. Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
- address- the address to send it to
- message- the message body, may be- null
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
requestAndAwaitpublic <T> Message<T> requestAndAwait(String address, Object message) Blocking variant ofrequest(String,Object).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Parameters:
- address- the address to send it to
- message- the message body, may be- null
- Returns:
- the Messageinstance produced by the operation. 
 
 - 
requestAndForgetpublic <T> EventBus requestAndForget(String address, Object message) Variant ofrequest(String,Object)that ignores the result of the operation.This method subscribes on the result of request(String,Object), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrequest(String,Object)but you don't need to compose it with other operations.- Parameters:
- address- the address to send it to
- message- the message body, may be- null
- Returns:
- the instance of EventBus to chain method calls.
 
 - 
requestpublic <T> io.smallrye.mutiny.Uni<Message<T>> request(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options) Likerequest(java.lang.String, java.lang.Object)but specifyingoptionsthat can be used to configure the delivery.Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
- address- the address to send it to
- message- the message body, may be- null
- options- delivery options
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
requestAndAwaitpublic <T> Message<T> requestAndAwait(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options) Blocking variant ofrequest(String,Object,DeliveryOptions).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Parameters:
- address- the address to send it to
- message- the message body, may be- null
- options- delivery options
- Returns:
- the Messageinstance produced by the operation. 
 
 - 
requestAndForgetpublic <T> EventBus requestAndForget(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options) Variant ofrequest(String,Object,DeliveryOptions)that ignores the result of the operation.This method subscribes on the result of request(String,Object,DeliveryOptions), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrequest(String,Object,DeliveryOptions)but you don't need to compose it with other operations.- Parameters:
- address- the address to send it to
- message- the message body, may be- null
- options- delivery options
- Returns:
- the instance of EventBus to chain method calls.
 
 - 
publishpublic EventBus publish(String address, Object message) - Parameters:
- address- the address to publish it to
- message- the message, may be- null
- Returns:
- a reference to this, so the API can be used fluently
 
 - 
publishpublic EventBus publish(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options) - Parameters:
- address- the address to publish it to
- message- the message, may be- null
- options- the delivery options
- Returns:
- a reference to this, so the API can be used fluently
 
 - 
consumerpublic <T> MessageConsumer<T> consumer(String address) - Parameters:
- address- the address that it will register it at
- Returns:
- the event bus message consumer
 
 - 
consumerpublic <T> MessageConsumer<T> consumer(String address, Consumer<Message<T>> handler) - Parameters:
- address- the address that will register it at
- handler- the handler that will process the received messages
- Returns:
 
 - 
localConsumerpublic <T> MessageConsumer<T> localConsumer(String address) - Parameters:
- address- the address to register it at
- Returns:
- the event bus message consumer
 
 - 
localConsumerpublic <T> MessageConsumer<T> localConsumer(String address, Consumer<Message<T>> handler) - Parameters:
- address- the address that will register it at
- handler- the handler that will process the received messages
- Returns:
 
 - 
senderpublic <T> MessageProducer<T> sender(String address) - Parameters:
- address- the address to send it to
- Returns:
- The sender
 
 - 
senderpublic <T> MessageProducer<T> sender(String address, io.vertx.core.eventbus.DeliveryOptions options) - Parameters:
- address- the address to send it to
- options- the delivery options
- Returns:
- The sender
 
 - 
publisherpublic <T> MessageProducer<T> publisher(String address) - Parameters:
- address- The address to publish it to
- Returns:
- The publisher
 
 - 
publisherpublic <T> MessageProducer<T> publisher(String address, io.vertx.core.eventbus.DeliveryOptions options) - Parameters:
- address- the address to publish it to
- options- the delivery options
- Returns:
- The publisher
 
 - 
addOutboundInterceptorpublic <T> EventBus addOutboundInterceptor(Consumer<DeliveryContext<T>> interceptor) - Parameters:
- interceptor- the interceptor
- Returns:
 
 - 
removeOutboundInterceptorpublic <T> EventBus removeOutboundInterceptor(Consumer<DeliveryContext<T>> interceptor) - Parameters:
- interceptor- the interceptor
- Returns:
 
 - 
addInboundInterceptorpublic <T> EventBus addInboundInterceptor(Consumer<DeliveryContext<T>> interceptor) - Parameters:
- interceptor- the interceptor
- Returns:
 
 - 
removeInboundInterceptorpublic <T> EventBus removeInboundInterceptor(Consumer<DeliveryContext<T>> interceptor) - Parameters:
- interceptor- the interceptor
- Returns:
 
 - 
registerCodecpublic EventBus registerCodec(io.vertx.core.eventbus.MessageCodec codec) - Parameters:
- codec- the message codec to register
- Returns:
- a reference to this, so the API can be used fluently
 
 - 
unregisterCodecpublic EventBus unregisterCodec(String name) - Parameters:
- name- the name of the codec
- Returns:
- a reference to this, so the API can be used fluently
 
 - 
newInstancepublic static EventBus newInstance(io.vertx.core.eventbus.EventBus arg) 
 
- 
 
-