Packagecom.kaazing.gateway.amqp.client
Classpublic class AmqpChannel
InheritanceAmqpChannel Inheritance flash.events.EventDispatcher

AmqpChannel represents the channel created on the AMQP connection to the server. Declaring of exchanges, queues, binding queues to exchanges, sending and receiving messages and transactions are handled using methods on this class.



Public Methods
 MethodDefined by
  
AmqpChannel(id:int, connection:Object, cb:Function = null)
AmqpChannel
  
ackBasic(deliveryTag:Number, multiple:Boolean):AmqpChannel
This method acknowledges one or more messages delivered via the Deliver or Get-Ok methods.
AmqpChannel
  
bindQueue(queue:String, exchange:String, routingKey:String, noWait:Boolean, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel
This method binds a queue to an exchange.
AmqpChannel
  
cancelBasic(consumerTag:String, noWait:Boolean, callback:Function = null):AmqpChannel
This method cancels a consumer.
AmqpChannel
  
closeChannel(replyCode:Number, replyText:String, classId:Number, methodId:Number, callback:Function = null):AmqpChannel
This method indicates that the sender wants to close the channel.
AmqpChannel
  
closeOkChannel(callback:Function = null):AmqpChannel
Confirms to the peer that a flow command was received and processed.
AmqpChannel
  
commitTx(callback:Function = null):AmqpChannel
This method commits all message publications and acknowledgments performed in the current transaction.
AmqpChannel
  
consumeBasic(queue:String, consumerTag:String, noLocal:Boolean, noAck:Boolean, exclusive:Boolean, noWait:Boolean, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel
This method asks the server to start a "consumer", which is a transient request for messages from a specific queue.
AmqpChannel
  
declareExchange(exchange:String, type:String, passive:Boolean, durable:Boolean, noWait:Boolean, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel
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(queue:String, passive:Boolean, durable:Boolean, exclusive:Boolean, autoDelete:Boolean, noWait:Boolean, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel
This method creates or checks a queue.
AmqpChannel
  
deleteExchange(exchange:String, ifUnused:Boolean, noWait:Boolean, callback:Function = null):AmqpChannel
This method deletes an exchange.
AmqpChannel
  
deleteQueue(queue:String, ifUnused:Boolean, ifEmpty:Boolean, noWait:Boolean, callback:Function = null):AmqpChannel
This method deletes a queue.
AmqpChannel
  
flowChannel(active:Boolean, callback:Function = null):AmqpChannel
This method asks the peer to pause or restart the flow of content data sent by a consumer.
AmqpChannel
  
flowOkChannel(active:Boolean, callback:Function = null):AmqpChannel
Confirms to the peer that a flow command was received and processed.
AmqpChannel
  
getBasic(queue:String, noAck:Boolean, callback:Function = null):AmqpChannel
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
  
openChannel(callback:Function = null):AmqpChannel
AmqpChannel
  
publishBasic(body:ByteBuffer, amqpProperties:AmqpProperties, exchange:String, routingKey:String, mandatory:Boolean, immediate:Boolean, callback:Function = null):AmqpChannel

This method publishes a message to a specific exchange.

AmqpChannel
  
purgeQueue(queue:String, noWait:Boolean, callback:Function = null):AmqpChannel
This method removes all messages from a queue which are not awaiting acknowledgment.
AmqpChannel
  
qosBasic(prefetchSize:Number, prefetchCount:Number, global:Boolean, callback:Function = null):AmqpChannel
This method requests a specific quality of service.
AmqpChannel
  
recoverBasic(requeue:Boolean, callback:Function = null):AmqpChannel
This method asks the server to redeliver all unacknowledged messages on a specified channel.
AmqpChannel
  
rejectBasic(deliveryTag:Number, requeue:Boolean):AmqpChannel
This method allows a client to reject a message.
AmqpChannel
  
rollbackTx(callback:Function = null):AmqpChannel
This method abandons all message publications and acknowledgments performed in the current transaction.
AmqpChannel
  
selectTx(callback:Function = null):AmqpChannel
This method sets the channel to use standard transactions.
AmqpChannel
  
unbindQueue(queue:String, exchange:String, routingKey:String, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel
This method unbinds a queue from an exchange.
AmqpChannel
Events
 EventSummaryDefined by
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
  
get
 AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
    AmqpChannel
Constructor detail
AmqpChannel()constructor
public function AmqpChannel(id:int, connection:Object, cb:Function = null)Parameters
id:int
 
connection:Object
 
cb:Function (default = null)
Method detail
ackBasic()method
public function ackBasic(deliveryTag:Number, multiple:Boolean):AmqpChannel

This method acknowledges one or more messages delivered via the Deliver or Get-Ok methods. The client can ask to confirm a single message or a set of messages up to and including a specific message.

Parameters
deliveryTag:Number
 
multiple:Boolean

Returns
AmqpChannel
bindQueue()method 
public function bindQueue(queue:String, exchange:String, routingKey:String, noWait:Boolean, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel

This method binds a queue to an exchange. Until a queue is bound it will not receive any messages. In a classic messaging model, store-and-forward queues are bound to a direct exchange and subscription queues are bound to a topic exchange.

Parameters
queue:String
 
exchange:String
 
routingKey:String
 
noWait:Boolean
 
arguments:AmqpArguments (default = null)
 
callback:Function (default = null)

Returns
AmqpChannel
cancelBasic()method 
public function cancelBasic(consumerTag:String, noWait:Boolean, callback:Function = null):AmqpChannel

This method cancels a consumer. This does not affect already delivered messages, but it does mean the server will not send any more messages for that consumer. The client may receive an arbitrary number of messages in between sending the cancel method and receiving the cancel-ok reply.

Parameters
consumerTag:String
 
noWait:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
closeChannel()method 
public function closeChannel(replyCode:Number, replyText:String, classId:Number, methodId:Number, callback:Function = null):AmqpChannel

This method indicates that the sender wants to close the channel. This may be due to internal conditions (e.g. a forced shut-down) or due to an error handling a specific method, i.e. an exception. When a close is due to an exception, the sender provides the class and method id of the method which caused the exception.

Parameters
replyCode:Number
 
replyText:String
 
classId:Number
 
methodId:Number
 
callback:Function (default = null)

Returns
AmqpChannel
closeOkChannel()method 
public function closeOkChannel(callback:Function = null):AmqpChannel

Confirms to the peer that a flow command was received and processed.

Parameters
callback:Function (default = null)

Returns
AmqpChannel
commitTx()method 
public function commitTx(callback:Function = null):AmqpChannel

This method commits all message publications and acknowledgments performed in the current transaction. A new transaction starts immediately after a commit.

Parameters
callback:Function (default = null)

Returns
AmqpChannel
consumeBasic()method 
public function consumeBasic(queue:String, consumerTag:String, noLocal:Boolean, noAck:Boolean, exclusive:Boolean, noWait:Boolean, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel

This method asks the server to start a "consumer", which is a transient request for messages from a specific queue. Consumers last as long as the channel they were declared on, or until the client cancels them.

Parameters
queue:String
 
consumerTag:String
 
noLocal:Boolean
 
noAck:Boolean
 
exclusive:Boolean
 
noWait:Boolean
 
arguments:AmqpArguments (default = null)
 
callback:Function (default = null)

Returns
AmqpChannel
declareExchange()method 
public function declareExchange(exchange:String, type:String, passive:Boolean, durable:Boolean, noWait:Boolean, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel

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.

Parameters
exchange:String
 
type:String
 
passive:Boolean
 
durable:Boolean
 
noWait:Boolean
 
arguments:AmqpArguments (default = null)
 
callback:Function (default = null)

Returns
AmqpChannel
declareQueue()method 
public function declareQueue(queue:String, passive:Boolean, durable:Boolean, exclusive:Boolean, autoDelete:Boolean, noWait:Boolean, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel

This method creates or checks a queue. When creating a new queue the client can specify various properties that control the durability of the queue and its contents, and the level of sharing for the queue.

Parameters
queue:String
 
passive:Boolean
 
durable:Boolean
 
exclusive:Boolean
 
autoDelete:Boolean
 
noWait:Boolean
 
arguments:AmqpArguments (default = null)
 
callback:Function (default = null)

Returns
AmqpChannel
deleteExchange()method 
public function deleteExchange(exchange:String, ifUnused:Boolean, noWait:Boolean, callback:Function = null):AmqpChannel

This method deletes an exchange. When an exchange is deleted all queue bindings on the exchange are cancelled.

Parameters
exchange:String
 
ifUnused:Boolean
 
noWait:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
deleteQueue()method 
public function deleteQueue(queue:String, ifUnused:Boolean, ifEmpty:Boolean, noWait:Boolean, callback:Function = null):AmqpChannel

This method deletes a queue. When a queue is deleted any pending messages are sent to a dead-letter queue if this is defined in the server configuration, and all consumers on the queue are cancelled.

Parameters
queue:String
 
ifUnused:Boolean
 
ifEmpty:Boolean
 
noWait:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
flowChannel()method 
public function flowChannel(active:Boolean, callback:Function = null):AmqpChannel

This method asks the peer to pause or restart the flow of content data sent by a consumer. This is a simple flow-control mechanism that a peer can use to avoid overflowing its queues or otherwise finding itself receiving more messages than it can process. Note that this method is not intended for window control. It does not affect contents returned by Basic.Get-Ok methods.

Parameters
active:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
flowOkChannel()method 
public function flowOkChannel(active:Boolean, callback:Function = null):AmqpChannel

Confirms to the peer that a flow command was received and processed.

Parameters
active:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
getBasic()method 
public function getBasic(queue:String, noAck:Boolean, callback:Function = null):AmqpChannel

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.

Parameters
queue:String
 
noAck:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
openChannel()method 
public function openChannel(callback:Function = null):AmqpChannelParameters
callback:Function (default = null)

Returns
AmqpChannel
publishBasic()method 
public function publishBasic(body:ByteBuffer, amqpProperties:AmqpProperties, exchange:String, routingKey:String, mandatory:Boolean, immediate:Boolean, callback:Function = null):AmqpChannel

This method publishes a message to a specific exchange. The message will be routed to queues as defined by the exchange configuration and distributed to any active consumers when the transaction, if any, is committed.

Application developers can include properties defined in AMQP 0-9-1 spec as part of the published message. This can be done by using AmqpProperties object which defines type-safe methods for setting the properties. AmqpProperties not only allows specifying the pre-defined properties but also allows application developers to include custom headers using AmqpArguments.

Parameters
body:ByteBuffer — AMQP message payload
 
amqpProperties:AmqpProperties — AmqpProperties instance
 
exchange:String — name of the exchange
 
routingKey:String — Message routing key
 
mandatory:Boolean — indicate mandatory routing
 
immediate:Boolean — Request immitiate delivery
 
callback:Function (default = null) — Function to be called on success

Returns
AmqpChannel — AmqpChannel
purgeQueue()method 
public function purgeQueue(queue:String, noWait:Boolean, callback:Function = null):AmqpChannel

This method removes all messages from a queue which are not awaiting acknowledgment.

Parameters
queue:String
 
noWait:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
qosBasic()method 
public function qosBasic(prefetchSize:Number, prefetchCount:Number, global:Boolean, callback:Function = null):AmqpChannel

This method requests a specific quality of service. The QoS can be specified for the current channel or for all channels on the connection. The particular properties and semantics of a qos method always depend on the content class semantics. Though the qos method could in principle apply to both peers, it is currently meaningful only for the server.

Parameters
prefetchSize:Number
 
prefetchCount:Number
 
global:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
recoverBasic()method 
public function recoverBasic(requeue:Boolean, callback:Function = null):AmqpChannel

This method asks the server to redeliver all unacknowledged messages on a specified channel. Zero or more messages may be redelivered. This method replaces the asynchronous Recover.

Parameters
requeue:Boolean
 
callback:Function (default = null)

Returns
AmqpChannel
rejectBasic()method 
public function rejectBasic(deliveryTag:Number, requeue:Boolean):AmqpChannel

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.

Parameters
deliveryTag:Number
 
requeue:Boolean

Returns
AmqpChannel
rollbackTx()method 
public function rollbackTx(callback:Function = null):AmqpChannel

This method abandons all message publications and acknowledgments performed in the current transaction. A new transaction starts immediately after a rollback. Note that unacked messages will not be automatically redelivered by rollback; if that is required an explicit recover call should be issued.

Parameters
callback:Function (default = null)

Returns
AmqpChannel
selectTx()method 
public function selectTx(callback:Function = null):AmqpChannel

This method sets the channel to use standard transactions. The client must use this method at least once on a channel before using the Commit or Rollback methods.

Parameters
callback:Function (default = null)

Returns
AmqpChannel
unbindQueue()method 
public function unbindQueue(queue:String, exchange:String, routingKey:String, arguments:AmqpArguments = null, callback:Function = null):AmqpChannel

This method unbinds a queue from an exchange.

Parameters
queue:String
 
exchange:String
 
routingKey:String
 
arguments:AmqpArguments (default = null)
 
callback:Function (default = null)

Returns
AmqpChannel
Event detail
bindqueueevent 
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

cancelevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

closeevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

committransactionevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

consumeevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

declareexchangeevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

declarequeueevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

deleteexchangeevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

deletequeueevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

errorevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

flowevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

getevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

messageevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

openevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

purgequeueevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

queueDeletedevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

recoverevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

rejectevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

rollbacktransactionevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

selecttransactionevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent

unbindqueueevent  
Event object type: com.kaazing.gateway.amqp.client.AmqpEvent