com.rabbitmq.client.impl.recovery
public class AutorecoveringChannel extends java.lang.Object implements Channel, Recoverable
Channel implementation that is automatically
recovered during connection recovery.| Constructor and Description |
|---|
AutorecoveringChannel(AutorecoveringConnection connection,
RecoveryAwareChannelN delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Abort this channel with the
AMQP.REPLY_SUCCESS close code
and message 'OK'. |
void |
abort(int closeCode,
java.lang.String closeMessage)
Abort this channel.
|
void |
addConfirmListener(ConfirmListener listener)
Add a
ConfirmListener. |
void |
addFlowListener(FlowListener listener)
Deprecated.
|
void |
addRecoveryListener(RecoveryListener listener)
Registers a connection recovery callback.
|
void |
addReturnListener(ReturnListener listener)
Add a
ReturnListener. |
void |
addShutdownListener(ShutdownListener listener)
Add shutdown listener.
|
void |
asyncRpc(Method method)
Asynchronously send a method over this channel.
|
void |
automaticallyRecover(AutorecoveringConnection connection,
Connection connDelegate) |
void |
basicAck(long deliveryTag,
boolean multiple)
Acknowledge one or several received
messages.
|
void |
basicCancel(java.lang.String consumerTag)
Cancel a consumer.
|
java.lang.String |
basicConsume(java.lang.String queue,
boolean autoAck,
Consumer callback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag.
|
java.lang.String |
basicConsume(java.lang.String queue,
boolean autoAck,
java.util.Map<java.lang.String,java.lang.Object> arguments,
Consumer callback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag and specified arguments.
|
java.lang.String |
basicConsume(java.lang.String queue,
boolean autoAck,
java.lang.String consumerTag,
boolean noLocal,
boolean exclusive,
java.util.Map<java.lang.String,java.lang.Object> arguments,
Consumer callback)
Start a consumer.
|
java.lang.String |
basicConsume(java.lang.String queue,
boolean autoAck,
java.lang.String consumerTag,
Consumer callback)
Start a non-nolocal, non-exclusive consumer.
|
java.lang.String |
basicConsume(java.lang.String queue,
Consumer callback)
Start a non-nolocal, non-exclusive consumer, with
explicit acknowledgement and a server-generated consumerTag.
|
GetResponse |
basicGet(java.lang.String queue,
boolean autoAck)
Retrieve a message from a queue using
AMQP.Basic.Get |
void |
basicNack(long deliveryTag,
boolean multiple,
boolean requeue)
Reject one or several received messages.
|
void |
basicPublish(java.lang.String exchange,
java.lang.String routingKey,
AMQP.BasicProperties props,
byte[] body)
Publish a message.
|
void |
basicPublish(java.lang.String exchange,
java.lang.String routingKey,
boolean mandatory,
AMQP.BasicProperties props,
byte[] body)
Publish a message.
|
void |
basicPublish(java.lang.String exchange,
java.lang.String routingKey,
boolean mandatory,
boolean immediate,
AMQP.BasicProperties props,
byte[] body)
Publish a message.
|
void |
basicQos(int prefetchCount)
Request a specific prefetchCount "quality of service" settings
for this channel.
|
void |
basicQos(int prefetchCount,
boolean global)
Request a specific prefetchCount "quality of service" settings
for this channel.
|
void |
basicQos(int prefetchSize,
int prefetchCount,
boolean global)
Request specific "quality of service" settings.
|
AMQP.Basic.RecoverOk |
basicRecover()
Ask the broker to resend unacknowledged messages.
|
AMQP.Basic.RecoverOk |
basicRecover(boolean requeue)
Ask the broker to resend unacknowledged messages.
|
void |
basicReject(long deliveryTag,
boolean requeue)
Reject a message.
|
void |
clearConfirmListeners()
Remove all
ConfirmListeners. |
void |
clearFlowListeners()
Deprecated.
|
void |
clearReturnListeners()
Remove all
ReturnListeners. |
void |
close()
Close this channel with the
AMQP.REPLY_SUCCESS close code
and message 'OK'. |
void |
close(int closeCode,
java.lang.String closeMessage)
Close this channel.
|
AMQP.Confirm.SelectOk |
confirmSelect()
Enables publisher acknowledgements on this channel.
|
long |
consumerCount(java.lang.String queue)
Returns the number of consumers on a queue.
|
AMQP.Exchange.BindOk |
exchangeBind(java.lang.String destination,
java.lang.String source,
java.lang.String routingKey)
Bind an exchange to an exchange, with no extra arguments.
|
AMQP.Exchange.BindOk |
exchangeBind(java.lang.String destination,
java.lang.String source,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Bind an exchange to an exchange.
|
void |
exchangeBindNoWait(java.lang.String destination,
java.lang.String source,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Like
Channel.exchangeBind(String, String, String, java.util.Map) but sets nowait parameter
to true and returns void (as there will be no response from the server). |
AMQP.Exchange.DeclareOk |
exchangeDeclare(java.lang.String exchange,
java.lang.String type)
Actively declare a non-autodelete, non-durable exchange with no extra arguments
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(java.lang.String exchange,
java.lang.String type,
boolean durable)
Actively declare a non-autodelete exchange with no extra arguments
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(java.lang.String exchange,
java.lang.String type,
boolean durable,
boolean autoDelete,
boolean internal,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Declare an exchange, via an interface that allows the complete set of
arguments.
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(java.lang.String exchange,
java.lang.String type,
boolean durable,
boolean autoDelete,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Declare an exchange.
|
void |
exchangeDeclareNoWait(java.lang.String exchange,
java.lang.String type,
boolean durable,
boolean autoDelete,
boolean internal,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Like
Channel.exchangeDeclare(String, String, boolean, boolean, java.util.Map) but
sets nowait parameter to true and returns nothing (as there will be no response from
the server). |
AMQP.Exchange.DeclareOk |
exchangeDeclarePassive(java.lang.String name)
Declare an exchange passively; that is, check if the named exchange exists.
|
AMQP.Exchange.DeleteOk |
exchangeDelete(java.lang.String exchange)
Delete an exchange, without regard for whether it is in use or not
|
AMQP.Exchange.DeleteOk |
exchangeDelete(java.lang.String exchange,
boolean ifUnused)
Delete an exchange
|
void |
exchangeDeleteNoWait(java.lang.String exchange,
boolean ifUnused)
Like
Channel.exchangeDelete(String, boolean) but sets nowait parameter to true
and returns void (as there will be no response from the server). |
AMQP.Exchange.UnbindOk |
exchangeUnbind(java.lang.String destination,
java.lang.String source,
java.lang.String routingKey)
Unbind an exchange from an exchange, with no extra arguments.
|
AMQP.Exchange.UnbindOk |
exchangeUnbind(java.lang.String destination,
java.lang.String source,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Unbind an exchange from an exchange.
|
void |
exchangeUnbindNoWait(java.lang.String destination,
java.lang.String source,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Same as
Channel.exchangeUnbind(String, String, String, java.util.Map) but sets no-wait parameter to true
and returns nothing (as there will be no response from the server). |
boolean |
flowBlocked()
Deprecated.
|
int |
getChannelNumber()
Retrieve this channel's channel number.
|
ShutdownSignalException |
getCloseReason()
Get the shutdown reason object
|
Connection |
getConnection()
Retrieve the connection which carries this channel.
|
Consumer |
getDefaultConsumer()
Get the current default consumer.
|
Channel |
getDelegate() |
long |
getNextPublishSeqNo()
When in confirm mode, returns the sequence number of the next
message to be published.
|
boolean |
isOpen()
Determine whether the component is currently open.
|
long |
messageCount(java.lang.String queue)
Returns the number of messages in a queue ready to be delivered
to consumers.
|
void |
notifyListeners()
Protected API - notify the listeners attached to the component
|
AMQP.Queue.BindOk |
queueBind(java.lang.String queue,
java.lang.String exchange,
java.lang.String routingKey)
Bind a queue to an exchange, with no extra arguments.
|
AMQP.Queue.BindOk |
queueBind(java.lang.String queue,
java.lang.String exchange,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Bind a queue to an exchange.
|
void |
queueBindNoWait(java.lang.String queue,
java.lang.String exchange,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Same as
Channel.queueDeclare(String, boolean, boolean, boolean, java.util.Map) but sets nowait
parameter to true and returns void (as there will be no response
from the server). |
AMQP.Queue.DeclareOk |
queueDeclare()
Actively declare a server-named exclusive, autodelete, non-durable queue.
|
AMQP.Queue.DeclareOk |
queueDeclare(java.lang.String queue,
boolean durable,
boolean exclusive,
boolean autoDelete,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Declare a queue
|
void |
queueDeclareNoWait(java.lang.String queue,
boolean durable,
boolean exclusive,
boolean autoDelete,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Like
Channel.queueDeclare(String, boolean, boolean, boolean, java.util.Map) but sets nowait
flag to true and returns no result (as there will be no response from the server). |
AMQP.Queue.DeclareOk |
queueDeclarePassive(java.lang.String queue)
Declare a queue passively; i.e., check if it exists.
|
AMQP.Queue.DeleteOk |
queueDelete(java.lang.String queue)
Delete a queue, without regard for whether it is in use or has messages on it
|
AMQP.Queue.DeleteOk |
queueDelete(java.lang.String queue,
boolean ifUnused,
boolean ifEmpty)
Delete a queue
|
void |
queueDeleteNoWait(java.lang.String queue,
boolean ifUnused,
boolean ifEmpty)
Like
Channel.queueDelete(String, boolean, boolean) but sets nowait parameter
to true and returns nothing (as there will be no response from the server). |
AMQP.Queue.PurgeOk |
queuePurge(java.lang.String queue)
Purges the contents of the given queue.
|
AMQP.Queue.UnbindOk |
queueUnbind(java.lang.String queue,
java.lang.String exchange,
java.lang.String routingKey)
Unbinds a queue from an exchange, with no extra arguments.
|
AMQP.Queue.UnbindOk |
queueUnbind(java.lang.String queue,
java.lang.String exchange,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
Unbind a queue from an exchange.
|
boolean |
removeConfirmListener(ConfirmListener listener)
Remove a
ConfirmListener. |
boolean |
removeFlowListener(FlowListener listener)
Deprecated.
|
void |
removeRecoveryListener(RecoveryListener listener) |
boolean |
removeReturnListener(ReturnListener listener)
Remove a
ReturnListener. |
void |
removeShutdownListener(ShutdownListener listener)
Remove shutdown listener for the component.
|
Command |
rpc(Method method)
Synchronously send a method over this channel.
|
void |
setDefaultConsumer(Consumer consumer)
Set the current default consumer.
|
AMQP.Tx.CommitOk |
txCommit()
Commits a TX transaction on this channel.
|
AMQP.Tx.RollbackOk |
txRollback()
Rolls back a TX transaction on this channel.
|
AMQP.Tx.SelectOk |
txSelect()
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.
|
boolean |
waitForConfirms(long timeout)
Wait until all messages published since the last call have been
either ack'd or nack'd by the broker; or until timeout elapses.
|
void |
waitForConfirmsOrDie()
Wait until all messages published since the last call have
been either ack'd or nack'd by the broker.
|
void |
waitForConfirmsOrDie(long timeout)
Wait until all messages published since the last call have
been either ack'd or nack'd by the broker; or until timeout elapses.
|
public AutorecoveringChannel(AutorecoveringConnection connection, RecoveryAwareChannelN delegate)
public int getChannelNumber()
ChannelgetChannelNumber in interface Channelpublic Connection getConnection()
ChannelgetConnection in interface ChannelConnectionpublic Channel getDelegate()
public void close()
throws java.io.IOException,
java.util.concurrent.TimeoutException
ChannelAMQP.REPLY_SUCCESS close code
and message 'OK'.public void close(int closeCode,
java.lang.String closeMessage)
throws java.io.IOException,
java.util.concurrent.TimeoutException
Channel@Deprecated public boolean flowBlocked()
ChannelflowBlocked in interface Channelpublic void abort()
throws java.io.IOException
ChannelAMQP.REPLY_SUCCESS 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.public void abort(int closeCode,
java.lang.String closeMessage)
throws java.io.IOException
Channelpublic void addReturnListener(ReturnListener listener)
ChannelReturnListener.addReturnListener in interface Channellistener - the listener to addpublic boolean removeReturnListener(ReturnListener listener)
ChannelReturnListener.removeReturnListener in interface Channellistener - the listener to removetrue if the listener was found and removed,
false otherwisepublic void clearReturnListeners()
ChannelReturnListeners.clearReturnListeners in interface Channel@Deprecated public void addFlowListener(FlowListener listener)
ChannelFlowListener.
Deprecated, superseded by TCP back pressure.addFlowListener in interface Channellistener - the listener to add@Deprecated public boolean removeFlowListener(FlowListener listener)
ChannelFlowListener.
Deprecated, superseded by TCP back pressure.removeFlowListener in interface Channellistener - the listener to removetrue if the listener was found and removed,
false otherwise@Deprecated public void clearFlowListeners()
ChannelFlowListeners.
Deprecated, superseded by TCP back pressure.clearFlowListeners in interface Channelpublic void addConfirmListener(ConfirmListener listener)
ChannelConfirmListener.addConfirmListener in interface Channellistener - the listener to addpublic boolean removeConfirmListener(ConfirmListener listener)
ChannelConfirmListener.removeConfirmListener in interface Channellistener - the listener to removetrue if the listener was found and removed,
false otherwisepublic void clearConfirmListeners()
ChannelConfirmListeners.clearConfirmListeners in interface Channelpublic Consumer getDefaultConsumer()
ChannelgetDefaultConsumer in interface Channelpublic void setDefaultConsumer(Consumer consumer)
ChannelsetDefaultConsumer in interface Channelconsumer - the consumer to use, or null indicating "don't use one".public void basicQos(int prefetchSize,
int prefetchCount,
boolean global)
throws java.io.IOException
ChannelbasicQos in interface ChannelprefetchSize - maximum amount of content (measured in
octets) that the server will deliver, 0 if unlimitedprefetchCount - maximum number of messages that the server
will deliver, 0 if unlimitedglobal - true if the settings should be applied to the
entire channel rather than each consumerjava.io.IOException - if an error is encounteredAMQP.Basic.Qospublic void basicQos(int prefetchCount)
throws java.io.IOException
ChannelbasicQos in interface ChannelprefetchCount - maximum number of messages that the server
will deliver, 0 if unlimitedjava.io.IOException - if an error is encounteredChannel.basicQos(int, int, boolean)public void basicQos(int prefetchCount,
boolean global)
throws java.io.IOException
ChannelbasicQos in interface ChannelprefetchCount - maximum number of messages that the server
will deliver, 0 if unlimitedglobal - true if the settings should be applied to the
entire channel rather than each consumerjava.io.IOException - if an error is encounteredChannel.basicQos(int, int, boolean)public void basicPublish(java.lang.String exchange,
java.lang.String routingKey,
AMQP.BasicProperties props,
byte[] body)
throws java.io.IOException
ChannelChannel#basicPublish will eventually block if a
resource-driven alarm is in effect.basicPublish in interface Channelexchange - the exchange to publish the message toroutingKey - the routing keyprops - other properties for the message - routing headers etcbody - the message bodyjava.io.IOException - if an error is encounteredAMQP.Basic.Publish,
Resource-driven alarmspublic void basicPublish(java.lang.String exchange,
java.lang.String routingKey,
boolean mandatory,
AMQP.BasicProperties props,
byte[] body)
throws java.io.IOException
ChannelChannel#basicPublish will eventually block if a
resource-driven alarm is in effect.basicPublish in interface Channelexchange - the exchange to publish the message toroutingKey - the routing keymandatory - true if the 'mandatory' flag is to be setprops - other properties for the message - routing headers etcbody - the message bodyjava.io.IOException - if an error is encounteredAMQP.Basic.Publish,
Resource-driven alarmspublic void basicPublish(java.lang.String exchange,
java.lang.String routingKey,
boolean mandatory,
boolean immediate,
AMQP.BasicProperties props,
byte[] body)
throws java.io.IOException
ChannelChannel#basicPublish will eventually block if a
resource-driven alarm is in effect.basicPublish in interface Channelexchange - the exchange to publish the message toroutingKey - the routing keymandatory - true if the 'mandatory' flag is to be setimmediate - true if the 'immediate' flag is to be
set. Note that the RabbitMQ server does not support this flag.props - other properties for the message - routing headers etcbody - the message bodyjava.io.IOException - if an error is encounteredAMQP.Basic.Publish,
Resource-driven alarmspublic AMQP.Exchange.DeclareOk exchangeDeclare(java.lang.String exchange, java.lang.String type) throws java.io.IOException
ChannelexchangeDeclare in interface Channelexchange - the name of the exchangetype - the exchange typejava.io.IOException - if an error is encounteredAMQP.Exchange.Declare,
AMQP.Exchange.DeclareOkpublic AMQP.Exchange.DeclareOk exchangeDeclare(java.lang.String exchange, java.lang.String type, boolean durable) throws java.io.IOException
ChannelexchangeDeclare in interface Channelexchange - the name of the exchangetype - the exchange typedurable - true if we are declaring a durable exchange (the exchange will survive a server restart)java.io.IOException - if an error is encounteredAMQP.Exchange.Declare,
AMQP.Exchange.DeclareOkpublic AMQP.Exchange.DeclareOk exchangeDeclare(java.lang.String exchange, java.lang.String type, boolean durable, boolean autoDelete, java.util.Map<java.lang.String,java.lang.Object> arguments) throws java.io.IOException
ChannelexchangeDeclare in interface Channelexchange - the name of the exchangetype - the exchange typedurable - 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 usearguments - other properties (construction arguments) for the exchangejava.io.IOException - if an error is encounteredAMQP.Exchange.Declare,
AMQP.Exchange.DeclareOkpublic AMQP.Exchange.DeclareOk exchangeDeclare(java.lang.String exchange, java.lang.String type, boolean durable, boolean autoDelete, boolean internal, java.util.Map<java.lang.String,java.lang.Object> arguments) throws java.io.IOException
ChannelexchangeDeclare in interface Channelexchange - the name of the exchangetype - the exchange typedurable - 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 useinternal - true if the exchange is internal, i.e. can't be directly
published to by a client.arguments - other properties (construction arguments) for the exchangejava.io.IOException - if an error is encounteredAMQP.Exchange.Declare,
AMQP.Exchange.DeclareOkpublic void exchangeDeclareNoWait(java.lang.String exchange,
java.lang.String type,
boolean durable,
boolean autoDelete,
boolean internal,
java.util.Map<java.lang.String,java.lang.Object> arguments)
throws java.io.IOException
ChannelChannel.exchangeDeclare(String, String, boolean, boolean, java.util.Map) but
sets nowait parameter to true and returns nothing (as there will be no response from
the server).exchangeDeclareNoWait in interface Channelexchange - the name of the exchangetype - the exchange typedurable - 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 useinternal - true if the exchange is internal, i.e. can't be directly
published to by a client.arguments - other properties (construction arguments) for the exchangejava.io.IOException - if an error is encounteredpublic AMQP.Exchange.DeclareOk exchangeDeclarePassive(java.lang.String name) throws java.io.IOException
ChannelexchangeDeclarePassive in interface Channelname - check the existence of an exchange named thisjava.io.IOException - the server will raise a 404 channel exception if the named exchange does not exist.public AMQP.Exchange.DeleteOk exchangeDelete(java.lang.String exchange, boolean ifUnused) throws java.io.IOException
ChannelexchangeDelete in interface Channelexchange - the name of the exchangeifUnused - true to indicate that the exchange is only to be deleted if it is unusedjava.io.IOException - if an error is encounteredAMQP.Exchange.Delete,
AMQP.Exchange.DeleteOkpublic void exchangeDeleteNoWait(java.lang.String exchange,
boolean ifUnused)
throws java.io.IOException
ChannelChannel.exchangeDelete(String, boolean) but sets nowait parameter to true
and returns void (as there will be no response from the server).exchangeDeleteNoWait in interface Channelexchange - the name of the exchangeifUnused - true to indicate that the exchange is only to be deleted if it is unusedjava.io.IOException - if an error is encounteredAMQP.Exchange.Delete,
AMQP.Exchange.DeleteOkpublic AMQP.Exchange.DeleteOk exchangeDelete(java.lang.String exchange) throws java.io.IOException
ChannelexchangeDelete in interface Channelexchange - the name of the exchangejava.io.IOException - if an error is encounteredAMQP.Exchange.Delete,
AMQP.Exchange.DeleteOkpublic AMQP.Exchange.BindOk exchangeBind(java.lang.String destination, java.lang.String source, java.lang.String routingKey) throws java.io.IOException
ChannelexchangeBind in interface Channeldestination - the name of the exchange to which messages flow across the bindingsource - the name of the exchange from which messages flow across the bindingroutingKey - the routine key to use for the bindingjava.io.IOException - if an error is encounteredAMQP.Exchange.Bind,
AMQP.Exchange.BindOkpublic AMQP.Exchange.BindOk exchangeBind(java.lang.String destination, java.lang.String source, java.lang.String routingKey, java.util.Map<java.lang.String,java.lang.Object> arguments) throws java.io.IOException
ChannelexchangeBind in interface Channeldestination - the name of the exchange to which messages flow across the bindingsource - the name of the exchange from which messages flow across the bindingroutingKey - the routine key to use for the bindingarguments - other properties (binding parameters)java.io.IOException - if an error is encounteredAMQP.Exchange.Bind,
AMQP.Exchange.BindOkpublic void exchangeBindNoWait(java.lang.String destination,
java.lang.String source,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
throws java.io.IOException
ChannelChannel.exchangeBind(String, String, String, java.util.Map) but sets nowait parameter
to true and returns void (as there will be no response from the server).exchangeBindNoWait in interface Channeldestination - the name of the exchange to which messages flow across the bindingsource - the name of the exchange from which messages flow across the bindingroutingKey - the routine key to use for the bindingarguments - other properties (binding parameters)java.io.IOException - if an error is encounteredpublic AMQP.Exchange.UnbindOk exchangeUnbind(java.lang.String destination, java.lang.String source, java.lang.String routingKey) throws java.io.IOException
ChannelexchangeUnbind in interface Channeldestination - the name of the exchange to which messages flow across the bindingsource - the name of the exchange from which messages flow across the bindingroutingKey - the routine key to use for the bindingjava.io.IOException - if an error is encounteredAMQP.Exchange.Bind,
AMQP.Exchange.BindOkpublic AMQP.Exchange.UnbindOk exchangeUnbind(java.lang.String destination, java.lang.String source, java.lang.String routingKey, java.util.Map<java.lang.String,java.lang.Object> arguments) throws java.io.IOException
ChannelexchangeUnbind in interface Channeldestination - the name of the exchange to which messages flow across the bindingsource - the name of the exchange from which messages flow across the bindingroutingKey - the routine key to use for the bindingarguments - other properties (binding parameters)java.io.IOException - if an error is encounteredAMQP.Exchange.Bind,
AMQP.Exchange.BindOkpublic void exchangeUnbindNoWait(java.lang.String destination,
java.lang.String source,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
throws java.io.IOException
ChannelChannel.exchangeUnbind(String, String, String, java.util.Map) but sets no-wait parameter to true
and returns nothing (as there will be no response from the server).exchangeUnbindNoWait in interface Channeldestination - the name of the exchange to which messages flow across the bindingsource - the name of the exchange from which messages flow across the bindingroutingKey - the routine key to use for the bindingarguments - other properties (binding parameters)java.io.IOException - if an error is encounteredpublic AMQP.Queue.DeclareOk queueDeclare() throws java.io.IOException
ChannelAMQP.Queue.DeclareOk result.queueDeclare in interface Channeljava.io.IOException - if an error is encounteredAMQP.Queue.Declare,
AMQP.Queue.DeclareOkpublic AMQP.Queue.DeclareOk queueDeclare(java.lang.String queue, boolean durable, boolean exclusive, boolean autoDelete, java.util.Map<java.lang.String,java.lang.Object> arguments) throws java.io.IOException
ChannelqueueDeclare in interface Channelqueue - the name of the queuedurable - 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 queuejava.io.IOException - if an error is encounteredAMQP.Queue.Declare,
AMQP.Queue.DeclareOkpublic void queueDeclareNoWait(java.lang.String queue,
boolean durable,
boolean exclusive,
boolean autoDelete,
java.util.Map<java.lang.String,java.lang.Object> arguments)
throws java.io.IOException
ChannelChannel.queueDeclare(String, boolean, boolean, boolean, java.util.Map) but sets nowait
flag to true and returns no result (as there will be no response from the server).queueDeclareNoWait in interface Channelqueue - the name of the queuedurable - 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 queuejava.io.IOException - if an error is encounteredpublic AMQP.Queue.DeclareOk queueDeclarePassive(java.lang.String queue) throws java.io.IOException
ChannelqueueDeclarePassive in interface Channelqueue - the name of the queuejava.io.IOException - if an error is encountered,
including if the queue does not exist and if the queue is
exclusively owned by another connection.AMQP.Queue.Declare,
AMQP.Queue.DeclareOkpublic long messageCount(java.lang.String queue)
throws java.io.IOException
ChannelmessageCount in interface Channelqueue - the name of the queuejava.io.IOException - Problem transmitting method.public long consumerCount(java.lang.String queue)
throws java.io.IOException
ChannelconsumerCount in interface Channelqueue - the name of the queuejava.io.IOException - Problem transmitting method.public AMQP.Queue.DeleteOk queueDelete(java.lang.String queue) throws java.io.IOException
ChannelqueueDelete in interface Channelqueue - the name of the queuejava.io.IOException - if an error is encounteredAMQP.Queue.Delete,
AMQP.Queue.DeleteOkpublic AMQP.Queue.DeleteOk queueDelete(java.lang.String queue, boolean ifUnused, boolean ifEmpty) throws java.io.IOException
ChannelqueueDelete in interface Channelqueue - the name of the queueifUnused - true if the queue should be deleted only if not in useifEmpty - true if the queue should be deleted only if emptyjava.io.IOException - if an error is encounteredAMQP.Queue.Delete,
AMQP.Queue.DeleteOkpublic void queueDeleteNoWait(java.lang.String queue,
boolean ifUnused,
boolean ifEmpty)
throws java.io.IOException
ChannelChannel.queueDelete(String, boolean, boolean) but sets nowait parameter
to true and returns nothing (as there will be no response from the server).queueDeleteNoWait in interface Channelqueue - the name of the queueifUnused - true if the queue should be deleted only if not in useifEmpty - true if the queue should be deleted only if emptyjava.io.IOException - if an error is encounteredAMQP.Queue.Delete,
AMQP.Queue.DeleteOkpublic AMQP.Queue.BindOk queueBind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey) throws java.io.IOException
ChannelqueueBind in interface Channelqueue - the name of the queueexchange - the name of the exchangeroutingKey - the routine key to use for the bindingjava.io.IOException - if an error is encounteredAMQP.Queue.Bind,
AMQP.Queue.BindOkpublic AMQP.Queue.BindOk queueBind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey, java.util.Map<java.lang.String,java.lang.Object> arguments) throws java.io.IOException
ChannelqueueBind in interface Channelqueue - the name of the queueexchange - the name of the exchangeroutingKey - the routine key to use for the bindingarguments - other properties (binding parameters)java.io.IOException - if an error is encounteredAMQP.Queue.Bind,
AMQP.Queue.BindOkpublic void queueBindNoWait(java.lang.String queue,
java.lang.String exchange,
java.lang.String routingKey,
java.util.Map<java.lang.String,java.lang.Object> arguments)
throws java.io.IOException
ChannelChannel.queueDeclare(String, boolean, boolean, boolean, java.util.Map) but sets nowait
parameter to true and returns void (as there will be no response
from the server).queueBindNoWait in interface Channelqueue - the name of the queueexchange - the name of the exchangeroutingKey - the routine key to use for the bindingarguments - other properties (binding parameters)java.io.IOException - if an error is encounteredpublic AMQP.Queue.UnbindOk queueUnbind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey) throws java.io.IOException
ChannelqueueUnbind in interface Channelqueue - the name of the queueexchange - the name of the exchangeroutingKey - the routine key to use for the bindingjava.io.IOException - if an error is encounteredAMQP.Queue.Unbind,
AMQP.Queue.UnbindOkpublic AMQP.Queue.UnbindOk queueUnbind(java.lang.String queue, java.lang.String exchange, java.lang.String routingKey, java.util.Map<java.lang.String,java.lang.Object> arguments) throws java.io.IOException
ChannelqueueUnbind in interface Channelqueue - the name of the queueexchange - the name of the exchangeroutingKey - the routine key to use for the bindingarguments - other properties (binding parameters)java.io.IOException - if an error is encounteredAMQP.Queue.Unbind,
AMQP.Queue.UnbindOkpublic AMQP.Queue.PurgeOk queuePurge(java.lang.String queue) throws java.io.IOException
ChannelqueuePurge in interface Channelqueue - the name of the queuejava.io.IOException - if an error is encounteredAMQP.Queue.Purge,
AMQP.Queue.PurgeOkpublic GetResponse basicGet(java.lang.String queue, boolean autoAck) throws java.io.IOException
ChannelAMQP.Basic.GetbasicGet in interface Channelqueue - the name of the queueautoAck - true if the server should consider messages
acknowledged once delivered; false if the server should expect
explicit acknowledgementsGetResponse containing the retrieved message datajava.io.IOException - if an error is encounteredAMQP.Basic.Get,
AMQP.Basic.GetOk,
AMQP.Basic.GetEmptypublic void basicAck(long deliveryTag,
boolean multiple)
throws java.io.IOException
ChannelAMQP.Basic.GetOk
or AMQP.Basic.Deliver method
containing the received message being acknowledged.basicAck in interface ChanneldeliveryTag - the tag from the received AMQP.Basic.GetOk or AMQP.Basic.Delivermultiple - true to acknowledge all messages up to and
including the supplied delivery tag; false to acknowledge just
the supplied delivery tag.java.io.IOException - if an error is encounteredAMQP.Basic.Ackpublic void basicNack(long deliveryTag,
boolean multiple,
boolean requeue)
throws java.io.IOException
ChanneldeliveryTag from the AMQP.Basic.GetOk
or AMQP.Basic.GetOk method containing the message to be rejected.basicNack in interface ChanneldeliveryTag - the tag from the received AMQP.Basic.GetOk or AMQP.Basic.Delivermultiple - 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-letteredjava.io.IOException - if an error is encounteredAMQP.Basic.Nackpublic void basicReject(long deliveryTag,
boolean requeue)
throws java.io.IOException
ChannelAMQP.Basic.GetOk
or AMQP.Basic.Deliver method
containing the received message being rejected.basicReject in interface ChanneldeliveryTag - the tag from the received AMQP.Basic.GetOk or AMQP.Basic.Deliverrequeue - true if the rejected message should be requeued rather than discarded/dead-letteredjava.io.IOException - if an error is encounteredAMQP.Basic.Rejectpublic java.lang.String basicConsume(java.lang.String queue,
Consumer callback)
throws java.io.IOException
ChannelbasicConsume in interface Channelqueue - the name of the queuecallback - an interface to the consumer objectjava.io.IOException - if an error is encounteredAMQP.Basic.Consume,
AMQP.Basic.ConsumeOk,
Channel.basicAck(long, boolean),
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)public java.lang.String basicConsume(java.lang.String queue,
boolean autoAck,
Consumer callback)
throws java.io.IOException
ChannelbasicConsume in interface Channelqueue - the name of the queueautoAck - true if the server should consider messages
acknowledged once delivered; false if the server should expect
explicit acknowledgementscallback - an interface to the consumer objectjava.io.IOException - if an error is encounteredAMQP.Basic.Consume,
AMQP.Basic.ConsumeOk,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)public java.lang.String basicConsume(java.lang.String queue,
boolean autoAck,
java.lang.String consumerTag,
Consumer callback)
throws java.io.IOException
ChannelbasicConsume in interface Channelqueue - the name of the queueautoAck - true if the server should consider messages
acknowledged once delivered; false if the server should expect
explicit acknowledgementsconsumerTag - a client-generated consumer tag to establish contextcallback - an interface to the consumer objectjava.io.IOException - if an error is encounteredAMQP.Basic.Consume,
AMQP.Basic.ConsumeOk,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)public java.lang.String basicConsume(java.lang.String queue,
boolean autoAck,
java.util.Map<java.lang.String,java.lang.Object> arguments,
Consumer callback)
throws java.io.IOException
ChannelbasicConsume in interface Channelqueue - the name of the queueautoAck - true if the server should consider messages
acknowledged once delivered; false if the server should expect
explicit acknowledgementsarguments - a set of arguments for the consumecallback - an interface to the consumer objectjava.io.IOException - if an error is encounteredAMQP.Basic.Consume,
AMQP.Basic.ConsumeOk,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)public java.lang.String basicConsume(java.lang.String queue,
boolean autoAck,
java.lang.String consumerTag,
boolean noLocal,
boolean exclusive,
java.util.Map<java.lang.String,java.lang.Object> arguments,
Consumer callback)
throws java.io.IOException
ChannelConsumer.handleConsumeOk(java.lang.String)
method.basicConsume in interface Channelqueue - the name of the queueautoAck - true if the server should consider messages
acknowledged once delivered; false if the server should expect
explicit acknowledgementsconsumerTag - a client-generated consumer tag to establish contextnoLocal - true if the server should not deliver to this consumer
messages published on this channel's connectionexclusive - true if this is an exclusive consumerarguments - a set of arguments for the consumecallback - an interface to the consumer objectjava.io.IOException - if an error is encounteredAMQP.Basic.Consume,
AMQP.Basic.ConsumeOkpublic void basicCancel(java.lang.String consumerTag)
throws java.io.IOException
ChannelConsumer.handleCancelOk(java.lang.String)
method.basicCancel in interface ChannelconsumerTag - a client- or server-generated consumer tag to establish contextjava.io.IOException - if an error is encountered, or if the consumerTag is unknownAMQP.Basic.Cancel,
AMQP.Basic.CancelOkpublic AMQP.Basic.RecoverOk basicRecover() throws java.io.IOException
ChannelbasicRecover(true), messages
will be requeued and possibly delivered to a different consumer.basicRecover in interface Channeljava.io.IOExceptionChannel.basicRecover(boolean)public AMQP.Basic.RecoverOk basicRecover(boolean requeue) throws java.io.IOException
ChannelbasicRecover in interface Channelrequeue - If true, messages will be requeued and possibly
delivered to a different consumer. If false, messages will be
redelivered to the same consumer.java.io.IOExceptionpublic AMQP.Tx.SelectOk txSelect() throws java.io.IOException
ChanneltxSelect in interface Channeljava.io.IOException - if an error is encounteredAMQP.Tx.Select,
AMQP.Tx.SelectOkpublic AMQP.Tx.CommitOk txCommit() throws java.io.IOException
ChanneltxCommit in interface Channeljava.io.IOException - if an error is encounteredAMQP.Tx.Commit,
AMQP.Tx.CommitOkpublic AMQP.Tx.RollbackOk txRollback() throws java.io.IOException
ChanneltxRollback in interface Channeljava.io.IOException - if an error is encounteredAMQP.Tx.Rollback,
AMQP.Tx.RollbackOkpublic AMQP.Confirm.SelectOk confirmSelect() throws java.io.IOException
ChannelconfirmSelect in interface Channeljava.io.IOException - if an error is encounteredAMQP.Confirm.Selectpublic long getNextPublishSeqNo()
ChannelgetNextPublishSeqNo in interface Channelpublic boolean waitForConfirms()
throws java.lang.InterruptedException
ChannelwaitForConfirms in interface Channeljava.lang.InterruptedExceptionpublic boolean waitForConfirms(long timeout)
throws java.lang.InterruptedException,
java.util.concurrent.TimeoutException
ChannelwaitForConfirms in interface Channeljava.lang.InterruptedExceptionjava.util.concurrent.TimeoutExceptionpublic void waitForConfirmsOrDie()
throws java.io.IOException,
java.lang.InterruptedException
ChannelwaitForConfirmsOrDie in interface Channeljava.io.IOExceptionjava.lang.InterruptedExceptionpublic void waitForConfirmsOrDie(long timeout)
throws java.io.IOException,
java.lang.InterruptedException,
java.util.concurrent.TimeoutException
ChannelwaitForConfirmsOrDie in interface Channeljava.io.IOExceptionjava.lang.InterruptedExceptionjava.util.concurrent.TimeoutExceptionpublic void asyncRpc(Method method) throws java.io.IOException
Channelpublic Command rpc(Method method) throws java.io.IOException
Channelpublic void addShutdownListener(ShutdownListener listener)
ShutdownNotifieraddShutdownListener in interface ShutdownNotifierlistener - ShutdownListener to the componentShutdownNotifier.addShutdownListener(com.rabbitmq.client.ShutdownListener)public void removeShutdownListener(ShutdownListener listener)
ShutdownNotifierremoveShutdownListener in interface ShutdownNotifierlistener - ShutdownListener to be removedpublic ShutdownSignalException getCloseReason()
ShutdownNotifiergetCloseReason in interface ShutdownNotifierpublic void notifyListeners()
ShutdownNotifiernotifyListeners in interface ShutdownNotifierShutdownListenerpublic boolean isOpen()
ShutdownNotifierisOpen in interface ShutdownNotifierpublic void addRecoveryListener(RecoveryListener listener)
RecoverableaddRecoveryListener in interface Recoverablelistener - Callback functionpublic void removeRecoveryListener(RecoveryListener listener)
removeRecoveryListener in interface Recoverablepublic void automaticallyRecover(AutorecoveringConnection connection, Connection connDelegate) throws java.io.IOException
java.io.IOException