# Class: MessageConsumer

## vertx-js/message_consumer~ MessageConsumer

#### new MessageConsumer()

Source:
  - vertx-js/message_consumer.js, line 30

### Methods

#### address() → {string}

Source:
  - vertx-js/message_consumer.js, line 145

##### Returns:

- The address the handler was registered with.
- Type
    string

#### bodyStream() → {ReadStream}

Source:
  - vertx-js/message_consumer.js, line 117

##### Returns:

- a read stream for the body of the message stream.
- Type
    ReadStream

#### completionHandler(completionHandler)

Optional method which can be called to indicate when the registration has been propagated across the cluster.

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | the completion handler

Source:
  - vertx-js/message_consumer.js, line 188

#### endHandler(endHandler) → {MessageConsumer}

##### Parameters:

Name | Type | Description
--- | --- | ---
`endHandler` | function |

Source:
  - vertx-js/message_consumer.js, line 102

##### Returns:

Type
  MessageConsumer

#### exceptionHandler(handler) → {MessageConsumer}

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

Source:
  - vertx-js/message_consumer.js, line 42

##### Returns:

Type
  MessageConsumer

#### getMaxBufferedMessages() → {number}

Source:
  - vertx-js/message_consumer.js, line 175

##### Returns:

- the maximum number of messages that can be buffered when this stream is paused
- Type
    number

#### handler(handler) → {MessageConsumer}

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function |

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

##### Returns:

Type
  MessageConsumer

#### isRegistered() → {boolean}

Source:
  - vertx-js/message_consumer.js, line 131

##### Returns:

- true if the current consumer is registered
- Type
    boolean

#### pause() → {MessageConsumer}

Source:
  - vertx-js/message_consumer.js, line 74

##### Returns:

Type
  MessageConsumer

#### resume() → {MessageConsumer}

Source:
  - vertx-js/message_consumer.js, line 88

##### Returns:

Type
  MessageConsumer

#### setMaxBufferedMessages(maxBufferedMessages) → {MessageConsumer}

Set the number of messages this registration will buffer when this stream is paused. The default value is `0`. When a new value is set, buffered messages may be discarded to reach the new value.

##### Parameters:

Name | Type | Description
--- | --- | ---
`maxBufferedMessages` | number | the maximum number of messages that can be buffered

Source:
  - vertx-js/message_consumer.js, line 161

##### Returns:

this registration

Type
  MessageConsumer

#### unregister(completionHandler)

Unregisters the handler which created this registration

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | the handler called when the unregister is done. For example in a cluster when all nodes of the event bus have been unregistered.

Source:
  - vertx-js/message_consumer.js, line 207