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 |
---|
__construct()
address() : string
string
body() : mixed
mixed
the body, or null.
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.
integer
string
headers() : \io\vertx\jphp\core\MultiMap
isSend() : boolean
boolean
true if this is a send.
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)
mixed
callable | array | DeliveryOptions
callable
replyAddress() : string
string
the reply address, or null, if message was sent without a reply handler.