public class

ChannelN

extends AMQChannel
implements Channel
java.lang.Object
   ↳ com.rabbitmq.client.impl.ShutdownNotifierComponent
     ↳ com.rabbitmq.client.impl.AMQChannel
       ↳ com.rabbitmq.client.impl.ChannelN

Class Overview

Main interface to AMQP protocol functionality. Public API - Implementation of all AMQChannels except channel zero.

To open a channel,

 Connection conn = ...;
 ChannelN ch1 = conn.createChannel();
 

Summary

[Expand]
Inherited Fields
From class com.rabbitmq.client.impl.AMQChannel
Public Constructors
ChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService)
Construct a new channel on the given connection with the given channel number.
Public Methods
void abort(int closeCode, String closeMessage)
Public API - Abort this channel.
void abort()
Public API - Abort this channel with the com.rabbitmq.client.AMQP close code and message 'OK'.
void addConfirmListener(ConfirmListener listener)
void addFlowListener(FlowListener listener)
void addReturnListener(ReturnListener listener)
void asyncRpc(Method method)
Asynchronously send a method over this channel.
void basicAck(long deliveryTag, boolean multiple)
Public API - Acknowledge one or several received messages.
void basicCancel(String consumerTag)
Public API - Cancel a consumer.
String basicConsume(String queue, boolean autoAck, String consumerTag, Consumer callback)
Public API - Start a non-nolocal, non-exclusive consumer.
String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<StringObject> arguments, Consumer callback)
Public API - Start a consumer.
String basicConsume(String queue, boolean autoAck, Consumer callback)
Public API - Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag.
String basicConsume(String queue, Consumer callback)
Public API - Start a non-nolocal, non-exclusive consumer, with explicit acknowledgement and a server-generated consumerTag.
GetResponse basicGet(String queue, boolean autoAck)
Public API - Retrieve a message from a queue using com.rabbitmq.client.AMQP.Basic.Get
void basicNack(long deliveryTag, boolean multiple, boolean requeue)
Public API - Reject one or several received messages.
void basicPublish(String exchange, String routingKey, boolean mandatory, boolean immediate, BasicProperties props, byte[] body)
Public API -
void basicPublish(String exchange, String routingKey, BasicProperties props, byte[] body)
Public API -
void basicQos(int prefetchCount)
Public API - Request a specific prefetchCount "quality of service" settings for this channel.
void basicQos(int prefetchSize, int prefetchCount, boolean global)
Public API - Request specific "quality of service" settings.
Basic.RecoverOk basicRecover()
Public API - Ask the broker to resend unacknowledged messages.
Basic.RecoverOk basicRecover(boolean requeue)
Public API - Ask the broker to resend unacknowledged messages.
void basicRecoverAsync(boolean requeue)
Public API - Ask the broker to resend unacknowledged messages.
void basicReject(long deliveryTag, boolean requeue)
Public API - Reject a message.
void clearConfirmListeners()
Remove all ConfirmListeners.
void clearFlowListeners()
Remove all FlowListeners.
void clearReturnListeners()
Remove all ReturnListeners.
void close(int closeCode, String closeMessage)
Public API - Close this channel.
void close()
Public API - Close this channel with the com.rabbitmq.client.AMQP close code and message 'OK'.
void close(int closeCode, String closeMessage, boolean initiatedByApplication, Throwable cause, boolean abort)
Protected API - Close channel with code and message, indicating the source of the closure and a causing exception (null if none).
Confirm.SelectOk confirmSelect()
Public API - Enables publisher acknowledgements on this channel.
Exchange.BindOk exchangeBind(String destination, String source, String routingKey)
Public API - Bind an exchange to an exchange, with no extra arguments.
Exchange.BindOk exchangeBind(String destination, String source, String routingKey, Map<StringObject> arguments)
Public API - Bind an exchange to an exchange.
Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable)
Public API - Actively declare a non-autodelete exchange with no extra arguments
Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable, boolean autoDelete, Map<StringObject> arguments)
Public API - Declare an exchange.
Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable, boolean autoDelete, boolean internal, Map<StringObject> arguments)
Public API - Declare an exchange, via an interface that allows the complete set of arguments.
Exchange.DeclareOk exchangeDeclare(String exchange, String type)
Public API - Actively declare a non-autodelete, non-durable exchange with no extra arguments
Exchange.DeclareOk exchangeDeclarePassive(String exchange)
Public API - Declare an exchange passively; that is, check if the named exchange exists.
Exchange.DeleteOk exchangeDelete(String exchange, boolean ifUnused)
Public API - Delete an exchange
Exchange.DeleteOk exchangeDelete(String exchange)
Public API - Delete an exchange, without regard for whether it is in use or not
Exchange.UnbindOk exchangeUnbind(String destination, String source, String routingKey)
Public API - Unbind an exchange from an exchange, with no extra arguments.
Exchange.UnbindOk exchangeUnbind(String destination, String source, String routingKey, Map<StringObject> arguments)
Public API - Unbind an exchange from an exchange.
Channel.FlowOk flow(boolean a)
Public API - Set flow on the channel
Consumer getDefaultConsumer()
Returns the current default consumer.
Channel.FlowOk getFlow()
Public API - Return the current Channel.Flow settings.
long getNextPublishSeqNo()
Public API - When in confirm mode, returns the sequence number of the next message to be published.
CountDownLatch getShutdownLatch()
void open()
Package method: open the channel.
boolean processAsync(Command command)
Protected API - Filters the inbound command stream, processing Basic.Deliver, Basic.Return and Channel.Close specially.
void processShutdownSignal(ShutdownSignalException signal, boolean ignoreClosed, boolean notifyRpc)
Protected API - overridden to quiesce consumer work and broadcast the signal to all consumers after calling the superclass's method.
Queue.BindOk queueBind(String queue, String exchange, String routingKey, Map<StringObject> arguments)
Public API - Bind a queue to an exchange.
Queue.BindOk queueBind(String queue, String exchange, String routingKey)
Public API - Bind a queue to an exchange, with no extra arguments.
Queue.DeclareOk queueDeclare(String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<StringObject> arguments)
Public API - Declare a queue
com.rabbitmq.client.AMQP.Queue.DeclareOk queueDeclare()
Public API - Actively declare a server-named exclusive, autodelete, non-durable queue.
Queue.DeclareOk queueDeclarePassive(String queue)
Public API - Declare a queue passively; i.e., check if it exists.
Queue.DeleteOk queueDelete(String queue)
Public API - Delete a queue, without regard for whether it is in use or has messages on it
Queue.DeleteOk queueDelete(String queue, boolean ifUnused, boolean ifEmpty)
Public API - Delete a queue
Queue.PurgeOk queuePurge(String queue)
Public API - Purges the contents of the given queue.
Queue.UnbindOk queueUnbind(String queue, String exchange, String routingKey, Map<StringObject> arguments)
Public API - Unbind a queue from an exchange.
Queue.UnbindOk queueUnbind(String queue, String exchange, String routingKey)
Public API - Unbinds a queue from an exchange, with no extra arguments.
boolean removeConfirmListener(ConfirmListener listener)
Remove a ConfirmListener.
boolean removeFlowListener(FlowListener listener)
Remove a FlowListener.
boolean removeReturnListener(ReturnListener listener)
Remove a ReturnListener.
AMQCommand rpc(Method method)
Protected API - sends a Method to the broker and waits for the next in-bound Command from the broker: only for use from non-connection-MainLoop threads!
void setDefaultConsumer(Consumer consumer)
Sets the current default consumer.
Tx.CommitOk txCommit()
Public API - Commits a TX transaction on this channel.
Tx.RollbackOk txRollback()
Public API - Rolls back a TX transaction on this channel.
Tx.SelectOk txSelect()
Public API - Enables TX mode on this channel.
boolean waitForConfirms()
Wait until all messages published since the last call have been either ack'd or nack'd by the broker.
void waitForConfirmsOrDie()
Wait until all messages published since the last call have been either ack'd or nack'd by the broker.
[Expand]
Inherited Methods
From class com.rabbitmq.client.impl.AMQChannel
From class com.rabbitmq.client.impl.ShutdownNotifierComponent
From class java.lang.Object
From interface com.rabbitmq.client.Channel
From interface com.rabbitmq.client.ShutdownNotifier

Public Constructors

public ChannelN (AMQConnection connection, int channelNumber, ConsumerWorkService workService)

Construct a new channel on the given connection with the given channel number. Usually not called directly - call Connection.createChannel instead.

Parameters
connection The connection associated with this channel
channelNumber The channel number to be associated with this channel
workService service for managing this channel's consumer callbacks
See Also

Public Methods

public void abort (int closeCode, String closeMessage)

Public API - Abort this channel. Forces the channel to close and waits for the close operation to complete. Any encountered exceptions in the close operation are silently discarded.

Throws
IOException

public void abort ()

Public API - Abort this channel with the com.rabbitmq.client.AMQP close code and message 'OK'. Forces the channel to close and waits for the close operation to complete. Any encountered exceptions in the close operation are silently discarded.

Throws
IOException

public void addConfirmListener (ConfirmListener listener)

Parameters
listener the listener to add

public void addFlowListener (FlowListener listener)

Parameters
listener the listener to add

public void addReturnListener (ReturnListener listener)

Parameters
listener the listener to add

public void asyncRpc (Method method)

Asynchronously send a method over this channel.

Parameters
method method to transmit over this channel.
Throws
IOException

public void basicAck (long deliveryTag, boolean multiple)

Public API - Acknowledge one or several received messages. Supply the deliveryTag from the com.rabbitmq.client.AMQP.Basic.GetOk or com.rabbitmq.client.AMQP.Basic.Deliver method containing the received message being acknowledged.

Parameters
deliveryTag the tag from the received com.rabbitmq.client.AMQP.Basic.GetOk or com.rabbitmq.client.AMQP.Basic.Deliver
multiple true to acknowledge all messages up to and including the supplied delivery tag; false to acknowledge just the supplied delivery tag.
Throws
IOException

public void basicCancel (String consumerTag)

Public API - Cancel a consumer. Calls the consumer's handleCancelOk(String) method.

Parameters
consumerTag a client- or server-generated consumer tag to establish context
Throws
IOException

public String basicConsume (String queue, boolean autoAck, String consumerTag, Consumer callback)

Public API - Start a non-nolocal, non-exclusive consumer.

Parameters
queue the name of the queue
autoAck true if the server should consider messages acknowledged once delivered; false if the server should expect explicit acknowledgements
consumerTag a client-generated consumer tag to establish context
callback an interface to the consumer object
Returns
  • the consumerTag associated with the new consumer
Throws
IOException

public String basicConsume (String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<StringObject> arguments, Consumer callback)

Public API - Start a consumer. Calls the consumer's handleConsumeOk(String) method.

Parameters
queue the name of the queue
autoAck true if the server should consider messages acknowledged once delivered; false if the server should expect explicit acknowledgements
consumerTag a client-generated consumer tag to establish context
noLocal flag set to true unless server local buffering is required
exclusive true if this is an exclusive consumer
arguments a set of arguments for the consume
callback an interface to the consumer object
Returns
  • the consumerTag associated with the new consumer
Throws
IOException

public String basicConsume (String queue, boolean autoAck, Consumer callback)

Public API - Start a non-nolocal, non-exclusive consumer, with a server-generated consumerTag.

Parameters
queue the name of the queue
autoAck true if the server should consider messages acknowledged once delivered; false if the server should expect explicit acknowledgements
callback an interface to the consumer object
Returns
  • the consumerTag generated by the server
Throws
IOException

public String basicConsume (String queue, Consumer callback)

Public API - Start a non-nolocal, non-exclusive consumer, with explicit acknowledgement and a server-generated consumerTag.

Parameters
queue the name of the queue
callback an interface to the consumer object
Returns
  • the consumerTag generated by the server
Throws
IOException

public GetResponse basicGet (String queue, boolean autoAck)

Public API - Retrieve a message from a queue using com.rabbitmq.client.AMQP.Basic.Get

Parameters
queue the name of the queue
autoAck true if the server should consider messages acknowledged once delivered; false if the server should expect explicit acknowledgements
Returns
Throws
IOException

public void basicNack (long deliveryTag, boolean multiple, boolean requeue)

Public API - Reject one or several received messages. Supply the deliveryTag from the com.rabbitmq.client.AMQP.Basic.GetOk or com.rabbitmq.client.AMQP.Basic.GetOk method containing the message to be rejected.

Parameters
deliveryTag the tag from the received com.rabbitmq.client.AMQP.Basic.GetOk or com.rabbitmq.client.AMQP.Basic.Deliver
multiple true to reject all messages up to and including the supplied delivery tag; false to reject just the supplied delivery tag.
requeue true if the rejected message(s) should be requeued rather than discarded/dead-lettered
Throws
IOException

public void basicPublish (String exchange, String routingKey, boolean mandatory, boolean immediate, BasicProperties props, byte[] body)

Public API -

Throws
IOException

public void basicPublish (String exchange, String routingKey, BasicProperties props, byte[] body)

Public API -

Throws
IOException

public void basicQos (int prefetchCount)

Public API - Request a specific prefetchCount "quality of service" settings for this channel.

Parameters
prefetchCount maximum number of messages that the server will deliver, 0 if unlimited
Throws
IOException

public void basicQos (int prefetchSize, int prefetchCount, boolean global)

Public API - Request specific "quality of service" settings. These settings impose limits on the amount of data the server will deliver to consumers before requiring acknowledgements. Thus they provide a means of consumer-initiated flow control.

Parameters
prefetchSize maximum amount of content (measured in octets) that the server will deliver, 0 if unlimited
prefetchCount maximum number of messages that the server will deliver, 0 if unlimited
global true if the settings should be applied to the entire connection rather than just the current channel
Throws
IOException

public Basic.RecoverOk basicRecover ()

Public API - Ask the broker to resend unacknowledged messages. In 0-8 basic.recover is asynchronous; in 0-9-1 it is synchronous, and the new, deprecated method basic.recover_async is asynchronous.

Equivalent to calling basicRecover(true), messages will be requeued and possibly delivered to a different consumer.

Throws
IOException

public Basic.RecoverOk basicRecover (boolean requeue)

Public API - Ask the broker to resend unacknowledged messages. In 0-8 basic.recover is asynchronous; in 0-9-1 it is synchronous, and the new, deprecated method basic.recover_async is asynchronous.

Parameters
requeue If true, messages will be requeued and possibly delivered to a different consumer. If false, messages will be redelivered to the same consumer.
Throws
IOException

public void basicRecoverAsync (boolean requeue)

Public API - Ask the broker to resend unacknowledged messages. In 0-8 basic.recover is asynchronous; in 0-9-1 it is synchronous, and the new, deprecated method basic.recover_async is asynchronous and deprecated.

Parameters
requeue If true, messages will be requeued and possibly delivered to a different consumer. If false, messages will be redelivered to the same consumer.
Throws
IOException

public void basicReject (long deliveryTag, boolean requeue)

Public API - Reject a message. Supply the deliveryTag from the com.rabbitmq.client.AMQP.Basic.GetOk or com.rabbitmq.client.AMQP.Basic.Deliver method containing the received message being rejected.

Parameters
deliveryTag the tag from the received com.rabbitmq.client.AMQP.Basic.GetOk or com.rabbitmq.client.AMQP.Basic.Deliver
requeue true if the rejected message should be requeued rather than discarded/dead-lettered
Throws
IOException

public void clearConfirmListeners ()

Remove all ConfirmListeners.

public void clearFlowListeners ()

Remove all FlowListeners.

public void clearReturnListeners ()

Remove all ReturnListeners.

public void close (int closeCode, String closeMessage)

Public API - Close this channel.

Parameters
closeCode the close code (See under "Reply Codes" in the AMQP specification)
closeMessage a message indicating the reason for closing the connection
Throws
IOException

public void close ()

Public API - Close this channel with the com.rabbitmq.client.AMQP close code and message 'OK'.

Throws
IOException

public void close (int closeCode, String closeMessage, boolean initiatedByApplication, Throwable cause, boolean abort)

Protected API - Close channel with code and message, indicating the source of the closure and a causing exception (null if none).

Throws
IOException

public Confirm.SelectOk confirmSelect ()

Public API - Enables publisher acknowledgements on this channel.

Throws
IOException

public Exchange.BindOk exchangeBind (String destination, String source, String routingKey)

Public API - Bind an exchange to an exchange, with no extra arguments.

Returns
  • a binding-confirm method if the binding was successfully created
Throws
IOException

public Exchange.BindOk exchangeBind (String destination, String source, String routingKey, Map<StringObject> arguments)

Public API - Bind an exchange to an exchange.

Returns
  • a binding-confirm method if the binding was successfully created
Throws
IOException

public Exchange.DeclareOk exchangeDeclare (String exchange, String type, boolean durable)

Public API - Actively declare a non-autodelete exchange with no extra arguments

Parameters
exchange the name of the exchange
type the exchange type
durable true if we are declaring a durable exchange (the exchange will survive a server restart)
Returns
  • a declaration-confirm method to indicate the exchange was successfully declared
Throws
IOException

public Exchange.DeclareOk exchangeDeclare (String exchange, String type, boolean durable, boolean autoDelete, Map<StringObject> arguments)

Public API - Declare an exchange.

Parameters
exchange the name of the exchange
type the exchange type
durable true if we are declaring a durable exchange (the exchange will survive a server restart)
autoDelete true if the server should delete the exchange when it is no longer in use
arguments other properties (construction arguments) for the exchange
Returns
  • a declaration-confirm method to indicate the exchange was successfully declared
Throws
IOException

public Exchange.DeclareOk exchangeDeclare (String exchange, String type, boolean durable, boolean autoDelete, boolean internal, Map<StringObject> arguments)

Public API - Declare an exchange, via an interface that allows the complete set of arguments.

Parameters
exchange the name of the exchange
type the exchange type
durable true if we are declaring a durable exchange (the exchange will survive a server restart)
autoDelete true if the server should delete the exchange when it is no longer in use
internal true if the exchange is internal, i.e. can't be directly published to by a client.
arguments other properties (construction arguments) for the exchange
Returns
  • a declaration-confirm method to indicate the exchange was successfully declared
Throws
IOException

public Exchange.DeclareOk exchangeDeclare (String exchange, String type)

Public API - Actively declare a non-autodelete, non-durable exchange with no extra arguments

Parameters
exchange the name of the exchange
type the exchange type
Returns
  • a declaration-confirm method to indicate the exchange was successfully declared
Throws
IOException

public Exchange.DeclareOk exchangeDeclarePassive (String exchange)

Public API - Declare an exchange passively; that is, check if the named exchange exists.

Parameters
exchange check the existence of an exchange named this
Throws
IOException

public Exchange.DeleteOk exchangeDelete (String exchange, boolean ifUnused)

Public API - Delete an exchange

Parameters
exchange the name of the exchange
ifUnused true to indicate that the exchange is only to be deleted if it is unused
Returns
  • a deletion-confirm method to indicate the exchange was successfully deleted
Throws
IOException

public Exchange.DeleteOk exchangeDelete (String exchange)

Public API - Delete an exchange, without regard for whether it is in use or not

Parameters
exchange the name of the exchange
Returns
  • a deletion-confirm method to indicate the exchange was successfully deleted
Throws
IOException

public Exchange.UnbindOk exchangeUnbind (String destination, String source, String routingKey)

Public API - Unbind an exchange from an exchange, with no extra arguments.

Returns
  • a binding-confirm method if the binding was successfully created
Throws
IOException

public Exchange.UnbindOk exchangeUnbind (String destination, String source, String routingKey, Map<StringObject> arguments)

Public API - Unbind an exchange from an exchange.

Returns
  • a binding-confirm method if the binding was successfully created
Throws
IOException

public Channel.FlowOk flow (boolean a)

Public API - Set flow on the channel

Parameters
a if true, the server is asked to start sending. If false, the server is asked to stop sending.
Throws
IOException

public Consumer getDefaultConsumer ()

Returns the current default consumer.

Returns
  • an interface to the current default consumer.

public Channel.FlowOk getFlow ()

Public API - Return the current Channel.Flow settings.

public long getNextPublishSeqNo ()

Public API - When in confirm mode, returns the sequence number of the next message to be published.

Returns
  • the sequence number of the next message to be published

public CountDownLatch getShutdownLatch ()

public void open ()

Package method: open the channel. This is only called from ChannelManager.

Throws
IOException if any problem is encountered

public boolean processAsync (Command command)

Protected API - Filters the inbound command stream, processing Basic.Deliver, Basic.Return and Channel.Close specially. If we're in quiescing mode, all inbound commands are ignored, except for Channel.Close and Channel.CloseOk.

Parameters
command the command to handle asynchronously
Returns
  • true if we handled the command; otherwise the caller should consider it "unhandled"
Throws
IOException

public void processShutdownSignal (ShutdownSignalException signal, boolean ignoreClosed, boolean notifyRpc)

Protected API - overridden to quiesce consumer work and broadcast the signal to all consumers after calling the superclass's method.

Parameters
signal the signal to handle
ignoreClosed the flag indicating whether to ignore the AlreadyClosedException thrown when the channel is already closed
notifyRpc the flag indicating whether any remaining rpc continuation should be notified with the given signal

public Queue.BindOk queueBind (String queue, String exchange, String routingKey, Map<StringObject> arguments)

Public API - Bind a queue to an exchange.

Parameters
queue the name of the queue
exchange the name of the exchange
routingKey the routine key to use for the binding
arguments other properties (binding parameters)
Returns
  • a binding-confirm method if the binding was successfully created
Throws
IOException

public Queue.BindOk queueBind (String queue, String exchange, String routingKey)

Public API - Bind a queue to an exchange, with no extra arguments.

Parameters
queue the name of the queue
exchange the name of the exchange
routingKey the routine key to use for the binding
Returns
  • a binding-confirm method if the binding was successfully created
Throws
IOException

public Queue.DeclareOk queueDeclare (String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<StringObject> arguments)

Public API - Declare a queue

Parameters
queue the name of the queue
durable true if we are declaring a durable queue (the queue will survive a server restart)
exclusive true if we are declaring an exclusive queue (restricted to this connection)
autoDelete true if we are declaring an autodelete queue (server will delete it when no longer in use)
arguments other properties (construction arguments) for the queue
Returns
  • a declaration-confirm method to indicate the queue was successfully declared
Throws
IOException

public com.rabbitmq.client.AMQP.Queue.DeclareOk queueDeclare ()

Public API - Actively declare a server-named exclusive, autodelete, non-durable queue. The name of the new queue is held in the "queue" field of the com.rabbitmq.client.AMQP.Queue.DeclareOk result.

Returns
  • a declaration-confirm method to indicate the queue was successfully declared
Throws
IOException

public Queue.DeclareOk queueDeclarePassive (String queue)

Public API - Declare a queue passively; i.e., check if it exists. In AMQP 0-9-1, all arguments aside from nowait are ignored; and sending nowait makes this method a no-op, so we default it to false.

Parameters
queue the name of the queue
Returns
  • a declaration-confirm method to indicate the queue exists
Throws
IOException

public Queue.DeleteOk queueDelete (String queue)

Public API - Delete a queue, without regard for whether it is in use or has messages on it

Parameters
queue the name of the queue
Returns
  • a deletion-confirm method to indicate the queue was successfully deleted
Throws
IOException

public Queue.DeleteOk queueDelete (String queue, boolean ifUnused, boolean ifEmpty)

Public API - Delete a queue

Parameters
queue the name of the queue
ifUnused true if the queue should be deleted only if not in use
ifEmpty true if the queue should be deleted only if empty
Returns
  • a deletion-confirm method to indicate the queue was successfully deleted
Throws
IOException

public Queue.PurgeOk queuePurge (String queue)

Public API - Purges the contents of the given queue.

Parameters
queue the name of the queue
Returns
  • a purge-confirm method if the purge was executed succesfully
Throws
IOException

public Queue.UnbindOk queueUnbind (String queue, String exchange, String routingKey, Map<StringObject> arguments)

Public API - Unbind a queue from an exchange.

Parameters
queue the name of the queue
exchange the name of the exchange
routingKey the routine key to use for the binding
arguments other properties (binding parameters)
Returns
  • an unbinding-confirm method if the binding was successfully deleted
Throws
IOException

public Queue.UnbindOk queueUnbind (String queue, String exchange, String routingKey)

Public API - Unbinds a queue from an exchange, with no extra arguments.

Parameters
queue the name of the queue
exchange the name of the exchange
routingKey the routine key to use for the binding
Returns
  • an unbinding-confirm method if the binding was successfully deleted
Throws
IOException

public boolean removeConfirmListener (ConfirmListener listener)

Remove a ConfirmListener.

Parameters
listener the listener to remove
Returns
  • true if the listener was found and removed, false otherwise

public boolean removeFlowListener (FlowListener listener)

Remove a FlowListener.

Parameters
listener the listener to remove
Returns
  • true if the listener was found and removed, false otherwise

public boolean removeReturnListener (ReturnListener listener)

Remove a ReturnListener.

Parameters
listener the listener to remove
Returns
  • true if the listener was found and removed, false otherwise

public AMQCommand rpc (Method method)

Protected API - sends a Method to the broker and waits for the next in-bound Command from the broker: only for use from non-connection-MainLoop threads!

Throws
IOException

public void setDefaultConsumer (Consumer consumer)

Sets the current default consumer. A null argument is interpreted to mean "do not use a default consumer".

Parameters
consumer the consumer to use, or null indicating "don't use one".

public Tx.CommitOk txCommit ()

Public API - Commits a TX transaction on this channel.

Returns
  • a transaction-commit method to indicate the transaction was successfully committed
Throws
IOException

public Tx.RollbackOk txRollback ()

Public API - Rolls back a TX transaction on this channel.

Returns
  • a transaction-rollback method to indicate the transaction was successfully rolled back
Throws
IOException

public Tx.SelectOk txSelect ()

Public API - Enables TX mode on this channel.

Returns
  • a transaction-selection method to indicate the transaction was successfully initiated
Throws
IOException

public boolean waitForConfirms ()

Wait until all messages published since the last call have been either ack'd or nack'd by the broker. Note, when called on a non-Confirm channel, waitForConfirms returns true immediately.

Returns
  • whether all the messages were ack'd (and none were nack'd)

public void waitForConfirmsOrDie ()

Wait until all messages published since the last call have been either ack'd or nack'd by the broker. If any of the messages were nack'd, waitForConfirmsOrDie will throw an IOException. When called on a non-Confirm channel, it will return immediately.