new MessageConsumer()
- Source:
Methods
address() → {string}
- Source:
Returns:
The address the handler was registered with.
- Type
- string
bodyStream() → {ReadStream}
- Source:
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:
endHandler(endHandler) → {MessageConsumer}
Parameters:
| Name | Type | Description |
|---|---|---|
endHandler |
function |
- Source:
Returns:
- Type
- MessageConsumer
exceptionHandler(handler) → {MessageConsumer}
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
- Source:
Returns:
- Type
- MessageConsumer
fetch(amount) → {MessageConsumer}
Parameters:
| Name | Type | Description |
|---|---|---|
amount |
number |
- Source:
Returns:
- Type
- MessageConsumer
getMaxBufferedMessages() → {number}
- Source:
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:
Returns:
- Type
- MessageConsumer
isRegistered() → {boolean}
- Source:
Returns:
true if the current consumer is registered
- Type
- boolean
pause() → {MessageConsumer}
- Source:
Returns:
- Type
- MessageConsumer
pipe() → {Pipe}
Pause this stream and return a to transfer the elements of this stream to a destination .
The stream will be resumed when the pipe will be wired to a
WriteStream.
- Source:
Returns:
a pipe
- Type
- Pipe
pipeTo(dst, handler)
Pipe this
ReadStream to the WriteStream.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler will be
called with the result.
Parameters:
| Name | Type | Description |
|---|---|---|
dst |
WriteStream | the destination write stream |
handler |
function |
- Source:
resume() → {MessageConsumer}
- Source:
Returns:
- Type
- MessageConsumer
setMaxBufferedMessages(maxBufferedMessages) → {MessageConsumer}
Set the number of messages this registration will buffer when this stream is paused. The default
value is
1000.
When a new value is set, buffered messages may be discarded to reach the new value. The most recent messages will be kept.
Parameters:
| Name | Type | Description |
|---|---|---|
maxBufferedMessages |
number | the maximum number of messages that can be buffered |
- Source:
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: