SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
AmqpChannel is a channel opened with the AMQP broker. Use AmqpClient.openChannel() to create a new AmqpChannel.
Field Summary | |
Function
|
onbindqueue
The bindqueue handler is called when a bind request completes. |
Function
|
oncancel
The cancel handler is called when a cancel request completes. |
Function
|
onclose
The close handler is called when the channel closes. |
Function
|
oncommittransaction
The committransaction handler is called when a transaction commit completes. |
Function
|
onconsume
The consume handler is called when a consume request completes. |
Function
|
ondeclareexchange
The declareexchange handler is called when an exchange declaration completes. |
Function
|
ondeclarequeue
The declarequeue handler is called when a queue declaration completes. |
Function
|
ondeleteexchange
The deleteexchange handler is called when a request to delete an exchange completes. |
Function
|
ondeletequeue
The deletequeue handler is called when a request to delete a queue completes. |
Function
|
onerror
The error handler is called when the channel . |
Function
|
onflow
The flow handler is called when a flow request completes. |
Function
|
onget
The get handler is called when a get request returns. |
Function
|
onmessage
The message handler is called when a message is received. |
Function
|
onopen
The open handler is called when the channel opens. |
Function
|
onpurgequeue
The purgequeue handler is called when a purge request completes. |
Function
|
onrecover
The recover handler is called when a recover request completes. |
Function
|
onreject
The reject handler is called when a reject request completes. |
Function
|
onrollbacktransaction
The rollbacktransaction handler is called when a transaction rollback completes. |
Function
|
onselecttransaction
The selecttransaction handler is called when a select request completes. |
Function
|
onunbindqueue
The unbindqueue handler is called when a request to unbind a queue from and exchange completes. |
Constructor Summary | |
AmqpChannel()
AmqpChannel |
Method Summary | |
AmqpChannel
|
ackBasic(config)
This method acknowledges one or more messages delivered via the Deliver or Get-Ok methods. |
AmqpChannel
|
bindQueue(config, callback)
This method binds a queue to an exchange. |
AmqpChannel
|
cancelBasic(config, callback)
This method cancels a consumer. |
AmqpChannel
|
closeChannel(config, callback)
This method indicates that the sender wants to close the channel. |
AmqpChannel
|
commitTx(callback)
This method commits all message publications and acknowledgments performed in the current transaction. |
AmqpChannel
|
consumeBasic(config, callback)
This method asks the server to start a "consumer", which is a transient request for messages from a specific queue. |
AmqpChannel
|
declareExchange(config, callback)
This method creates an exchange if it does not already exist, and if the exchange exists, verifies that it is of the correct and expected class. |
AmqpChannel
|
declareQueue(config, callback)
This method creates or checks a queue. |
AmqpChannel
|
deleteExchange(config, callback)
This method deletes an exchange. |
AmqpChannel
|
deleteQueue(config, callback)
This method deletes a queue. |
AmqpChannel
|
flowChannel(active, callback)
This method asks the peer to pause or restart the flow of content data sent by a consumer. |
AmqpChannel
|
flowOkChannel(active, callback)
Confirms to the peer that a flow command was received and processed. |
AmqpChannel
|
getBasic(config, callback)
This method provides a direct access to the messages in a queue using a synchronous dialogue that is designed for specific types of application where synchronous functionality is more important than performance. |
AmqpChannel
|
publishBasic(config, callback)
This method publishes a message to a specific exchange. |
AmqpChannel
|
purgeQueue(config, callback)
This method removes all messages from a queue which are not awaiting acknowledgment. |
AmqpChannel
|
qosBasic(config, callback)
This method requests a specific quality of service. |
AmqpChannel
|
recoverBasic(requeue, callback)
This method asks the server to redeliver all unacknowledged messages on a specified channel. |
AmqpChannel
|
rejectBasic(config)
This is the overloaded form of AmqpChannel.rejectBasic() function that named parameters or arguments using the Configuration object. |
AmqpChannel
|
rollbackTx(callback)
This method abandons all message publications and acknowledgments performed in the current transaction. |
AmqpChannel
|
selectTx(callback)
This method sets the channel to use standard transactions. |
AmqpChannel
|
unbindQueue(config, callback)
This method unbinds a queue from an exchange. |
Field Detail |
Function onbindqueue
Function oncancel
Function onclose
Function oncommittransaction
Function onconsume
Function ondeclareexchange
Function ondeclarequeue
Function ondeleteexchange
Function ondeletequeue
Function onerror
Function onflow
Function onget
Function onmessage
Function onopen
Function onpurgequeue
Function onrecover
Function onreject
Function onrollbacktransaction
Function onselecttransaction
Function onunbindqueue
Constructor Detail |
AmqpChannel()
Method Detail |
AmqpChannel ackBasic(config)
AmqpChannel.ackBasic() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {deliveryTag: dt, multiple: true}; channel.ackBasic(config);
Configuration config
- Format is as shown below:
{ deliveryTag: dt_num_value, multiple: true|false }Parameter 'deliveryTag' is required. Boolean parameter 'multiple' is optional with false as the default value.
AmqpChannel
AmqpChannel bindQueue(config, callback)
AmqpChannel.bindQueue() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {queue: myQueueName, exchange: myExchangeName, routingKey: key}; channel.bindQueue(config, callback);
Configuration config
- Format is as shown below:
{ queue: 'queue_name_str_value', exchange: 'exchange_name_str_value', routingKey: 'key_str_value' noWait: true|false, args: { } }Required parameter 'queue' specifies the queue name. Required parameter 'exchange' specifies the exchange name. Required parameter 'routingKey' specifies the key to be used to bind the queue to the exchange. Boolean parameter 'noWait' is optional with false as the default value. Param 'args' is an optional amd can be used to pass in additional properties for declaration.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel cancelBasic(config, callback)
AmqpChannel.cancelBasic() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {consumerTag: clientTag, noWait: true}; channel.cancelBasic(config, callback);
Configuration config
- Format is as shown below:
{ consumerTag: 'consumer_tag_str_value', noWait: true|false }Required parameter consumerTag' is required. Boolean parameters 'noWait' is optional with false as the default value.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel closeChannel(config, callback)
AmqpChannel.closeChannel() function that supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {replyCode: int1, replyText, 'foo', classId: int2, methodId: int3}; channel.closeChannel(config, callback);
Configuration config
- Format is as shown below:
{ replyCode: int_value, replyText: 'str_value', classId: int_value, methodId: int_value }Default values are as follows:
replyCode -- 0 replyText -- "" classId -- 0 methodId -- 0 callback -- undefined'callback' specifies a function to be called on success.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel commitTx(callback)
Function callback
- Function to be called on success
AmqpChannel
AmqpChannel consumeBasic(config, callback)
AmqpChannel.consumeBasic() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {queue: myQueueName, consumerTag: clientTag, exclusive: false, noLocal: true}; channel.consumeBasic(config, callback);
Configuration config
- Format is as shown below:
{ queue: 'queue_name_str_value', consumerTag: 'consumer_tag_str_value', noLocal: true|false, noAck: true|false, exclusive: true|false, noWait: true|false, args: { } }Required parameter 'queue' specifies the queue name. Parameter 'consumerTag' is required. Boolean parameters 'noLocal', 'noWait', and 'exclusive' are optional with false as the default value.
Boolean parameter 'noAck' is optional with default value of true. If noAck is true, the broker will not expect any acknowledgement from the client before discarding the message. If noAck is false, then the broker will expect an acknowledgement before discarding the message. If noAck is specified to be false, then it's developers responsibility to explicitly acknowledge the received message using AmqpChannel.ackBasic() as shown below:
var handleMessageReceived = function(event) { .... var props = event.properties; var exchange = event.args.exchange; var routingKey = event.args.routingKey; var dt = event.args.deliveryTag; var channel = event.target; // Acknowledge the received message. Otherwise, the broker will eventually // run out of memory. var config = {deliveryTag: dt, multiple: true}; setTimeout(function() { channel.ackBasic(config); }, 0); }Parameter 'args' is optional and can be used to pass in additional properties for declaration.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel declareExchange(config, callback)
AmqpChannel.declareExchange() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {exchange: myExchangeName, type: 'direct'}; channel.declareExchange(config, callback);
Configuration config
- Format is as shown below:
{ exchange: 'str_value', type: 'direct'|'fanout'|'headers'|'topic', passive: true|false, durable: true|false, noWait: true|false, args: { } }'exchange' specifies the name of the exchange and is a required param. The legal values of the required 'type' param are 'direct', 'fanout', 'headers', and 'topic' Boolean params 'passive', 'durable', and 'noWait' have a default value of false. Param 'args' is an optional param that can be used to pass in additional properties.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel declareQueue(config, callback)
AmqpChannel.declareQueue() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {queue: myQueueName, exclusive: false}; channel.declareQueue(config, callback);
Configuration config
- Format is as shown below:
{ queue: 'queue_name_str_value', passive: true|false, durable: true|false, exclusive: true|false, autoDelete: true|false, noWait: true|false, args: { } }Required parameter 'queue' specifies the queue name. Boolean parameters 'passive', 'durable', 'noWait', 'exclusive' and 'autoDelete' are optional with false as the default value. Param 'args' is an optional param that can be used to pass in additional properties for declaration.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel deleteExchange(config, callback)
AmqpChannel.deleteExchange() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {exchange: myExchangeName, noWait: false}; channel.deleteExchange(config, callback);
Configuration config
- Format is as shown below:
{ exchange: 'exchange_name_str_value', ifUnused: true|false, noWait: true|false }Required parameter 'exchange' specifies the name of the exchange. Default values of the optional boolean parameters 'ifUnused' and 'noWait' is false.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel deleteQueue(config, callback)
AmqpChannel.deleteQueue() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {queue: myQueueName, ifEmpty: true}; channel.deleteQueue(config, callback);
Configuration config
- Format is as shown below:
{
queue: 'queue_name_str_value',
ifUnused: true|false,
ifEmpty: true|false,
noWait: true|false
}
Required parameter 'queue' specifies the queue name. Boolean parameters
'ifUnused', 'ifEmpty', and 'noWait' are optional with false as the default
value.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel flowChannel(active, callback)
Bit active
- start/stop content frames
Function callback
- Function to be called on success
AmqpChannel
AmqpChannel flowOkChannel(active, callback)
Bit active
- current flow setting
Function callback
- Function to be called on success
AmqpChannel
AmqpChannel getBasic(config, callback)
AmqpChannel.getBasic() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {queue: myQueueName, noAck: true}; channel.getBasic(config, callback);
Configuration config
- Format is as shown below:
{ queue: 'queue_name_str_value', noAck: true|false }Required parameter 'queue' specifies the queue name. Boolean parameter 'noAck' is optional with false as the default value.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel publishBasic(config, callback)
AmqpChannel.publishBasic() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var props = new AmqpProperties(); props.setMessageId("msgId1"); var config = {body: buffer, properties: props, exchange: myExchangeName, routingKey: key}; channel.publishBasic(config, callback);
Configuration config
- Format is as shown below:
{ body: ArrayBuffer_or_ByteBuffer_instance, properties: AmqpProperties_instance, exchange: 'exchange_name_str_value', routingKey: 'routingKey_str_value', mandatory: true|false, immediate: true|false }Required parameter 'body' takes an instance of either ArrayBuffer or ByteBuffer. Newer browsers support ArrayBuffer. However, developers can continue to support older browsers by specify a ByteBuffer payload as 'body'. The 'properties' parameter takes an instance of AmqpProperties topass the pre-defined properties as per AMQP 0-9-1 specification. AmqpProperties provides getter/setter APIs for all the pre-defined properties as a convenience. Required parameter 'exchange' specifies the name of the exchange. Parameter 'routingKey' is required. Boolean parameters 'mandatory' and 'immediate' are optional with false as the default value.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel purgeQueue(config, callback)
AmqpChannel.purgeQueue() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {queue: myQueueName}; channel.purgeQueue(config, callback);
Configuration config
- Format is as shown below:
{ queue: 'queue_name_str_value', noWait: true|false }Required parameter 'queue' specifies the queue name. Boolean parameter 'noWait' is optional with false as the default value.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel qosBasic(config, callback)
AmqpChannel.qosBasic() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {prefetchSize: size, prefetchCount: count, global: true}; channel.qosBasic(config, callback);
Configuration config
- Format is as shown below:
{ prefetchSize: size_long_value_in_octets, prefetchCount: count_short_value_in_octets, global: true|false }Parameter 'prefetchSize' and 'prefetchCount' are required. Boolean parameter 'global' is optional with false as the default value.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel
AmqpChannel recoverBasic(requeue, callback)
Bit requeue
- requeue the message
Function callback
- Function to be called on success
AmqpChannel
AmqpChannel rejectBasic(config)
AmqpChannel.rejectBasic() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {deliveryTag: dt, requeue: true}; channel.rejectBasic(config);This method allows a client to reject a message. It can be used to interrupt and cancel large incoming messages, or return untreatable messages to their original queue.
Configuration config
- Format is as shown below:
{ deliveryTag: dt_num_value, requeue: true|false }Parameter 'deliveryTag' is required. Boolean parameter 'requeue' is optional with false as the default value.
AmqpChannel
AmqpChannel rollbackTx(callback)
Function callback
- Function to be called on success
AmqpChannel
AmqpChannel selectTx(callback)
Function callback
- Function to be called on success
AmqpChannel
AmqpChannel unbindQueue(config, callback)
AmqpChannel.unbindQueue() function supports named parameters or arguments using the Configuration object. Developers must invoke this function as shown below:
var channel = ...; var config = {queue: myQueueName, exchange: exchangeName, routingKey: key}; channel.unbindQueue(config, callback);
Configuration config
- Format is as shown below:
{ queue: 'queue_name_str_value', exchange: 'exchange_name_str_value', routingKey: 'routingKey_str_value', args: { } }Required parameter 'queue' specifies the queue name. Required parameter 'exchange' specifies the exchange name. Required parameter 'routingKey' specifies the key that was used to bind the queue to the exchange. Parameter 'args' is optional and can be used to pass in additional properties for declaration. Optional param 'callback' specifies the function to be invoked on success.
Function callback
- Optional param specifies the function that is
to be invoked on success.
AmqpChannel