public class AutorecoveringChannel extends Object implements RecoverableChannel
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,
String closeMessage)
Abort this channel.
|
ConfirmListener |
addConfirmListener(ConfirmCallback ackCallback,
ConfirmCallback nackCallback)
Add a lambda-based
ConfirmListener . |
void |
addConfirmListener(ConfirmListener listener)
Add a
ConfirmListener . |
void |
addRecoveryListener(RecoveryListener listener)
Registers a connection recovery callback.
|
ReturnListener |
addReturnListener(ReturnCallback returnCallback)
Add a lambda-based
ReturnListener . |
void |
addReturnListener(ReturnListener listener)
Add a
ReturnListener . |
void |
addShutdownListener(ShutdownListener listener)
Add shutdown listener.
|
CompletableFuture<Command> |
asyncCompletableRpc(Method method)
Asynchronously send a method over this channel.
|
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(String consumerTag)
Cancel a consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
Consumer callback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag.
|
String |
basicConsume(String queue,
boolean autoAck,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag.
|
String |
basicConsume(String queue,
boolean autoAck,
DeliverCallback deliverCallback,
CancelCallback cancelCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag.
|
String |
basicConsume(String queue,
boolean autoAck,
DeliverCallback deliverCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag.
|
String |
basicConsume(String queue,
boolean autoAck,
Map<String,Object> arguments,
Consumer callback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag and specified arguments.
|
String |
basicConsume(String queue,
boolean autoAck,
Map<String,Object> arguments,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag and specified arguments.
|
String |
basicConsume(String queue,
boolean autoAck,
Map<String,Object> arguments,
DeliverCallback deliverCallback,
CancelCallback cancelCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag and specified arguments.
|
String |
basicConsume(String queue,
boolean autoAck,
Map<String,Object> arguments,
DeliverCallback deliverCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag and specified arguments.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
boolean noLocal,
boolean exclusive,
Map<String,Object> arguments,
Consumer callback)
Start a consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
boolean noLocal,
boolean exclusive,
Map<String,Object> arguments,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Start a consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
boolean noLocal,
boolean exclusive,
Map<String,Object> arguments,
DeliverCallback deliverCallback,
CancelCallback cancelCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
boolean noLocal,
boolean exclusive,
Map<String,Object> arguments,
DeliverCallback deliverCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
Consumer callback)
Start a non-nolocal, non-exclusive consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Start a non-nolocal, non-exclusive consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
DeliverCallback deliverCallback,
CancelCallback cancelCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a non-nolocal, non-exclusive consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
DeliverCallback deliverCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a non-nolocal, non-exclusive consumer.
|
String |
basicConsume(String queue,
Consumer callback)
Start a non-nolocal, non-exclusive consumer, with
explicit acknowledgement and a server-generated consumerTag.
|
String |
basicConsume(String queue,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Start a non-nolocal, non-exclusive consumer, with
explicit acknowledgement and a server-generated consumerTag.
|
String |
basicConsume(String queue,
DeliverCallback deliverCallback,
CancelCallback cancelCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a non-nolocal, non-exclusive consumer, with
explicit acknowledgement and a server-generated consumerTag.
|
String |
basicConsume(String queue,
DeliverCallback deliverCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Start a non-nolocal, non-exclusive consumer, with
explicit acknowledgement and a server-generated consumerTag.
|
GetResponse |
basicGet(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(String exchange,
String routingKey,
AMQP.BasicProperties props,
byte[] body)
Publish a message.
|
void |
basicPublish(String exchange,
String routingKey,
boolean mandatory,
AMQP.BasicProperties props,
byte[] body)
Publish a message.
|
void |
basicPublish(String exchange,
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
ConfirmListener s. |
void |
clearReturnListeners()
Remove all
ReturnListener s. |
void |
close()
Close this channel with the
AMQP.REPLY_SUCCESS close code
and message 'OK'. |
void |
close(int closeCode,
String closeMessage)
Close this channel.
|
AMQP.Confirm.SelectOk |
confirmSelect()
Enables publisher acknowledgements on this channel.
|
long |
consumerCount(String queue)
Returns the number of consumers on a queue.
|
void |
deleteRecordedConsumer(String consumerTag)
Delete the recorded consumer from this channel and accompanying connection
|
AMQP.Exchange.BindOk |
exchangeBind(String destination,
String source,
String routingKey)
Bind an exchange to an exchange, with no extra arguments.
|
AMQP.Exchange.BindOk |
exchangeBind(String destination,
String source,
String routingKey,
Map<String,Object> arguments)
Bind an exchange to an exchange.
|
void |
exchangeBindNoWait(String destination,
String source,
String routingKey,
Map<String,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(String exchange,
BuiltinExchangeType type)
Actively declare a non-autodelete, non-durable exchange with no extra arguments
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(String exchange,
BuiltinExchangeType type,
boolean durable)
Actively declare a non-autodelete exchange with no extra arguments
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(String exchange,
BuiltinExchangeType type,
boolean durable,
boolean autoDelete,
boolean internal,
Map<String,Object> arguments)
Declare an exchange, via an interface that allows the complete set of
arguments.
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(String exchange,
BuiltinExchangeType type,
boolean durable,
boolean autoDelete,
Map<String,Object> arguments)
Declare an exchange.
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(String exchange,
String type)
Actively declare a non-autodelete, non-durable exchange with no extra arguments
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(String exchange,
String type,
boolean durable)
Actively declare a non-autodelete exchange with no extra arguments
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(String exchange,
String type,
boolean durable,
boolean autoDelete,
boolean internal,
Map<String,Object> arguments)
Declare an exchange, via an interface that allows the complete set of
arguments.
|
AMQP.Exchange.DeclareOk |
exchangeDeclare(String exchange,
String type,
boolean durable,
boolean autoDelete,
Map<String,Object> arguments)
Declare an exchange.
|
void |
exchangeDeclareNoWait(String exchange,
BuiltinExchangeType type,
boolean durable,
boolean autoDelete,
boolean internal,
Map<String,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). |
void |
exchangeDeclareNoWait(String exchange,
String type,
boolean durable,
boolean autoDelete,
boolean internal,
Map<String,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(String name)
Declare an exchange passively; that is, check if the named exchange exists.
|
AMQP.Exchange.DeleteOk |
exchangeDelete(String exchange)
Delete an exchange, without regard for whether it is in use or not
|
AMQP.Exchange.DeleteOk |
exchangeDelete(String exchange,
boolean ifUnused)
Delete an exchange
|
void |
exchangeDeleteNoWait(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(String destination,
String source,
String routingKey)
Unbind an exchange from an exchange, with no extra arguments.
|
AMQP.Exchange.UnbindOk |
exchangeUnbind(String destination,
String source,
String routingKey,
Map<String,Object> arguments)
Unbind an exchange from an exchange.
|
void |
exchangeUnbindNoWait(String destination,
String source,
String routingKey,
Map<String,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). |
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(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(String queue,
String exchange,
String routingKey)
Bind a queue to an exchange, with no extra arguments.
|
AMQP.Queue.BindOk |
queueBind(String queue,
String exchange,
String routingKey,
Map<String,Object> arguments)
Bind a queue to an exchange.
|
void |
queueBindNoWait(String queue,
String exchange,
String routingKey,
Map<String,Object> arguments)
Same as
Channel.queueBind(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.Queue.DeclareOk |
queueDeclare()
Actively declare a server-named exclusive, autodelete, non-durable queue.
|
AMQP.Queue.DeclareOk |
queueDeclare(String queue,
boolean durable,
boolean exclusive,
boolean autoDelete,
Map<String,Object> arguments)
Declare a queue
|
void |
queueDeclareNoWait(String queue,
boolean durable,
boolean exclusive,
boolean autoDelete,
Map<String,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(String queue)
Declare a queue passively; i.e., check if it exists.
|
AMQP.Queue.DeleteOk |
queueDelete(String queue)
Delete a queue, without regard for whether it is in use or has messages on it
|
AMQP.Queue.DeleteOk |
queueDelete(String queue,
boolean ifUnused,
boolean ifEmpty)
Delete a queue
|
void |
queueDeleteNoWait(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(String queue)
Purges the contents of the given queue.
|
AMQP.Queue.UnbindOk |
queueUnbind(String queue,
String exchange,
String routingKey)
Unbinds a queue from an exchange, with no extra arguments.
|
AMQP.Queue.UnbindOk |
queueUnbind(String queue,
String exchange,
String routingKey,
Map<String,Object> arguments)
Unbind a queue from an exchange.
|
boolean |
removeConfirmListener(ConfirmListener listener)
Remove a
ConfirmListener . |
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.
|
String |
toString() |
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()
Channel
getChannelNumber
in interface Channel
public Connection getConnection()
Channel
getConnection
in interface Channel
Connection
public Channel getDelegate()
public void close() throws IOException, TimeoutException
Channel
AMQP.REPLY_SUCCESS
close code
and message 'OK'.close
in interface Channel
close
in interface AutoCloseable
IOException
- if an error is encounteredTimeoutException
public void close(int closeCode, String closeMessage) throws IOException, TimeoutException
Channel
close
in interface Channel
closeCode
- the close code (See under "Reply Codes" in the AMQP specification)closeMessage
- a message indicating the reason for closing the connectionIOException
- if an error is encounteredTimeoutException
public void abort() throws IOException
Channel
AMQP.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.abort
in interface Channel
IOException
public void abort(int closeCode, String closeMessage) throws IOException
Channel
abort
in interface Channel
IOException
public void addReturnListener(ReturnListener listener)
Channel
ReturnListener
.addReturnListener
in interface Channel
listener
- the listener to addpublic ReturnListener addReturnListener(ReturnCallback returnCallback)
Channel
ReturnListener
.addReturnListener
in interface Channel
returnCallback
- the callback when the message is returnedReturnListener
,
ReturnCallback
,
Return
public boolean removeReturnListener(ReturnListener listener)
Channel
ReturnListener
.removeReturnListener
in interface Channel
listener
- the listener to removetrue
if the listener was found and removed,
false
otherwisepublic void clearReturnListeners()
Channel
ReturnListener
s.clearReturnListeners
in interface Channel
public void addConfirmListener(ConfirmListener listener)
Channel
ConfirmListener
.addConfirmListener
in interface Channel
listener
- the listener to addpublic ConfirmListener addConfirmListener(ConfirmCallback ackCallback, ConfirmCallback nackCallback)
Channel
ConfirmListener
.addConfirmListener
in interface Channel
ackCallback
- callback on acknackCallback
- call on nack (negative ack)ConfirmListener
,
ConfirmCallback
public boolean removeConfirmListener(ConfirmListener listener)
Channel
ConfirmListener
.removeConfirmListener
in interface Channel
listener
- the listener to removetrue
if the listener was found and removed,
false
otherwisepublic void clearConfirmListeners()
Channel
ConfirmListener
s.clearConfirmListeners
in interface Channel
public Consumer getDefaultConsumer()
Channel
getDefaultConsumer
in interface Channel
public void setDefaultConsumer(Consumer consumer)
Channel
setDefaultConsumer
in interface Channel
consumer
- the consumer to use, or null indicating "don't use one".public void basicQos(int prefetchSize, int prefetchCount, boolean global) throws IOException
Channel
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.
Note the prefetch count must be between 0 and 65535 (unsigned short in AMQP 0-9-1).
basicQos
in interface Channel
prefetchSize
- 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 consumerIOException
- if an error is encounteredAMQP.Basic.Qos
public void basicQos(int prefetchCount) throws IOException
Channel
Note the prefetch count must be between 0 and 65535 (unsigned short in AMQP 0-9-1).
basicQos
in interface Channel
prefetchCount
- maximum number of messages that the server
will deliver, 0 if unlimitedIOException
- if an error is encounteredChannel.basicQos(int, int, boolean)
public void basicQos(int prefetchCount, boolean global) throws IOException
Channel
Note the prefetch count must be between 0 and 65535 (unsigned short in AMQP 0-9-1).
basicQos
in interface Channel
prefetchCount
- 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 consumerIOException
- if an error is encounteredChannel.basicQos(int, int, boolean)
public void basicPublish(String exchange, String routingKey, AMQP.BasicProperties props, byte[] body) throws IOException
Channel
Channel#basicPublish
will eventually block if a
resource-driven alarm is in effect.basicPublish
in interface Channel
exchange
- the exchange to publish the message toroutingKey
- the routing keyprops
- other properties for the message - routing headers etcbody
- the message bodyIOException
- if an error is encounteredAMQP.Basic.Publish
,
Resource-driven alarmspublic void basicPublish(String exchange, String routingKey, boolean mandatory, AMQP.BasicProperties props, byte[] body) throws IOException
Channel
Channel#basicPublish
will eventually block if a
resource-driven alarm is in effect.basicPublish
in interface Channel
exchange
- 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 bodyIOException
- if an error is encounteredAMQP.Basic.Publish
,
Resource-driven alarmspublic void basicPublish(String exchange, String routingKey, boolean mandatory, boolean immediate, AMQP.BasicProperties props, byte[] body) throws IOException
Channel
Channel#basicPublish
will eventually block if a
resource-driven alarm is in effect.basicPublish
in interface Channel
exchange
- 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 bodyIOException
- if an error is encounteredAMQP.Basic.Publish
,
Resource-driven alarmspublic AMQP.Exchange.DeclareOk exchangeDeclare(String exchange, String type) throws IOException
Channel
exchangeDeclare
in interface Channel
exchange
- the name of the exchangetype
- the exchange typeIOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQP.Exchange.DeclareOk exchangeDeclare(String exchange, BuiltinExchangeType type) throws IOException
Channel
exchangeDeclare
in interface Channel
exchange
- the name of the exchangetype
- the exchange typeIOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQP.Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable) throws IOException
Channel
exchangeDeclare
in interface Channel
exchange
- the name of the exchangetype
- the exchange typedurable
- true if we are declaring a durable exchange (the exchange will survive a server restart)IOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQP.Exchange.DeclareOk exchangeDeclare(String exchange, BuiltinExchangeType type, boolean durable) throws IOException
Channel
exchangeDeclare
in interface Channel
exchange
- the name of the exchangetype
- the exchange typedurable
- true if we are declaring a durable exchange (the exchange will survive a server restart)IOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQP.Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable, boolean autoDelete, Map<String,Object> arguments) throws IOException
Channel
exchangeDeclare
in interface Channel
exchange
- 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 exchangeIOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQP.Exchange.DeclareOk exchangeDeclare(String exchange, BuiltinExchangeType type, boolean durable, boolean autoDelete, Map<String,Object> arguments) throws IOException
Channel
exchangeDeclare
in interface Channel
exchange
- 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 exchangeIOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQP.Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable, boolean autoDelete, boolean internal, Map<String,Object> arguments) throws IOException
Channel
exchangeDeclare
in interface Channel
exchange
- 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 exchangeIOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQP.Exchange.DeclareOk exchangeDeclare(String exchange, BuiltinExchangeType type, boolean durable, boolean autoDelete, boolean internal, Map<String,Object> arguments) throws IOException
Channel
exchangeDeclare
in interface Channel
exchange
- 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 exchangeIOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public void exchangeDeclareNoWait(String exchange, String type, boolean durable, boolean autoDelete, boolean internal, Map<String,Object> arguments) throws IOException
Channel
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).exchangeDeclareNoWait
in interface Channel
exchange
- 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 exchangeIOException
- if an error is encounteredpublic void exchangeDeclareNoWait(String exchange, BuiltinExchangeType type, boolean durable, boolean autoDelete, boolean internal, Map<String,Object> arguments) throws IOException
Channel
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).exchangeDeclareNoWait
in interface Channel
exchange
- 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 exchangeIOException
- if an error is encounteredpublic AMQP.Exchange.DeclareOk exchangeDeclarePassive(String name) throws IOException
Channel
exchangeDeclarePassive
in interface Channel
name
- check the existence of an exchange named thisIOException
- the server will raise a 404 channel exception if the named exchange does not exist.public AMQP.Exchange.DeleteOk exchangeDelete(String exchange, boolean ifUnused) throws IOException
Channel
exchangeDelete
in interface Channel
exchange
- the name of the exchangeifUnused
- true to indicate that the exchange is only to be deleted if it is unusedIOException
- if an error is encounteredAMQP.Exchange.Delete
,
AMQP.Exchange.DeleteOk
public void exchangeDeleteNoWait(String exchange, boolean ifUnused) throws IOException
Channel
Channel.exchangeDelete(String, boolean)
but sets nowait parameter to true
and returns void (as there will be no response from the server).exchangeDeleteNoWait
in interface Channel
exchange
- the name of the exchangeifUnused
- true to indicate that the exchange is only to be deleted if it is unusedIOException
- if an error is encounteredAMQP.Exchange.Delete
,
AMQP.Exchange.DeleteOk
public AMQP.Exchange.DeleteOk exchangeDelete(String exchange) throws IOException
Channel
exchangeDelete
in interface Channel
exchange
- the name of the exchangeIOException
- if an error is encounteredAMQP.Exchange.Delete
,
AMQP.Exchange.DeleteOk
public AMQP.Exchange.BindOk exchangeBind(String destination, String source, String routingKey) throws IOException
Channel
exchangeBind
in interface Channel
destination
- 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 routing key to use for the bindingIOException
- if an error is encounteredAMQP.Exchange.Bind
,
AMQP.Exchange.BindOk
public AMQP.Exchange.BindOk exchangeBind(String destination, String source, String routingKey, Map<String,Object> arguments) throws IOException
Channel
exchangeBind
in interface Channel
destination
- 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 routing key to use for the bindingarguments
- other properties (binding parameters)IOException
- if an error is encounteredAMQP.Exchange.Bind
,
AMQP.Exchange.BindOk
public void exchangeBindNoWait(String destination, String source, String routingKey, Map<String,Object> arguments) throws IOException
Channel
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).exchangeBindNoWait
in interface Channel
destination
- 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 routing key to use for the bindingarguments
- other properties (binding parameters)IOException
- if an error is encounteredpublic AMQP.Exchange.UnbindOk exchangeUnbind(String destination, String source, String routingKey) throws IOException
Channel
exchangeUnbind
in interface Channel
destination
- 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 routing key to use for the bindingIOException
- if an error is encounteredAMQP.Exchange.Bind
,
AMQP.Exchange.BindOk
public AMQP.Exchange.UnbindOk exchangeUnbind(String destination, String source, String routingKey, Map<String,Object> arguments) throws IOException
Channel
exchangeUnbind
in interface Channel
destination
- 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 routing key to use for the bindingarguments
- other properties (binding parameters)IOException
- if an error is encounteredAMQP.Exchange.Bind
,
AMQP.Exchange.BindOk
public void exchangeUnbindNoWait(String destination, String source, String routingKey, Map<String,Object> arguments) throws IOException
Channel
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).exchangeUnbindNoWait
in interface Channel
destination
- 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 routing key to use for the bindingarguments
- other properties (binding parameters)IOException
- if an error is encounteredpublic AMQP.Queue.DeclareOk queueDeclare() throws IOException
Channel
AMQP.Queue.DeclareOk
result.queueDeclare
in interface Channel
IOException
- if an error is encounteredAMQP.Queue.Declare
,
AMQP.Queue.DeclareOk
public AMQP.Queue.DeclareOk queueDeclare(String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String,Object> arguments) throws IOException
Channel
queueDeclare
in interface Channel
queue
- 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 queueIOException
- if an error is encounteredAMQP.Queue.Declare
,
AMQP.Queue.DeclareOk
public void queueDeclareNoWait(String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String,Object> arguments) throws IOException
Channel
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).queueDeclareNoWait
in interface Channel
queue
- 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 queueIOException
- if an error is encounteredpublic AMQP.Queue.DeclareOk queueDeclarePassive(String queue) throws IOException
Channel
queueDeclarePassive
in interface Channel
queue
- the name of the queueIOException
- 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.DeclareOk
public long messageCount(String queue) throws IOException
Channel
messageCount
in interface Channel
queue
- the name of the queueIOException
- Problem transmitting method.public long consumerCount(String queue) throws IOException
Channel
consumerCount
in interface Channel
queue
- the name of the queueIOException
- Problem transmitting method.public AMQP.Queue.DeleteOk queueDelete(String queue) throws IOException
Channel
queueDelete
in interface Channel
queue
- the name of the queueIOException
- if an error is encounteredAMQP.Queue.Delete
,
AMQP.Queue.DeleteOk
public AMQP.Queue.DeleteOk queueDelete(String queue, boolean ifUnused, boolean ifEmpty) throws IOException
Channel
queueDelete
in interface Channel
queue
- 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 emptyIOException
- if an error is encounteredAMQP.Queue.Delete
,
AMQP.Queue.DeleteOk
public void queueDeleteNoWait(String queue, boolean ifUnused, boolean ifEmpty) throws IOException
Channel
Channel.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 Channel
queue
- 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 emptyIOException
- if an error is encounteredAMQP.Queue.Delete
,
AMQP.Queue.DeleteOk
public AMQP.Queue.BindOk queueBind(String queue, String exchange, String routingKey) throws IOException
Channel
queueBind
in interface Channel
queue
- the name of the queueexchange
- the name of the exchangeroutingKey
- the routing key to use for the bindingIOException
- if an error is encounteredAMQP.Queue.Bind
,
AMQP.Queue.BindOk
public AMQP.Queue.BindOk queueBind(String queue, String exchange, String routingKey, Map<String,Object> arguments) throws IOException
Channel
queueBind
in interface Channel
queue
- the name of the queueexchange
- the name of the exchangeroutingKey
- the routing key to use for the bindingarguments
- other properties (binding parameters)IOException
- if an error is encounteredAMQP.Queue.Bind
,
AMQP.Queue.BindOk
public void queueBindNoWait(String queue, String exchange, String routingKey, Map<String,Object> arguments) throws IOException
Channel
Channel.queueBind(String, String, String, java.util.Map)
but sets nowait
parameter to true and returns void (as there will be no response
from the server).queueBindNoWait
in interface Channel
queue
- the name of the queueexchange
- the name of the exchangeroutingKey
- the routing key to use for the bindingarguments
- other properties (binding parameters)IOException
- if an error is encounteredpublic AMQP.Queue.UnbindOk queueUnbind(String queue, String exchange, String routingKey) throws IOException
Channel
queueUnbind
in interface Channel
queue
- the name of the queueexchange
- the name of the exchangeroutingKey
- the routing key to use for the bindingIOException
- if an error is encounteredAMQP.Queue.Unbind
,
AMQP.Queue.UnbindOk
public AMQP.Queue.UnbindOk queueUnbind(String queue, String exchange, String routingKey, Map<String,Object> arguments) throws IOException
Channel
queueUnbind
in interface Channel
queue
- the name of the queueexchange
- the name of the exchangeroutingKey
- the routing key to use for the bindingarguments
- other properties (binding parameters)IOException
- if an error is encounteredAMQP.Queue.Unbind
,
AMQP.Queue.UnbindOk
public AMQP.Queue.PurgeOk queuePurge(String queue) throws IOException
Channel
queuePurge
in interface Channel
queue
- the name of the queueIOException
- if an error is encounteredAMQP.Queue.Purge
,
AMQP.Queue.PurgeOk
public GetResponse basicGet(String queue, boolean autoAck) throws IOException
Channel
AMQP.Basic.Get
basicGet
in interface Channel
queue
- 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 dataIOException
- if an error is encounteredAMQP.Basic.Get
,
AMQP.Basic.GetOk
,
AMQP.Basic.GetEmpty
public void basicAck(long deliveryTag, boolean multiple) throws IOException
Channel
AMQP.Basic.GetOk
or AMQP.Basic.Deliver
method
containing the received message being acknowledged.basicAck
in interface Channel
deliveryTag
- the tag from the received AMQP.Basic.GetOk
or 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.IOException
- if an error is encounteredAMQP.Basic.Ack
public void basicNack(long deliveryTag, boolean multiple, boolean requeue) throws IOException
Channel
deliveryTag
from the AMQP.Basic.GetOk
or AMQP.Basic.GetOk
method containing the message to be rejected.basicNack
in interface Channel
deliveryTag
- the tag from the received AMQP.Basic.GetOk
or 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-letteredIOException
- if an error is encounteredAMQP.Basic.Nack
public void basicReject(long deliveryTag, boolean requeue) throws IOException
Channel
AMQP.Basic.GetOk
or AMQP.Basic.Deliver
method
containing the received message being rejected.basicReject
in interface Channel
deliveryTag
- the tag from the received AMQP.Basic.GetOk
or AMQP.Basic.Deliver
requeue
- true if the rejected message should be requeued rather than discarded/dead-letteredIOException
- if an error is encounteredAMQP.Basic.Reject
public String basicConsume(String queue, Consumer callback) throws IOException
Channel
basicConsume
in interface Channel
queue
- the name of the queuecallback
- an interface to the consumer objectIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, DeliverCallback deliverCallback, CancelCallback cancelCallback) throws IOException
Channel
basic.deliver
and
basic.cancel
AMQP methods (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- the name of the queuedeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
basic.deliver
and
shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- the name of the queuedeliverCallback
- callback when a message is deliveredshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
basic.deliver
, basic.cancel
and shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- the name of the queuedeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, Consumer callback) throws IOException
Channel
basicConsume
in interface Channel
queue
- 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 objectIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, DeliverCallback deliverCallback, CancelCallback cancelCallback) throws IOException
Channel
basic.deliver
and
basic.cancel
AMQP methods (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- the name of the queueautoAck
- true if the server should consider messages
acknowledged once delivered; false if the server should expect
explicit acknowledgementsdeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
basic.deliver
and
shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- the name of the queueautoAck
- true if the server should consider messages
acknowledged once delivered; false if the server should expect
explicit acknowledgementsdeliverCallback
- callback when a message is deliveredshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
basic.deliver
, basic.cancel
and shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- the name of the queueautoAck
- true if the server should consider messages
acknowledged once delivered; false if the server should expect
explicit acknowledgementsdeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, String consumerTag, Consumer callback) throws IOException
Channel
basicConsume
in interface Channel
queue
- 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 objectIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, CancelCallback cancelCallback) throws IOException
Channel
basic.deliver
and
basic.cancel
AMQP methods (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 contextdeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
basic.deliver
and
shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 contextdeliverCallback
- callback when a message is deliveredshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, String consumerTag, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
basic.deliver
, basic.cancel
and shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 contextdeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, Map<String,Object> arguments, Consumer callback) throws IOException
Channel
basicConsume
in interface Channel
queue
- 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 objectIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, Map<String,Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback) throws IOException
Channel
basic.deliver
and
basic.cancel
AMQP methods (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 consumedeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, Map<String,Object> arguments, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
basic.deliver
and
shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 consumedeliverCallback
- callback when a message is deliveredshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, Map<String,Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
basic.deliver
, basic.cancel
and shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 consumedeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
,
Channel.basicAck(long, boolean)
,
Channel.basicConsume(String, boolean, String, boolean, boolean, Map, Consumer)
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String,Object> arguments, Consumer callback) throws IOException
Channel
Consumer.handleConsumeOk(java.lang.String)
method.basicConsume
in interface Channel
queue
- 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 connection. Note that the RabbitMQ server does not support this flag.exclusive
- true if this is an exclusive consumerarguments
- a set of arguments for the consumecallback
- an interface to the consumer objectIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String,Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback) throws IOException
Channel
Consumer.handleConsumeOk(java.lang.String)
method.
Provide access only to basic.deliver
and
basic.cancel
AMQP methods (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 connection. Note that the RabbitMQ server does not support this flag.exclusive
- true if this is an exclusive consumerarguments
- a set of arguments for the consumedeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String,Object> arguments, DeliverCallback deliverCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
Consumer.handleConsumeOk(java.lang.String)
method.
Provide access only to basic.deliver
and
shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 connection. Note that the RabbitMQ server does not support this flag.exclusive
- true if this is an exclusive consumerarguments
- a set of arguments for the consumedeliverCallback
- callback when a message is deliveredshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
public String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String,Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
Channel
Consumer.handleConsumeOk(java.lang.String)
method.
Provide access to basic.deliver
, basic.cancel
and shutdown signal callbacks (which is sufficient
for most cases). See methods with a Consumer
argument
to have access to all the application callbacks.basicConsume
in interface Channel
queue
- 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 connection. Note that the RabbitMQ server does not support this flag.exclusive
- true if this is an exclusive consumerarguments
- a set of arguments for the consumedeliverCallback
- callback when a message is deliveredcancelCallback
- callback when the consumer is cancelledshutdownSignalCallback
- callback when the channel/connection is shut downIOException
- if an error is encounteredAMQP.Basic.Consume
,
AMQP.Basic.ConsumeOk
public void basicCancel(String consumerTag) throws IOException
Channel
Consumer.handleCancelOk(java.lang.String)
method.basicCancel
in interface Channel
consumerTag
- a client- or server-generated consumer tag to establish contextIOException
- if an error is encountered, or if the consumerTag is unknownAMQP.Basic.Cancel
,
AMQP.Basic.CancelOk
public AMQP.Basic.RecoverOk basicRecover() throws IOException
Channel
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 callingbasicRecover(true)
, messages
will be requeued and possibly delivered to a different consumer.basicRecover
in interface Channel
IOException
Channel.basicRecover(boolean)
public AMQP.Basic.RecoverOk basicRecover(boolean requeue) throws IOException
Channel
basicRecover
in interface Channel
requeue
- If true, messages will be requeued and possibly
delivered to a different consumer. If false, messages will be
redelivered to the same consumer.IOException
public AMQP.Tx.SelectOk txSelect() throws IOException
Channel
txSelect
in interface Channel
IOException
- if an error is encounteredAMQP.Tx.Select
,
AMQP.Tx.SelectOk
public AMQP.Tx.CommitOk txCommit() throws IOException
Channel
txCommit
in interface Channel
IOException
- if an error is encounteredAMQP.Tx.Commit
,
AMQP.Tx.CommitOk
public AMQP.Tx.RollbackOk txRollback() throws IOException
Channel
txRollback
in interface Channel
IOException
- if an error is encounteredAMQP.Tx.Rollback
,
AMQP.Tx.RollbackOk
public AMQP.Confirm.SelectOk confirmSelect() throws IOException
Channel
confirmSelect
in interface Channel
IOException
- if an error is encounteredAMQP.Confirm.Select
public long getNextPublishSeqNo()
Channel
getNextPublishSeqNo
in interface Channel
public boolean waitForConfirms() throws InterruptedException
Channel
waitForConfirms
in interface Channel
InterruptedException
public boolean waitForConfirms(long timeout) throws InterruptedException, TimeoutException
Channel
waitForConfirms
in interface Channel
InterruptedException
TimeoutException
public void waitForConfirmsOrDie() throws IOException, InterruptedException
Channel
waitForConfirmsOrDie
in interface Channel
IOException
InterruptedException
public void waitForConfirmsOrDie(long timeout) throws IOException, InterruptedException, TimeoutException
Channel
waitForConfirmsOrDie
in interface Channel
IOException
InterruptedException
TimeoutException
public void asyncRpc(Method method) throws IOException
Channel
asyncRpc
in interface Channel
method
- method to transmit over this channel.IOException
- Problem transmitting method.public Command rpc(Method method) throws IOException
Channel
rpc
in interface Channel
method
- method to transmit over this channel.IOException
- Problem transmitting method.public void addShutdownListener(ShutdownListener listener)
ShutdownNotifier
addShutdownListener
in interface ShutdownNotifier
listener
- ShutdownListener
to the componentShutdownNotifier.addShutdownListener(com.rabbitmq.client.ShutdownListener)
public void removeShutdownListener(ShutdownListener listener)
ShutdownNotifier
removeShutdownListener
in interface ShutdownNotifier
listener
- ShutdownListener
to be removedpublic ShutdownSignalException getCloseReason()
ShutdownNotifier
getCloseReason
in interface ShutdownNotifier
public void notifyListeners()
ShutdownNotifier
notifyListeners
in interface ShutdownNotifier
ShutdownListener
public boolean isOpen()
ShutdownNotifier
isOpen
in interface ShutdownNotifier
public void addRecoveryListener(RecoveryListener listener)
Recoverable
addRecoveryListener
in interface Recoverable
listener
- Callback functionpublic void removeRecoveryListener(RecoveryListener listener)
removeRecoveryListener
in interface Recoverable
public void automaticallyRecover(AutorecoveringConnection connection, Connection connDelegate) throws IOException
IOException
public void deleteRecordedConsumer(String consumerTag)
consumerTag
- consumer tag to deletepublic CompletableFuture<Command> asyncCompletableRpc(Method method) throws IOException
Channel
asyncCompletableRpc
in interface Channel
method
- method to transmit over this channel.IOException
- Problem transmitting method.Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.