vertx / io.vertx.reactivex.core.eventbus / EventBus

EventBus

open class EventBus : 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 the io.vertx.core.eventbus.EventBus non RX-ified interface using Vert.x codegen.

Constructors

<init>

EventBus(delegate: EventBus)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<EventBus>

Functions

addInterceptor

open fun addInterceptor(interceptor: Handler<SendContext<Any>>): EventBus

Add an interceptor that will be called whenever a message is sent from Vert.x

consumer

open fun <T : Any> consumer(address: String): MessageConsumer<T>

Create a message consumer against the specified address.

The returned consumer is not yet registered at the address, registration will be effective when io.vertx.reactivex.core.eventbus.MessageConsumer#handler is called.

open fun <T : Any> consumer(address: String, handler: Handler<Message<T>>): MessageConsumer<T>

Create a consumer and register it against the specified address.

equals

open fun equals(other: Any?): Boolean

getDelegate

open fun getDelegate(): EventBus

hashCode

open fun hashCode(): Int

isMetricsEnabled

open fun isMetricsEnabled(): Boolean

Whether the metrics are enabled for this measured object

localConsumer

open fun <T : Any> localConsumer(address: String): MessageConsumer<T>
open fun <T : Any> localConsumer(address: String, handler: Handler<Message<T>>): MessageConsumer<T>

Like io.vertx.reactivex.core.eventbus.EventBus#consumer but the address won't be propagated across the cluster.

newInstance

open static fun newInstance(arg: EventBus): EventBus

publish

open fun publish(address: String, message: Any): EventBus

Publish a message.

The message will be delivered to all handlers registered to the address.

open fun publish(address: String, message: Any, options: DeliveryOptions): EventBus

Like io.vertx.reactivex.core.eventbus.EventBus#publish but specifying options that can be used to configure the delivery.

publisher

open fun <T : Any> publisher(address: String): MessageProducer<T>

Create a message publisher against the specified address.

The returned publisher will invoke the io.vertx.reactivex.core.eventbus.EventBus#publish method when the stream io.vertx.reactivex.core.streams.WriteStream#write method is called with the publisher address and the provided data.

open fun <T : Any> publisher(address: String, options: DeliveryOptions): MessageProducer<T>

Like io.vertx.reactivex.core.eventbus.EventBus#publisher but specifying delivery options that will be used for configuring the delivery of the message.

removeInterceptor

open fun removeInterceptor(interceptor: Handler<SendContext<Any>>): EventBus

Remove an interceptor

rxSend

open fun <T : Any> rxSend(address: String, message: Any): Single<Message<T>>
open fun <T : Any> rxSend(address: String, message: Any, options: DeliveryOptions): Single<Message<T>>

Like io.vertx.reactivex.core.eventbus.EventBus#send but specifying a replyHandler that will be called if the recipient subsequently replies to the message.

send

open fun send(address: String, message: Any): EventBus

Sends a message.

The message will be delivered to at most one of the handlers registered to the address.

open fun <T : Any> send(address: String, message: Any, replyHandler: Handler<AsyncResult<Message<T>>>): EventBus
open fun <T : Any> send(address: String, message: Any, options: DeliveryOptions, replyHandler: Handler<AsyncResult<Message<T>>>): EventBus

Like io.vertx.reactivex.core.eventbus.EventBus#send but specifying a replyHandler that will be called if the recipient subsequently replies to the message.

open fun send(address: String, message: Any, options: DeliveryOptions): EventBus

Like io.vertx.reactivex.core.eventbus.EventBus#send but specifying options that can be used to configure the delivery.

sender

open fun <T : Any> sender(address: String): MessageProducer<T>

Create a message sender against the specified address.

The returned sender will invoke the io.vertx.reactivex.core.eventbus.EventBus#send method when the stream io.vertx.reactivex.core.streams.WriteStream#write method is called with the sender address and the provided data.

open fun <T : Any> sender(address: String, options: DeliveryOptions): MessageProducer<T>

Like io.vertx.reactivex.core.eventbus.EventBus#sender but specifying delivery options that will be used for configuring the delivery of the message.

toString

open fun toString(): String