vertx / io.vertx.rxjava.core.eventbus / Message

Message

open class Message<T : Any>

Represents a message that is received from the event bus in a handler.

Messages have a io.vertx.rxjava.core.eventbus.Message#body, which can be null, and also io.vertx.rxjava.core.eventbus.Message#headers, which can be empty.

If the message was sent specifying a reply handler it will also have a io.vertx.rxjava.core.eventbus.Message#replyAddress. In that case the message can be replied to using that reply address, or, more simply by just using io.vertx.rxjava.core.eventbus.Message#reply.

If you want to notify the sender that processing failed, then io.vertx.rxjava.core.eventbus.Message#fail can be called.

NOTE: This class has been automatically generated from the io.vertx.core.eventbus.Message non RX-ified interface using Vert.x codegen.

Constructors

<init>

Message(delegate: Message<Any>)
Message(delegate: Message<Any>, typeArg_0: TypeArg<T>)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<Message<Any>>

__typeArg_0

val __typeArg_0: TypeArg<T>

Functions

address

open fun address(): String

The address the message was sent to

body

open fun body(): T

The body of the message. Can be null.

equals

open fun equals(other: Any?): Boolean

fail

open fun fail(failureCode: Int, message: String): Unit

Signal to the sender that processing of this message failed.

If the message was sent specifying a result handler the handler will be called with a failure corresponding to the failure code and message specified here.

getDelegate

open fun getDelegate(): Message<Any>

hashCode

open fun hashCode(): Int

headers

open fun headers(): MultiMap

Multi-map of message headers. Can be empty

isSend

open fun isSend(): Boolean

Signals if this message represents a send or publish event.

newInstance

open static fun <T : Any> newInstance(arg: Message<Any>): Message<T>
open static fun <T : Any> newInstance(arg: Message<Any>, __typeArg_T: TypeArg<T>): Message<T>

reply

open fun reply(message: Any): Unit

Reply to this message.

If the message was sent specifying a reply handler, that handler will be called when it has received a reply. If the message wasn't sent specifying a receipt handler this method does nothing.

open fun <R : Any> reply(message: Any, replyHandler: Handler<AsyncResult<Message<R>>>): Unit

The same as reply(R message) but you can specify handler for the reply - i.e. to receive the reply to the reply.

open fun reply(message: Any, options: DeliveryOptions): Unit

Link io.vertx.rxjava.core.eventbus.Message#reply but allows you to specify delivery options for the reply.

open fun <R : Any> reply(message: Any, options: DeliveryOptions, replyHandler: Handler<AsyncResult<Message<R>>>): Unit

The same as reply(R message, DeliveryOptions) but you can specify handler for the reply - i.e. to receive the reply to the reply.

replyAddress

open fun replyAddress(): String

The reply address. Can be null.

rxReply

open fun <R : Any> rxReply(message: Any): Single<Message<R>>

The same as reply(R message) but you can specify handler for the reply - i.e. to receive the reply to the reply.

open fun <R : Any> rxReply(message: Any, options: DeliveryOptions): Single<Message<R>>

The same as reply(R message, DeliveryOptions) but you can specify handler for the reply - i.e. to receive the reply to the reply.

toString

open fun toString(): String