Class: Message

vertx-js/message~ Message

new Message()

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

Source:

Methods

address() → {string}

The address the message was sent to
Source:
Returns:
Type
string

body() → {Object}

The body of the message. Can be null.
Source:
Returns:
the body, or null.
Type
Object

fail(failureCode, message)

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.

Parameters:
Name Type Description
failureCode number A failure code to pass back to the sender
message string A message to pass back to the sender
Source:

headers() → {MultiMap}

Multi-map of message headers. Can be empty
Source:
Returns:
the headers
Type
MultiMap

isSend() → {boolean}

Signals if this message represents a send or publish event.
Source:
Returns:
true if this is a send.
Type
boolean

reply(message, options)

Link Message#reply but allows you to specify delivery options for the reply.
Parameters:
Name Type Description
message Object the reply message
options Object the delivery options
Source:

replyAddress() → {string}

The reply address. Can be null.
Source:
Returns:
the reply address, or null, if message was sent without a reply handler.
Type
string

replyAndRequest(message, options, replyHandler)

Like Message#replyAndRequest but specifying options that can be used to configure the delivery.
Parameters:
Name Type Description
message Object the message body, may be null
options Object delivery options
replyHandler function reply handler will be called when any reply from the recipient is received
Source: