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 function AmqpChannel(id:int, connection:Object, cb:Function = null)
Parameters
| id:int |
|
| connection:Object |
|
| cb:Function (default = null )
|
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public function openChannel(callback:Function = null):AmqpChannel
Parameters
| callback:Function (default = null )
|
Returns
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
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
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
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
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
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
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
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