# Class: Message

## vertx-js/message~ Message

#### new Message()

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

Source:
  - vertx-js/message.js, line 31

### Methods

#### address() → {string}

The address the message was sent to

Source:
  - vertx-js/message.js, line 44

##### Returns:

Type
  string

#### body() → {Object}

The body of the message. Can be null.

Source:
  - vertx-js/message.js, line 72

##### 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:
  - vertx-js/message.js, line 154

#### headers() → {MultiMap}

Multi-map of message headers. Can be empty

Source:
  - vertx-js/message.js, line 58

##### Returns:

the headers

Type
  MultiMap

#### isSend() → {boolean}

Signals if this message represents a send or publish event.

Source:
  - vertx-js/message.js, line 103

##### Returns:

true if this is a send.

Type
  boolean

#### reply(message, options, replyHandler)

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | Object | the reply message
`options` | Object | the delivery options
`replyHandler` | function | the reply handler for the reply.

Source:
  - vertx-js/message.js, line 119

#### replyAddress() → {string}

The reply address. Can be null.

Source:
  - vertx-js/message.js, line 89

##### Returns:

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

Type
  string