# Class: MessageProducer

## vertx-js/message_producer~ MessageProducer

#### new MessageProducer()

Represents a stream of message that can be written to.

Source:
  - vertx-js/message_producer.js, line 33

### Methods

#### address() → {string}

Source:
  - vertx-js/message_producer.js, line 172

##### Returns:

The address to which the producer produces messages.

Type
  string

#### close()

Closes the producer, this method should be called when the message producer is not used anymore.

Source:
  - vertx-js/message_producer.js, line 185

#### deliveryOptions(options) → {MessageProducer}

Update the delivery options of this producer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`options` | Object | the new options

Source:
  - vertx-js/message_producer.js, line 158

##### Returns:

this producer object

Type
  MessageProducer

#### drainHandler(handler) → {MessageProducer}

##### Parameters:

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

Source:
  - vertx-js/message_producer.js, line 143

##### Returns:

Type
  MessageProducer

#### end(t)

Same as MessageProducer#end but writes some data to the stream before ending.

##### Parameters:

Name | Type | Description
--- | --- | ---
`t` | Object |

Source:
  - vertx-js/message_producer.js, line 46

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

##### Parameters:

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

Source:
  - vertx-js/message_producer.js, line 99

##### Returns:

Type
  MessageProducer

#### send(message, replyHandler) → {MessageProducer}

Like MessageProducer#send but specifying a `replyHandler` that will be called if the recipient subsequently replies to the message.

##### Parameters:

Name | Type | Description
--- | --- | ---
`message` | Object | the message to send
`replyHandler` | function | reply handler will be called when any reply from the recipient is received, may be `null`

Source:
  - vertx-js/message_producer.js, line 78

##### Returns:

reference to this for fluency

Type
  MessageProducer

#### setWriteQueueMaxSize(maxSize) → {MessageProducer}

##### Parameters:

Name | Type | Description
--- | --- | ---
`maxSize` | number |

Source:
  - vertx-js/message_producer.js, line 129

##### Returns:

Type
  MessageProducer

#### write(data) → {MessageProducer}

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | Object |

Source:
  - vertx-js/message_producer.js, line 115

##### Returns:

Type
  MessageProducer

#### writeQueueFull() → {boolean}

This will return `true` if there are more bytes in the write queue than the value set using MessageProducer#setWriteQueueMaxSize

Source:
  - vertx-js/message_producer.js, line 62

##### Returns:

true if write queue is full

Type
  boolean