Methods
close(closeHandler)
Closes the client.
The client must always be closed once not needed anymore.
Parameters:
| Name | Type | Description |
|---|---|---|
closeHandler |
function | the close handler notified when the operation completes. It can be null. |
connect(connectionHandler) → {AmqpClient}
Connects to the AMQP broker or router. The location is specified in the AmqpClientOptions as well as the
potential credential required.
Parameters:
| Name | Type | Description |
|---|---|---|
connectionHandler |
function | handler that will process the result, giving either the connection or failure cause. Must not be null. |
Returns:
- Type
- AmqpClient
createReceiver(address, receiverOptions, completionHandler) → {AmqpClient}
Creates a receiver used to consumer messages from the given address. This method avoids having to connect
explicitly. You can retrieve the connection using AmqpReceiver#connection.
Parameters:
| Name | Type | Description |
|---|---|---|
address |
string | The source address to attach the consumer to. |
receiverOptions |
Object | The options for this receiver. |
completionHandler |
function | The handler called with the receiver, once opened. Note that the messageHandler can be called before the completionHandler if messages are awaiting delivery. |
Returns:
the connection.
- Type
- AmqpClient
createSender(address, options, completionHandler) → {AmqpClient}
Creates a sender used to send messages to the given address. The address must be set.
Parameters:
| Name | Type | Description |
|---|---|---|
address |
string | The target address to attach to, must not be null |
options |
Object | The options for this sender. |
completionHandler |
function | The handler called with the sender, once opened |
Returns:
the client.
- Type
- AmqpClient