new AmqpReceiver()
Interface used to consume AMQP message as a stream of message.
Back pressure is implemented using AMQP credits.
Methods
address() → {string}
The listened address.
Returns:
the address, not
null
- Type
- string
close(handler)
Closes the receiver.
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function | handler called when the receiver has been closed, can be null |
connection() → {AmqpConnection}
Gets the connection having created the receiver. Cannot be
null
Returns:
the connection having created the receiver.
- Type
- AmqpConnection
endHandler(endHandler) → {AmqpReceiver}
Parameters:
| Name | Type | Description |
|---|---|---|
endHandler |
function |
Returns:
- Type
- AmqpReceiver
exceptionHandler(handler) → {AmqpReceiver}
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
Returns:
- Type
- AmqpReceiver
fetch(amount) → {AmqpReceiver}
Parameters:
| Name | Type | Description |
|---|---|---|
amount |
number |
Returns:
- Type
- AmqpReceiver
handler(handler) → {AmqpReceiver}
Parameters:
| Name | Type | Description |
|---|---|---|
handler |
function |
Returns:
- Type
- AmqpReceiver
pause() → {AmqpReceiver}
Returns:
- Type
- AmqpReceiver
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.
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 |
resume() → {AmqpReceiver}
Returns:
- Type
- AmqpReceiver