Package com.microsoft.azure.servicebus
Class QueueClient
- java.lang.Object
-
- com.microsoft.azure.servicebus.primitives.ClientEntity
-
- com.microsoft.azure.servicebus.QueueClient
-
- All Implemented Interfaces:
ICloseable
,IMessageAndSessionPump
,IMessageEntityClient
,IMessageSender
,IQueueClient
public final class QueueClient extends ClientEntity implements IQueueClient
-
-
Constructor Summary
Constructors Constructor Description QueueClient(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode)
QueueClient(String namespace, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode)
QueueClient(URI namespaceEndpointURI, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
abandon(UUID lockToken)
AbandonMessage
with lock token.void
abandon(UUID lockToken, TransactionContext transaction)
AbandonMessage
with lock token.void
abandon(UUID lockToken, Map<String,Object> propertiesToModify)
AbandonMessage
with lock token and updated message property.void
abandon(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)
AbandonMessage
with lock token and updated message property.CompletableFuture<Void>
abandonAsync(UUID lockToken)
Asynchronously abandonMessage
with lock token.CompletableFuture<Void>
abandonAsync(UUID lockToken, TransactionContext transaction)
Asynchronously abandonMessage
with lock token.CompletableFuture<Void>
abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify)
Asynchronously abandonMessage
with lock token and updated message property.CompletableFuture<Void>
abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)
Asynchronously abandonMessage
with lock token and updated message property.void
cancelScheduledMessage(long sequenceNumber)
Cancels the enqueuing of an already sent scheduled message, if it was not already enqueued.CompletableFuture<Void>
cancelScheduledMessageAsync(long sequenceNumber)
Cancels the enqueuing of an already sent scheduled message, if it was not already enqueued.void
complete(UUID lockToken)
Completes aMessage
using its lock token.void
complete(UUID lockToken, TransactionContext transaction)
Completes aMessage
using its lock token.CompletableFuture<Void>
completeAsync(UUID lockToken)
Asynchronously completes aMessage
using its lock token.CompletableFuture<Void>
completeAsync(UUID lockToken, TransactionContext transaction)
Asynchronously completes aMessage
using its lock token.void
deadLetter(UUID lockToken)
Moves aMessage
to the deadletter sub-queue.void
deadLetter(UUID lockToken, TransactionContext transaction)
Moves aMessage
to the deadletter sub-queue.void
deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Moves aMessage
to the deadletter sub-queue with deadletter reason and error description.void
deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)
Moves aMessage
to the deadletter sub-queue with deadletter reason and error description.void
deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify)
Moves aMessage
to the deadletter sub-queue with deadletter reason and error description and modified properties.void
deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction)
Moves aMessage
to the deadletter sub-queue with deadletter reason and error description and modified properties.void
deadLetter(UUID lockToken, Map<String,Object> propertiesToModify)
Moves aMessage
to the deadletter sub-queue with modified message properties.void
deadLetter(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)
Moves aMessage
to the deadletter sub-queue with modified message properties.CompletableFuture<Void>
deadLetterAsync(UUID lockToken)
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter.CompletableFuture<Void>
deadLetterAsync(UUID lockToken, TransactionContext transaction)
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter.CompletableFuture<Void>
deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter reason and error description.CompletableFuture<Void>
deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter reason and error description.CompletableFuture<Void>
deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify)
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter reason and error description and modified properties.CompletableFuture<Void>
deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction)
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter reason and error description and modified properties.CompletableFuture<Void>
deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify)
Asynchronously moves aMessage
to the deadletter sub-queue with modified properties.CompletableFuture<Void>
deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)
Asynchronously moves aMessage
to the deadletter sub-queue with modified properties.String
getEntityPath()
Gets the path of the entity this client is sending messages to or receiving messages from.int
getPrefetchCount()
Get the prefetch value set.String
getQueueName()
Gets the name of the queue.ReceiveMode
getReceiveMode()
Gets theReceiveMode
of the current receiverprotected CompletableFuture<Void>
onClose()
void
registerMessageHandler(IMessageHandler handler)
Deprecated.void
registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions)
Deprecated.void
registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService)
Receive messages continuously from the entity.void
registerMessageHandler(IMessageHandler handler, ExecutorService executorService)
Receive messages continuously from the entity.void
registerSessionHandler(ISessionHandler handler)
Deprecated.void
registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions)
Deprecated.void
registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions, ExecutorService executorService)
Receive session messages continuously from the queue.void
registerSessionHandler(ISessionHandler handler, ExecutorService executorService)
Receive session messages continuously from the queue.long
scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to.long
scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to.CompletableFuture<Long>
scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to.CompletableFuture<Long>
scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction)
Sends a scheduled message to the Azure Service Bus entity this sender is connected to.void
send(IMessage message)
Sends a message to the Azure Service Bus entity this sender is connected to.void
send(IMessage message, TransactionContext transaction)
Sends a message to the Azure Service Bus entity this sender is connected to.CompletableFuture<Void>
sendAsync(IMessage message)
Sends a message to the Azure Service Bus entity this sender is connected to.CompletableFuture<Void>
sendAsync(IMessage message, TransactionContext transaction)
Sends a message to the Azure Service Bus entity this sender is connected to.void
sendBatch(Collection<? extends IMessage> messages)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to.void
sendBatch(Collection<? extends IMessage> messages, TransactionContext transaction)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to.CompletableFuture<Void>
sendBatchAsync(Collection<? extends IMessage> messages)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to.CompletableFuture<Void>
sendBatchAsync(Collection<? extends IMessage> messages, TransactionContext transaction)
Sends a batch of messages to the Azure Service Bus entity this sender is connected to.void
setPrefetchCount(int prefetchCount)
Set the prefetch count of the receiver.-
Methods inherited from class com.microsoft.azure.servicebus.primitives.ClientEntity
close, closeAsync, finalize, getClientId, getIsClosed, getIsClosingOrClosed, setClosed, setClosing, throwIfClosed
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microsoft.azure.servicebus.ICloseable
close, closeAsync
-
-
-
-
Constructor Detail
-
QueueClient
public QueueClient(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
-
QueueClient
public QueueClient(String namespace, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
-
QueueClient
public QueueClient(URI namespaceEndpointURI, String queuePath, ClientSettings clientSettings, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
-
-
Method Detail
-
getReceiveMode
public ReceiveMode getReceiveMode()
Description copied from interface:IQueueClient
Gets theReceiveMode
of the current receiver- Specified by:
getReceiveMode
in interfaceIQueueClient
- Returns:
- The receive mode.
-
send
public void send(IMessage message) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageSender
Sends a message to the Azure Service Bus entity this sender is connected to. This method blocks until the message is sent to the entity. Calling this method is equivalent to callingsendAsync(message).get()
. For better performance, use async methods.- Specified by:
send
in interfaceIMessageSender
- Parameters:
message
- message to be sent to the entity- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if message couldn't be sent to the entity
-
send
public void send(IMessage message, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageSender
Sends a message to the Azure Service Bus entity this sender is connected to. This method blocks until the message is sent to the entity. Calling this method is equivalent to callingsendAsync(message).get()
. For better performance, use async methods.- Specified by:
send
in interfaceIMessageSender
- Parameters:
message
- message to be sent to the entitytransaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if message couldn't be sent to the entity
-
sendBatch
public void sendBatch(Collection<? extends IMessage> messages) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageSender
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. This method blocks until the batch is sent to the entity. Calling this method is equivalent to callingsendBatchAsync(messages).get()
. For better performance, use async methods. When called on partitioned entities, messages meant for different partitions cannot be batched together.- Specified by:
sendBatch
in interfaceIMessageSender
- Parameters:
messages
- collection of messages to be sent to the entity- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the batch couldn't be sent to the entity
-
sendBatch
public void sendBatch(Collection<? extends IMessage> messages, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageSender
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. This method blocks until the batch is sent to the entity. Calling this method is equivalent to callingsendBatchAsync(messages).get()
. For better performance, use async methods. When called on partitioned entities, messages meant for different partitions cannot be batched together.- Specified by:
sendBatch
in interfaceIMessageSender
- Parameters:
messages
- collection of messages to be sent to the entitytransaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if the batch couldn't be sent to the entity
-
sendAsync
public CompletableFuture<Void> sendAsync(IMessage message)
Description copied from interface:IMessageSender
Sends a message to the Azure Service Bus entity this sender is connected to. This is an asynchronous method returning a CompletableFuture which completes when the message is sent to the entity.- Specified by:
sendAsync
in interfaceIMessageSender
- Parameters:
message
- message to be sent to the entity- Returns:
- a CompletableFuture representing the pending send
-
sendAsync
public CompletableFuture<Void> sendAsync(IMessage message, TransactionContext transaction)
Description copied from interface:IMessageSender
Sends a message to the Azure Service Bus entity this sender is connected to. This is an asynchronous method returning a CompletableFuture which completes when the message is sent to the entity.- Specified by:
sendAsync
in interfaceIMessageSender
- Parameters:
message
- message to be sent to the entitytransaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending send
-
sendBatchAsync
public CompletableFuture<Void> sendBatchAsync(Collection<? extends IMessage> messages)
Description copied from interface:IMessageSender
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. This is an asynchronous method returning a CompletableFuture which completes when the batch is sent to the entity. When called on partitioned entities, messages meant for different partitions cannot be batched together.- Specified by:
sendBatchAsync
in interfaceIMessageSender
- Parameters:
messages
- collection of messages to be sent to the entity- Returns:
- a CompletableFuture representing the pending send
-
sendBatchAsync
public CompletableFuture<Void> sendBatchAsync(Collection<? extends IMessage> messages, TransactionContext transaction)
Description copied from interface:IMessageSender
Sends a batch of messages to the Azure Service Bus entity this sender is connected to. This is an asynchronous method returning a CompletableFuture which completes when the batch is sent to the entity. When called on partitioned entities, messages meant for different partitions cannot be batched together.- Specified by:
sendBatchAsync
in interfaceIMessageSender
- Parameters:
messages
- collection of messages to be sent to the entitytransaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending send
-
scheduleMessageAsync
public CompletableFuture<Long> scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc)
Description copied from interface:IMessageSender
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. A scheduled message is enqueued and made available to receivers only at the scheduled enqueue time. This is an asynchronous method returning a CompletableFuture which completes when the message is sent to the entity. The CompletableFuture, on completion, returns the sequence number of the scheduled message which can be used to cancel the scheduling of the message.- Specified by:
scheduleMessageAsync
in interfaceIMessageSender
- Parameters:
message
- message to be sent to the entityscheduledEnqueueTimeUtc
- instant at which the message should be enqueued in the entity- Returns:
- a CompletableFuture representing the pending send, which returns the sequence number of the scheduled message. This sequence number can be used to cancel the scheduling of the message.
-
scheduleMessageAsync
public CompletableFuture<Long> scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction)
Description copied from interface:IMessageSender
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. A scheduled message is enqueued and made available to receivers only at the scheduled enqueue time. This is an asynchronous method returning a CompletableFuture which completes when the message is sent to the entity. The CompletableFuture, on completion, returns the sequence number of the scheduled message which can be used to cancel the scheduling of the message.- Specified by:
scheduleMessageAsync
in interfaceIMessageSender
- Parameters:
message
- message to be sent to the entityscheduledEnqueueTimeUtc
- instant at which the message should be enqueued in the entitytransaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending send, which returns the sequence number of the scheduled message. This sequence number can be used to cancel the scheduling of the message.
-
cancelScheduledMessageAsync
public CompletableFuture<Void> cancelScheduledMessageAsync(long sequenceNumber)
Description copied from interface:IMessageSender
Cancels the enqueuing of an already sent scheduled message, if it was not already enqueued. This is an asynchronous method returning a CompletableFuture which completes when the message is cancelled.- Specified by:
cancelScheduledMessageAsync
in interfaceIMessageSender
- Parameters:
sequenceNumber
- sequence number of the scheduled message- Returns:
- a CompletableFuture representing the pending cancellation
-
scheduleMessage
public long scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageSender
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. A scheduled message is enqueued and made available to receivers only at the scheduled enqueue time. This method blocks until the message is sent to the entity. Calling this method is equivalent to callingscheduleMessageAsync(message, scheduledEnqueueTimeUtc).get()
. For better performance, use async methods.- Specified by:
scheduleMessage
in interfaceIMessageSender
- Parameters:
message
- message to be sent to the entityscheduledEnqueueTimeUtc
- instant at which the message should be enqueued in the entity- Returns:
- sequence number of the scheduled message
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if message couldn't be sent to the entity
-
scheduleMessage
public long scheduleMessage(IMessage message, Instant scheduledEnqueueTimeUtc, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageSender
Sends a scheduled message to the Azure Service Bus entity this sender is connected to. A scheduled message is enqueued and made available to receivers only at the scheduled enqueue time. This method blocks until the message is sent to the entity. Calling this method is equivalent to callingscheduleMessageAsync(message, scheduledEnqueueTimeUtc).get()
. For better performance, use async methods.- Specified by:
scheduleMessage
in interfaceIMessageSender
- Parameters:
message
- message to be sent to the entityscheduledEnqueueTimeUtc
- instant at which the message should be enqueued in the entitytransaction
-TransactionContext
which this operation should enlist to.- Returns:
- sequence number of the scheduled message
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if message couldn't be sent to the entity
-
cancelScheduledMessage
public void cancelScheduledMessage(long sequenceNumber) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageSender
Cancels the enqueuing of an already sent scheduled message, if it was not already enqueued. This method blocks until the message is sent to the entity. Calling this method is equivalent to callingcancelScheduledMessageAsync(sequenceNumber).get()
. For better performance, use async methods.- Specified by:
cancelScheduledMessage
in interfaceIMessageSender
- Parameters:
sequenceNumber
- sequence number of the scheduled message- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if scheduled message couldn't be cancelled
-
getEntityPath
public String getEntityPath()
Description copied from interface:IMessageEntityClient
Gets the path of the entity this client is sending messages to or receiving messages from.- Specified by:
getEntityPath
in interfaceIMessageEntityClient
- Returns:
- path of the entity this client is connecting to
-
registerMessageHandler
@Deprecated public void registerMessageHandler(IMessageHandler handler) throws InterruptedException, ServiceBusException
Deprecated.Description copied from interface:IMessageAndSessionPump
Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. IMessageHandler methods are executed on java.util.concurrent.commonPool()- Specified by:
registerMessageHandler
in interfaceIMessageAndSessionPump
- Parameters:
handler
- TheIMessageHandler
instance- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
registerMessageHandler
@Deprecated public void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions) throws InterruptedException, ServiceBusException
Deprecated.Description copied from interface:IMessageAndSessionPump
Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. IMessageHandler methods are executed on java.util.concurrent.commonPool()- Specified by:
registerMessageHandler
in interfaceIMessageAndSessionPump
- Parameters:
handler
- TheIMessageHandler
instancehandlerOptions
-MessageHandlerOptions
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
registerSessionHandler
@Deprecated public void registerSessionHandler(ISessionHandler handler) throws InterruptedException, ServiceBusException
Deprecated.Description copied from interface:IMessageAndSessionPump
Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. ISessionHandler methods are executed on java.util.concurrent.commonPool()- Specified by:
registerSessionHandler
in interfaceIMessageAndSessionPump
- Parameters:
handler
- TheISessionHandler
instance- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
registerSessionHandler
@Deprecated public void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions) throws InterruptedException, ServiceBusException
Deprecated.Description copied from interface:IMessageAndSessionPump
Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. ISessionHandler methods are executed on java.util.concurrent.commonPool()- Specified by:
registerSessionHandler
in interfaceIMessageAndSessionPump
- Parameters:
handler
- TheISessionHandler
instancehandlerOptions
-SessionHandlerOptions
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
registerMessageHandler
public void registerMessageHandler(IMessageHandler handler, ExecutorService executorService) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. IMessageHandler methods are executed on the passed executor service.- Specified by:
registerMessageHandler
in interfaceIMessageAndSessionPump
- Parameters:
handler
- TheIMessageHandler
instanceexecutorService
- ExecutorService which is used to executeIMessageHandler
methods.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
registerMessageHandler
public void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Receive messages continuously from the entity. Registers a message handler and begins a new thread to receive messages. IMessageHandler methods are executed on the passed executor service.- Specified by:
registerMessageHandler
in interfaceIMessageAndSessionPump
- Parameters:
handler
- TheIMessageHandler
instancehandlerOptions
-MessageHandlerOptions
executorService
- ExecutorService which is used to executeIMessageHandler
methods- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
registerSessionHandler
public void registerSessionHandler(ISessionHandler handler, ExecutorService executorService) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. ISessionHandler methods are executed on the passed executor service.- Specified by:
registerSessionHandler
in interfaceIMessageAndSessionPump
- Parameters:
handler
- TheISessionHandler
instanceexecutorService
- ExecutorService which is used to executeISessionHandler
methods- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
registerSessionHandler
public void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions, ExecutorService executorService) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. ISessionHandler methods are executed on the passed executor service.- Specified by:
registerSessionHandler
in interfaceIMessageAndSessionPump
- Parameters:
handler
- TheISessionHandler
instancehandlerOptions
-SessionHandlerOptions
executorService
- ExecutorService which is used to executeISessionHandler
methods- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
onClose
protected CompletableFuture<Void> onClose()
- Specified by:
onClose
in classClientEntity
-
abandon
public void abandon(UUID lockToken) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
AbandonMessage
with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message- Specified by:
abandon
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if abandon failed
-
abandon
public void abandon(UUID lockToken, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
AbandonMessage
with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message- Specified by:
abandon
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if abandon failed
-
abandon
public void abandon(UUID lockToken, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
AbandonMessage
with lock token and updated message property. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message- Specified by:
abandon
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
propertiesToModify
- Message properties to modify.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if abandon failed
-
abandon
public void abandon(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
AbandonMessage
with lock token and updated message property. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message- Specified by:
abandon
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
propertiesToModify
- Message properties to modify.transaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if abandon failed
-
abandonAsync
public CompletableFuture<Void> abandonAsync(UUID lockToken)
Description copied from interface:IMessageAndSessionPump
Asynchronously abandonMessage
with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.- Specified by:
abandonAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
- Returns:
- a CompletableFuture representing the pending abandon.
-
abandonAsync
public CompletableFuture<Void> abandonAsync(UUID lockToken, TransactionContext transaction)
Description copied from interface:IMessageAndSessionPump
Asynchronously abandonMessage
with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.- Specified by:
abandonAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending abandon.
-
abandonAsync
public CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify)
Description copied from interface:IMessageAndSessionPump
Asynchronously abandonMessage
with lock token and updated message property. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.- Specified by:
abandonAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
propertiesToModify
- Message properties to modify.- Returns:
- a CompletableFuture representing the pending abandon.
-
abandonAsync
public CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)
Description copied from interface:IMessageAndSessionPump
Asynchronously abandonMessage
with lock token and updated message property. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.- Specified by:
abandonAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
propertiesToModify
- Message properties to modify.transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending abandon.
-
complete
public void complete(UUID lockToken) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Completes aMessage
using its lock token. This will delete the message from the service.- Specified by:
complete
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if abandon failed
-
complete
public void complete(UUID lockToken, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Completes aMessage
using its lock token. This will delete the message from the service.- Specified by:
complete
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if abandon failed
-
completeAsync
public CompletableFuture<Void> completeAsync(UUID lockToken)
Description copied from interface:IMessageAndSessionPump
Asynchronously completes aMessage
using its lock token. This will delete the message from the service.- Specified by:
completeAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
- Returns:
- a CompletableFuture representing the pending complete.
-
completeAsync
public CompletableFuture<Void> completeAsync(UUID lockToken, TransactionContext transaction)
Description copied from interface:IMessageAndSessionPump
Asynchronously completes aMessage
using its lock token. This will delete the message from the service.- Specified by:
completeAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending complete.
-
deadLetter
public void deadLetter(UUID lockToken) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Moves aMessage
to the deadletter sub-queue.- Specified by:
deadLetter
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if deadletter failed
-
deadLetter
public void deadLetter(UUID lockToken, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Moves aMessage
to the deadletter sub-queue.- Specified by:
deadLetter
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if deadletter failed
-
deadLetter
public void deadLetter(UUID lockToken, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Moves aMessage
to the deadletter sub-queue with modified message properties.- Specified by:
deadLetter
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
propertiesToModify
- Message properties to modify.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if deadletter failed
-
deadLetter
public void deadLetter(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Moves aMessage
to the deadletter sub-queue with modified message properties.- Specified by:
deadLetter
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
propertiesToModify
- Message properties to modify.transaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if deadletter failed
-
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Moves aMessage
to the deadletter sub-queue with deadletter reason and error description.- Specified by:
deadLetter
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
deadLetterReason
- The deadletter reason.deadLetterErrorDescription
- The deadletter error description.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if deadletter failed
-
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Moves aMessage
to the deadletter sub-queue with deadletter reason and error description.- Specified by:
deadLetter
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
deadLetterReason
- The deadletter reason.deadLetterErrorDescription
- The deadletter error description.transaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if deadletter failed
-
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Moves aMessage
to the deadletter sub-queue with deadletter reason and error description and modified properties.- Specified by:
deadLetter
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
deadLetterReason
- The deadletter reason.deadLetterErrorDescription
- The deadletter error description.propertiesToModify
- Message properties to modify.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if deadletter failed
-
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPump
Moves aMessage
to the deadletter sub-queue with deadletter reason and error description and modified properties.- Specified by:
deadLetter
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
deadLetterReason
- The deadletter reason.deadLetterErrorDescription
- The deadletter error description.propertiesToModify
- Message properties to modify.transaction
-TransactionContext
which this operation should enlist to.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if deadletter failed
-
deadLetterAsync
public CompletableFuture<Void> deadLetterAsync(UUID lockToken)
Description copied from interface:IMessageAndSessionPump
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter.- Specified by:
deadLetterAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, TransactionContext transaction)
Description copied from interface:IMessageAndSessionPump
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter.- Specified by:
deadLetterAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify)
Description copied from interface:IMessageAndSessionPump
Asynchronously moves aMessage
to the deadletter sub-queue with modified properties.- Specified by:
deadLetterAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
propertiesToModify
- Message properties to modify.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)
Description copied from interface:IMessageAndSessionPump
Asynchronously moves aMessage
to the deadletter sub-queue with modified properties.- Specified by:
deadLetterAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
propertiesToModify
- Message properties to modify.transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Description copied from interface:IMessageAndSessionPump
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter reason and error description.- Specified by:
deadLetterAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
deadLetterReason
- The deadletter reason.deadLetterErrorDescription
- The deadletter error description.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)
Description copied from interface:IMessageAndSessionPump
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter reason and error description.- Specified by:
deadLetterAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
deadLetterReason
- The deadletter reason.deadLetterErrorDescription
- The deadletter error description.transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify)
Description copied from interface:IMessageAndSessionPump
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter reason and error description and modified properties.- Specified by:
deadLetterAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
deadLetterReason
- The deadletter reason.deadLetterErrorDescription
- The deadletter error description.propertiesToModify
- Message properties to modify.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction)
Description copied from interface:IMessageAndSessionPump
Asynchronously moves aMessage
to the deadletter sub-queue with deadletter reason and error description and modified properties.- Specified by:
deadLetterAsync
in interfaceIMessageAndSessionPump
- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
deadLetterReason
- The deadletter reason.deadLetterErrorDescription
- The deadletter error description.propertiesToModify
- Message properties to modify.transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
getPrefetchCount
public int getPrefetchCount()
Description copied from interface:IMessageAndSessionPump
Get the prefetch value set.- Specified by:
getPrefetchCount
in interfaceIMessageAndSessionPump
- Returns:
- The set prefetch count value.
-
setPrefetchCount
public void setPrefetchCount(int prefetchCount) throws ServiceBusException
Description copied from interface:IMessageAndSessionPump
Set the prefetch count of the receiver. Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using Receive. Setting a non-zero value prefetches PrefetchCount number of messages. Setting the value to zero turns prefetch off. For RECEIVEANDDELETE mode, the default value is 0. For PEEKLOCK mode, the default value is 100.The value cannot be set until the receiver is created.
- Specified by:
setPrefetchCount
in interfaceIMessageAndSessionPump
- Parameters:
prefetchCount
- The desired prefetch count.- Throws:
ServiceBusException
- if sets the value failed
-
getQueueName
public String getQueueName()
Description copied from interface:IQueueClient
Gets the name of the queue.- Specified by:
getQueueName
in interfaceIQueueClient
- Returns:
- The name of the queue.
-
-