SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
AmqpClient models the CONNECTION class defined in AMQP 0-9-1 protocol
by abstracting the methods defined in the protocol and exposing a far simpler
API. Application developers should use
AmqpClientFactory#createAmqpClient()
function to create an
instance of AmqpClient.
Field Summary | |
Function
|
onclose
The onclose handler is called when the connection closes. |
Function
|
onerror
The onerror handler is called when the . |
Function
|
onopen
The onopen handler is called when the connection opens. |
Constructor Summary | |
AmqpClient(factory)
Application developers should use AmqpClientFactory.createAmqpClient() function to create an instance of AmqpClient. |
Method Summary | |
void
|
connect(config, callback)
Connects to the AMQP broker at the given URL with given credentials using Configuration style API with named parameters/properties. |
void
|
disconnect()
Disconnect from the AMQP broker |
AmqpClientFactory
|
getAmqpClientFactory()
Returns the AmqpClientFactory that was used to create AmqpClient. |
AmqpChannel
|
openChannel(callback)
Opens an AMQP Channel |
Field Detail |
Function onclose
Function onerror
Function onopen
Constructor Detail |
AmqpClient(factory)
factory
- {AmqpClientFactory} factory used to create AmqpClient instance
Method Detail |
void connect(config, callback)
For example, the developers should use this function as shown below:
var client = new AmqpClient(); var config = {url: 'ws://localhost:8001/amqp', virtualHost: '/', credentials: {username: 'guest', password: 'guest'} }; client.connect(config, openHandler);
Configuration config
- Format is as shown below:
{ url: 'url_str_value', virtualHost: 'vh_str_value', credentials: {username: 'uname_str_value', password: 'passwd_str_value'} }Note that 'url', 'virtualHost' and 'credentials' are required properties and valid values must be passed in. A JavaScript error is thrown if the aforementioned arguments are undefined, null, or empty string.
Function callback
- Optional param specifies the function that is
to be invoked on success.
void
void disconnect()
void
AmqpClientFactory getAmqpClientFactory()
AmqpClientFactory
AmqpChannel openChannel(callback)
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel