Message

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

Messages have a @see \io\vertx\jphp\core\eventbus\Message::body, which can be null, and also @see \io\vertx\jphp\core\eventbus\Message::headers, which can be empty.

If the message was sent specifying a reply handler, it can be replied to using @see \io\vertx\jphp\core\eventbus\Message::reply.

If you want to notify the sender that processing failed, then @see \io\vertx\jphp\core\eventbus\Message::fail can be called.

package

Default

Methods

__construct

__construct() 

The address the message was sent to

address() : string

Response

string

The body of the message. Can be null.

body() : mixed

Response

mixed

the body, or null.

Signal to the sender that processing of this message failed.

fail( $arg0,  $arg1) : void

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.

Arguments

$arg0

integer

$arg1

string

Multi-map of message headers. Can be empty

headers() : \io\vertx\jphp\core\MultiMap

Response

\io\vertx\jphp\core\MultiMap

the headers

Signals if this message represents a send or publish event.

isSend() : boolean

Response

boolean

true if this is a send.

Reply to this message.

reply( $arg0,  $arg1 = null,  $arg2 = null) : void

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. param $message [mixed] the message to reply with. reply($message) The same as reply(R message) but you can specify handler for the reply - i.e. to receive the reply to the reply. param $message [mixed] the message to reply with. param $replyHandler [callable] the reply handler for the reply. reply($message, $replyHandler) Link @see \io\vertx\jphp\core\eventbus\Message::reply but allows you to specify delivery options for the reply. param $message [mixed] the reply message param $options [DeliveryOptions | array] the delivery options reply($message, $options) The same as reply(R message, DeliveryOptions) but you can specify handler for the reply - i.e. to receive the reply to the reply. param $message [mixed] the reply message param $options [DeliveryOptions | array] the delivery options param $replyHandler [callable] the reply handler for the reply. reply($message, $options, $replyHandler)

Arguments

$arg0

mixed

$arg1

callable | array | DeliveryOptions

$arg2

callable

The reply address. Can be null.

replyAddress() : string

Response

string

the reply address, or null, if message was sent without a reply handler.