new AMQPClient(options, callbackopt)
- Source:
- Author:
-
A wrapper over AMQP, providing methods to publish and subscribe.
Parameters:
Name |
Type |
Attributes |
Description |
options |
object
|
|
Options passed to the AMQP client
Properties
Name |
Type |
Attributes |
Default |
Description |
uri |
string
|
|
|
URI of the AMQP broker to connect |
exchange |
string
|
<optional>
|
exchange
|
Exchange name |
exchangeType |
string
|
<optional>
|
topic
|
Exchange type |
queue |
string
|
<optional>
|
$pid
|
Queue name |
durable |
string
|
<optional>
|
false
|
Queue durability |
|
callback |
function
|
<optional>
|
Callback |
Methods
emit(type, data, callbackopt)
- Source:
Publishes message for any client interested to subscribe and listen to.
Parameters:
Name |
Type |
Attributes |
Description |
type |
string
|
|
Type of the message |
data |
*
|
|
Data to be sent |
callback |
function
|
<optional>
|
Callback |
on(type, callback)
- Source:
Registers a listener for messages of a particular type.
Parameters: