public class ChannelN extends AMQChannel implements Channel
To open a channel,
Connection
conn = ...;ChannelN
ch1 = conn.createChannel
();
AMQChannel.BlockingRpcContinuation<T>, AMQChannel.RpcContinuation, AMQChannel.SimpleBlockingRpcContinuation
Modifier and Type | Field and Description |
---|---|
protected MetricsCollector |
metricsCollector |
_blockContent, _channelMutex, _rpcTimeout, NO_RPC_TIMEOUT
Constructor and Description |
---|
ChannelN(AMQConnection connection,
int channelNumber,
ConsumerWorkService workService)
Construct a new channel on the given connection with the given
channel number.
|
ChannelN(AMQConnection connection,
int channelNumber,
ConsumerWorkService workService,
MetricsCollector metricsCollector)
Construct a new channel on the given connection with the given
channel number.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Public API - Abort this channel with the
AMQP.REPLY_SUCCESS close code
and message 'OK'. |
void |
abort(int closeCode,
String closeMessage)
Public API - Abort this channel.
|
ConfirmListener |
addConfirmListener(ConfirmCallback ackCallback,
ConfirmCallback nackCallback)
Add a lambda-based
ConfirmListener . |
void |
addConfirmListener(ConfirmListener listener)
Add a
ConfirmListener . |
ReturnListener |
addReturnListener(ReturnCallback returnCallback)
Add a lambda-based
ReturnListener . |
void |
addReturnListener(ReturnListener listener)
Add a
ReturnListener . |
CompletableFuture<Command> |
asyncCompletableRpc(Method method)
Asynchronously send a method over this channel.
|
void |
asyncRpc(Method method)
Asynchronously send a method over this channel.
|
void |
basicAck(long deliveryTag,
boolean multiple)
Public API - Acknowledge one or several received
messages.
|
void |
basicCancel(String consumerTag)
Public API - Cancel a consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
Consumer callback)
Public API - Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag.
|
String |
basicConsume(String queue,
boolean autoAck,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Public API - 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)
Public API - Start a non-nolocal, non-exclusive consumer, with
a server-generated consumerTag.
|
String |
basicConsume(String queue,
boolean autoAck,
Map<String,Object> arguments,
Consumer callback)
Public API - 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)
Public API - 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)
Public API - 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)
Public API - 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)
Public API - Start a consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
boolean noLocal,
boolean exclusive,
Map<String,Object> arguments,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Public API - 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)
Public API - Start a consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
Consumer callback)
Public API - Start a non-nolocal, non-exclusive consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Public API - Start a non-nolocal, non-exclusive consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
DeliverCallback deliverCallback,
CancelCallback cancelCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Public API - Start a non-nolocal, non-exclusive consumer.
|
String |
basicConsume(String queue,
boolean autoAck,
String consumerTag,
DeliverCallback deliverCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Public API - Start a non-nolocal, non-exclusive consumer.
|
String |
basicConsume(String queue,
Consumer callback)
Public API - Start a non-nolocal, non-exclusive consumer, with
explicit acknowledgement and a server-generated consumerTag.
|
String |
basicConsume(String queue,
DeliverCallback deliverCallback,
CancelCallback cancelCallback)
Public API - 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)
Public API - Start a non-nolocal, non-exclusive consumer, with
explicit acknowledgement and a server-generated consumerTag.
|
String |
basicConsume(String queue,
DeliverCallback deliverCallback,
ConsumerShutdownSignalCallback shutdownSignalCallback)
Public API - Start a non-nolocal, non-exclusive consumer, with
explicit acknowledgement and a server-generated consumerTag.
|
GetResponse |
basicGet(String queue,
boolean autoAck)
Public API - Retrieve a message from a queue using
AMQP.Basic.Get |
void |
basicNack(long deliveryTag,
boolean multiple,
boolean requeue)
Public API - Reject one or several received messages.
|
void |
basicPublish(String exchange,
String routingKey,
AMQP.BasicProperties props,
byte[] body)
Public API - Publish a message.
|
void |
basicPublish(String exchange,
String routingKey,
boolean mandatory,
AMQP.BasicProperties props,
byte[] body)
Public API - Publish a message.
|
void |
basicPublish(String exchange,
String routingKey,
boolean mandatory,
boolean immediate,
AMQP.BasicProperties props,
byte[] body)
Public API - Publish a message.
|
void |
basicQos(int prefetchCount)
Public API - Request a specific prefetchCount "quality of service" settings
for this channel.
|
void |
basicQos(int prefetchCount,
boolean global)
Public API - Request a specific prefetchCount "quality of service" settings
for this channel.
|
void |
basicQos(int prefetchSize,
int prefetchCount,
boolean global)
Public API - Request specific "quality of service" settings.
|
AMQImpl.Basic.RecoverOk |
basicRecover()
Public API -
Ask the broker to resend unacknowledged messages.
|
AMQImpl.Basic.RecoverOk |
basicRecover(boolean requeue)
Public API - Ask the broker to resend unacknowledged messages.
|
void |
basicReject(long deliveryTag,
boolean requeue)
Public API - Reject a message.
|
void |
clearConfirmListeners()
Remove all
ConfirmListener s. |
void |
clearReturnListeners()
Remove all
ReturnListener s. |
void |
close()
Public API - Close this channel with the
AMQP.REPLY_SUCCESS close code
and message 'OK'. |
void |
close(int closeCode,
String closeMessage)
Public API - Close this channel.
|
protected void |
close(int closeCode,
String closeMessage,
boolean initiatedByApplication,
Throwable cause,
boolean abort)
Protected API - Close channel with code and message, indicating
the source of the closure and a causing exception (null if
none).
|
AMQImpl.Confirm.SelectOk |
confirmSelect()
Public API - Enables publisher acknowledgements on this channel.
|
long |
consumerCount(String queue)
Public API - Returns the number of consumers on a queue.
|
void |
enqueueRpc(AMQChannel.RpcContinuation k) |
AMQImpl.Exchange.BindOk |
exchangeBind(String destination,
String source,
String routingKey)
Public API - Bind an exchange to an exchange, with no extra arguments.
|
AMQImpl.Exchange.BindOk |
exchangeBind(String destination,
String source,
String routingKey,
Map<String,Object> arguments)
Public API - Bind an exchange to an exchange.
|
void |
exchangeBindNoWait(String destination,
String source,
String routingKey,
Map<String,Object> arguments)
Public API - 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). |
AMQImpl.Exchange.DeclareOk |
exchangeDeclare(String exchange,
BuiltinExchangeType type)
Public API - Actively declare a non-autodelete, non-durable exchange with no extra arguments
|
AMQImpl.Exchange.DeclareOk |
exchangeDeclare(String exchange,
BuiltinExchangeType type,
boolean durable)
Public API - Actively declare a non-autodelete exchange with no extra arguments
|
AMQImpl.Exchange.DeclareOk |
exchangeDeclare(String exchange,
BuiltinExchangeType type,
boolean durable,
boolean autoDelete,
boolean internal,
Map<String,Object> arguments)
Public API - Declare an exchange, via an interface that allows the complete set of
arguments.
|
AMQImpl.Exchange.DeclareOk |
exchangeDeclare(String exchange,
BuiltinExchangeType type,
boolean durable,
boolean autoDelete,
Map<String,Object> arguments)
Public API - Declare an exchange.
|
AMQImpl.Exchange.DeclareOk |
exchangeDeclare(String exchange,
String type)
Public API - Actively declare a non-autodelete, non-durable exchange with no extra arguments
|
AMQImpl.Exchange.DeclareOk |
exchangeDeclare(String exchange,
String type,
boolean durable)
Public API - Actively declare a non-autodelete exchange with no extra arguments
|
AMQImpl.Exchange.DeclareOk |
exchangeDeclare(String exchange,
String type,
boolean durable,
boolean autoDelete,
boolean internal,
Map<String,Object> arguments)
Public API - Declare an exchange, via an interface that allows the complete set of
arguments.
|
AMQImpl.Exchange.DeclareOk |
exchangeDeclare(String exchange,
String type,
boolean durable,
boolean autoDelete,
Map<String,Object> arguments)
Public API - 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). |
AMQImpl.Exchange.DeclareOk |
exchangeDeclarePassive(String exchange)
Public API - Declare an exchange passively; that is, check if the named exchange exists.
|
AMQImpl.Exchange.DeleteOk |
exchangeDelete(String exchange)
Public API - Delete an exchange, without regard for whether it is in use or not
|
AMQImpl.Exchange.DeleteOk |
exchangeDelete(String exchange,
boolean ifUnused)
Public API - Delete an exchange
|
void |
exchangeDeleteNoWait(String exchange,
boolean ifUnused)
Public API - Like
Channel.exchangeDelete(String, boolean) but sets nowait parameter to true
and returns void (as there will be no response from the server). |
AMQImpl.Exchange.UnbindOk |
exchangeUnbind(String destination,
String source,
String routingKey)
Public API - Unbind an exchange from an exchange, with no extra arguments.
|
AMQImpl.Exchange.UnbindOk |
exchangeUnbind(String destination,
String source,
String routingKey,
Map<String,Object> arguments)
Public API - Unbind an exchange from an exchange.
|
void |
exchangeUnbindNoWait(String destination,
String source,
String routingKey,
Map<String,Object> arguments)
Public API - 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). |
Consumer |
getDefaultConsumer()
Returns the current default consumer.
|
long |
getNextPublishSeqNo()
Public API - When in confirm mode, returns the sequence number of the next
message to be published.
|
protected void |
markRpcFinished() |
long |
messageCount(String queue)
Public API - Returns the number of messages in a queue ready to be delivered
to consumers.
|
void |
open()
Package method: open the channel.
|
boolean |
processAsync(Command command)
Protected API - Filters the inbound command stream, processing
Basic.Deliver, Basic.Return and Channel.Close specially.
|
protected void |
processDelivery(Command command,
AMQImpl.Basic.Deliver method) |
void |
processShutdownSignal(ShutdownSignalException signal,
boolean ignoreClosed,
boolean notifyRpc)
Protected API - overridden to quiesce consumer work and broadcast the signal
to all consumers after calling the superclass's method.
|
AMQImpl.Queue.BindOk |
queueBind(String queue,
String exchange,
String routingKey)
Public API - Bind a queue to an exchange, with no extra arguments.
|
AMQImpl.Queue.BindOk |
queueBind(String queue,
String exchange,
String routingKey,
Map<String,Object> arguments)
Public API - Bind a queue to an exchange.
|
void |
queueBindNoWait(String queue,
String exchange,
String routingKey,
Map<String,Object> arguments)
Public API - 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()
Public API - Actively declare a server-named exclusive, autodelete, non-durable queue.
|
AMQImpl.Queue.DeclareOk |
queueDeclare(String queue,
boolean durable,
boolean exclusive,
boolean autoDelete,
Map<String,Object> arguments)
Public API - Declare a queue
|
void |
queueDeclareNoWait(String queue,
boolean durable,
boolean exclusive,
boolean autoDelete,
Map<String,Object> arguments)
Public API - 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). |
AMQImpl.Queue.DeclareOk |
queueDeclarePassive(String queue)
Public API - Declare a queue passively; i.e., check if it exists.
|
AMQImpl.Queue.DeleteOk |
queueDelete(String queue)
Public API - Delete a queue, without regard for whether it is in use or has messages on it
|
AMQImpl.Queue.DeleteOk |
queueDelete(String queue,
boolean ifUnused,
boolean ifEmpty)
Public API - 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). |
AMQImpl.Queue.PurgeOk |
queuePurge(String queue)
Public API - Purges the contents of the given queue.
|
AMQImpl.Queue.UnbindOk |
queueUnbind(String queue,
String exchange,
String routingKey)
Public API - Unbinds a queue from an exchange, with no extra arguments.
|
AMQImpl.Queue.UnbindOk |
queueUnbind(String queue,
String exchange,
String routingKey,
Map<String,Object> arguments)
Public API - Unbind a queue from an exchange.
|
boolean |
removeConfirmListener(ConfirmListener listener)
Remove a
ConfirmListener . |
boolean |
removeReturnListener(ReturnListener listener)
Remove a
ReturnListener . |
AMQCommand |
rpc(Method method)
Protected API - sends a
Method to the broker and waits for the
next in-bound Command from the broker: only for use from
non-connection-MainLoop threads! |
void |
setDefaultConsumer(Consumer consumer)
Sets the current default consumer.
|
AMQImpl.Tx.CommitOk |
txCommit()
Public API - Commits a TX transaction on this channel.
|
AMQImpl.Tx.RollbackOk |
txRollback()
Public API - Rolls back a TX transaction on this channel.
|
AMQImpl.Tx.SelectOk |
txSelect()
Public API - Enables TX mode on this channel.
|
boolean |
waitForConfirms()
Wait until all messages published since the last call have been
either ack'd or nack'd by the broker.
|
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.
|
asyncRpc, enqueueAsyncRpc, ensureIsOpen, exnWrappingAsyncRpc, exnWrappingRpc, getChannelNumber, getConnection, handleCompleteInboundCommand, handleFrame, isOutstandingRpc, nextOutstandingRpc, notifyOutstandingRpc, quiescingAsyncRpc, quiescingRpc, quiescingTransmit, quiescingTransmit, rpc, rpc, toString, transmit, transmit, wrap, wrap, wrapTimeoutException
addShutdownListener, getCloseReason, isOpen, notifyListeners, removeShutdownListener, setShutdownCauseIfOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChannelNumber, getConnection
addShutdownListener, getCloseReason, isOpen, notifyListeners, removeShutdownListener
protected final MetricsCollector metricsCollector
public ChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService)
connection
- The connection associated with this channelchannelNumber
- The channel number to be associated with this channelworkService
- service for managing this channel's consumer callbacksConnection.createChannel()
public ChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService, MetricsCollector metricsCollector)
connection
- The connection associated with this channelchannelNumber
- The channel number to be associated with this channelworkService
- service for managing this channel's consumer callbacksmetricsCollector
- service for managing metricsConnection.createChannel()
public void open() throws IOException
ChannelManager
.IOException
- if any problem is encounteredpublic 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 boolean waitForConfirms() throws InterruptedException
waitForConfirms
in interface Channel
InterruptedException
public boolean waitForConfirms(long timeout) throws InterruptedException, TimeoutException
waitForConfirms
in interface Channel
InterruptedException
TimeoutException
public void waitForConfirmsOrDie() throws IOException, InterruptedException
waitForConfirmsOrDie
in interface Channel
IOException
InterruptedException
public void waitForConfirmsOrDie(long timeout) throws IOException, InterruptedException, TimeoutException
waitForConfirmsOrDie
in interface Channel
IOException
InterruptedException
TimeoutException
public Consumer getDefaultConsumer()
getDefaultConsumer
in interface Channel
public void setDefaultConsumer(Consumer consumer)
setDefaultConsumer
in interface Channel
consumer
- the consumer to use, or null indicating "don't use one".public void processShutdownSignal(ShutdownSignalException signal, boolean ignoreClosed, boolean notifyRpc)
processShutdownSignal
in class AMQChannel
signal
- the signal to handleignoreClosed
- the flag indicating whether to ignore the AlreadyClosedException
thrown when the channel is already closednotifyRpc
- the flag indicating whether any remaining rpc continuation should be
notified with the given signalpublic boolean processAsync(Command command) throws IOException
processAsync
in class AMQChannel
command
- the command to handle asynchronouslyIOException
protected void processDelivery(Command command, AMQImpl.Basic.Deliver method)
public void close() throws IOException, TimeoutException
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
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
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
abort
in interface Channel
IOException
protected void close(int closeCode, String closeMessage, boolean initiatedByApplication, Throwable cause, boolean abort) throws IOException, TimeoutException
closeCode
- the close code (See under "Reply Codes" in the AMQP specification)closeMessage
- a message indicating the reason for closing the connectioninitiatedByApplication
- true if this comes from an API call, false otherwisecause
- exception triggering closeabort
- true if we should close and ignore errorsIOException
- if an error is encounteredTimeoutException
public void basicQos(int prefetchSize, int prefetchCount, boolean global) throws IOException
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, boolean global) throws IOException
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 basicQos(int prefetchCount) throws IOException
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 basicPublish(String exchange, String routingKey, AMQP.BasicProperties props, byte[] body) throws IOException
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#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#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 AMQImpl.Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable, boolean autoDelete, Map<String,Object> arguments) throws IOException
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 AMQImpl.Exchange.DeclareOk exchangeDeclare(String exchange, BuiltinExchangeType type, boolean durable, boolean autoDelete, Map<String,Object> arguments) throws IOException
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 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 AMQImpl.Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable, boolean autoDelete, boolean internal, Map<String,Object> arguments) throws IOException
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 AMQImpl.Exchange.DeclareOk exchangeDeclare(String exchange, BuiltinExchangeType type, boolean durable, boolean autoDelete, boolean internal, Map<String,Object> arguments) throws IOException
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 AMQImpl.Exchange.DeclareOk exchangeDeclare(String exchange, String type, boolean durable) throws IOException
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 AMQImpl.Exchange.DeclareOk exchangeDeclare(String exchange, BuiltinExchangeType type, boolean durable) throws IOException
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 AMQImpl.Exchange.DeclareOk exchangeDeclare(String exchange, String type) throws IOException
exchangeDeclare
in interface Channel
exchange
- the name of the exchangetype
- the exchange typeIOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQImpl.Exchange.DeclareOk exchangeDeclare(String exchange, BuiltinExchangeType type) throws IOException
exchangeDeclare
in interface Channel
exchange
- the name of the exchangetype
- the exchange typeIOException
- if an error is encounteredAMQP.Exchange.Declare
,
AMQP.Exchange.DeclareOk
public AMQImpl.Exchange.DeclareOk exchangeDeclarePassive(String exchange) throws IOException
exchangeDeclarePassive
in interface Channel
exchange
- check the existence of an exchange named thisIOException
- the server will raise a 404 channel exception if the named exchange does not exist.public AMQImpl.Exchange.DeleteOk exchangeDelete(String exchange, boolean ifUnused) throws IOException
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.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 AMQImpl.Exchange.DeleteOk exchangeDelete(String exchange) throws IOException
exchangeDelete
in interface Channel
exchange
- the name of the exchangeIOException
- if an error is encounteredAMQP.Exchange.Delete
,
AMQP.Exchange.DeleteOk
public AMQImpl.Exchange.BindOk exchangeBind(String destination, String source, String routingKey, Map<String,Object> arguments) throws IOException
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.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 AMQImpl.Exchange.BindOk exchangeBind(String destination, String source, String routingKey) throws IOException
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 AMQImpl.Exchange.UnbindOk exchangeUnbind(String destination, String source, String routingKey, Map<String,Object> arguments) throws IOException
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 AMQImpl.Exchange.UnbindOk exchangeUnbind(String destination, String source, String routingKey) throws IOException
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 void exchangeUnbindNoWait(String destination, String source, String routingKey, Map<String,Object> arguments) throws IOException
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 AMQImpl.Queue.DeclareOk queueDeclare(String queue, boolean durable, boolean exclusive, boolean autoDelete, Map<String,Object> arguments) throws IOException
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 AMQP.Queue.DeclareOk queueDeclare() throws IOException
AMQP.Queue.DeclareOk
result.queueDeclare
in interface Channel
IOException
- 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.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 AMQImpl.Queue.DeclareOk queueDeclarePassive(String queue) throws IOException
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
messageCount
in interface Channel
queue
- the name of the queueIOException
- Problem transmitting method.public long consumerCount(String queue) throws IOException
consumerCount
in interface Channel
queue
- the name of the queueIOException
- Problem transmitting method.public AMQImpl.Queue.DeleteOk queueDelete(String queue, boolean ifUnused, boolean ifEmpty) throws IOException
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 AMQImpl.Queue.DeleteOk queueDelete(String queue) throws IOException
queueDelete
in interface Channel
queue
- the name of the queueIOException
- if an error is encounteredAMQP.Queue.Delete
,
AMQP.Queue.DeleteOk
public AMQImpl.Queue.BindOk queueBind(String queue, String exchange, String routingKey, Map<String,Object> arguments) throws IOException
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 AMQImpl.Queue.BindOk queueBind(String queue, String exchange, String routingKey) throws IOException
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 void queueBindNoWait(String queue, String exchange, String routingKey, Map<String,Object> arguments) throws IOException
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 AMQImpl.Queue.UnbindOk queueUnbind(String queue, String exchange, String routingKey, Map<String,Object> arguments) throws IOException
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 AMQImpl.Queue.PurgeOk queuePurge(String queue) throws IOException
queuePurge
in interface Channel
queue
- the name of the queueIOException
- if an error is encounteredAMQP.Queue.Purge
,
AMQP.Queue.PurgeOk
public AMQImpl.Queue.UnbindOk queueUnbind(String queue, String exchange, String routingKey) throws IOException
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 GetResponse basicGet(String queue, boolean autoAck) throws IOException
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
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
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
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
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
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
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
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
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, ConsumerShutdownSignalCallback shutdownSignalCallback) throws IOException
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) throws IOException
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, 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, Map<String,Object> arguments, Consumer callback) throws IOException
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
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
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
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, Consumer callback) throws IOException
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
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
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
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, String consumerTag, boolean noLocal, boolean exclusive, Map<String,Object> arguments, DeliverCallback deliverCallback, CancelCallback cancelCallback) throws IOException
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
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 String basicConsume(String queue, boolean autoAck, String consumerTag, boolean noLocal, boolean exclusive, Map<String,Object> arguments, Consumer callback) throws IOException
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 void basicCancel(String consumerTag) throws IOException
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 AMQImpl.Basic.RecoverOk basicRecover() throws IOException
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 AMQImpl.Basic.RecoverOk basicRecover(boolean requeue) throws IOException
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 AMQImpl.Tx.SelectOk txSelect() throws IOException
txSelect
in interface Channel
IOException
- if an error is encounteredAMQP.Tx.Select
,
AMQP.Tx.SelectOk
public AMQImpl.Tx.CommitOk txCommit() throws IOException
txCommit
in interface Channel
IOException
- if an error is encounteredAMQP.Tx.Commit
,
AMQP.Tx.CommitOk
public AMQImpl.Tx.RollbackOk txRollback() throws IOException
txRollback
in interface Channel
IOException
- if an error is encounteredAMQP.Tx.Rollback
,
AMQP.Tx.RollbackOk
public AMQImpl.Confirm.SelectOk confirmSelect() throws IOException
confirmSelect
in interface Channel
IOException
- if an error is encounteredAMQP.Confirm.Select
public long getNextPublishSeqNo()
getNextPublishSeqNo
in interface Channel
public void asyncRpc(Method method) throws IOException
Channel
asyncRpc
in interface Channel
method
- method to transmit over this channel.IOException
- Problem transmitting method.public AMQCommand rpc(Method method) throws IOException
AMQChannel
Method
to the broker and waits for the
next in-bound Command from the broker: only for use from
non-connection-MainLoop threads!rpc
in interface Channel
rpc
in class AMQChannel
method
- method to transmit over this channel.IOException
- Problem transmitting method.public CompletableFuture<Command> asyncCompletableRpc(Method method) throws IOException
Channel
asyncCompletableRpc
in interface Channel
method
- method to transmit over this channel.IOException
- Problem transmitting method.public void enqueueRpc(AMQChannel.RpcContinuation k)
enqueueRpc
in class AMQChannel
protected void markRpcFinished()
markRpcFinished
in class AMQChannel
Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.