Package com.microsoft.azure.servicebus
Interface IMessageAndSessionPump
-
- All Known Subinterfaces:
IQueueClient,ISubscriptionClient
- All Known Implementing Classes:
QueueClient,SubscriptionClient
public interface IMessageAndSessionPumpRepresents the pump which is underneath the clients that handles message processing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidabandon(UUID lockToken)AbandonMessagewith lock token.voidabandon(UUID lockToken, TransactionContext transaction)AbandonMessagewith lock token.voidabandon(UUID lockToken, Map<String,Object> propertiesToModify)AbandonMessagewith lock token and updated message property.voidabandon(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)AbandonMessagewith lock token and updated message property.CompletableFuture<Void>abandonAsync(UUID lockToken)Asynchronously abandonMessagewith lock token.CompletableFuture<Void>abandonAsync(UUID lockToken, TransactionContext transaction)Asynchronously abandonMessagewith lock token.CompletableFuture<Void>abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify)Asynchronously abandonMessagewith lock token and updated message property.CompletableFuture<Void>abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)Asynchronously abandonMessagewith lock token and updated message property.voidcomplete(UUID lockToken)Completes aMessageusing its lock token.voidcomplete(UUID lockToken, TransactionContext transaction)Completes aMessageusing its lock token.CompletableFuture<Void>completeAsync(UUID lockToken)Asynchronously completes aMessageusing its lock token.CompletableFuture<Void>completeAsync(UUID lockToken, TransactionContext transaction)Asynchronously completes aMessageusing its lock token.voiddeadLetter(UUID lockToken)Moves aMessageto the deadletter sub-queue.voiddeadLetter(UUID lockToken, TransactionContext transaction)Moves aMessageto the deadletter sub-queue.voiddeadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)Moves aMessageto the deadletter sub-queue with deadletter reason and error description.voiddeadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)Moves aMessageto the deadletter sub-queue with deadletter reason and error description.voiddeadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify)Moves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.voiddeadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction)Moves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.voiddeadLetter(UUID lockToken, Map<String,Object> propertiesToModify)Moves aMessageto the deadletter sub-queue with modified message properties.voiddeadLetter(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)Moves aMessageto the deadletter sub-queue with modified message properties.CompletableFuture<Void>deadLetterAsync(UUID lockToken)Asynchronously moves aMessageto the deadletter sub-queue with deadletter.CompletableFuture<Void>deadLetterAsync(UUID lockToken, TransactionContext transaction)Asynchronously moves aMessageto the deadletter sub-queue with deadletter.CompletableFuture<Void>deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)Asynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description.CompletableFuture<Void>deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)Asynchronously moves aMessageto 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 aMessageto 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 aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.CompletableFuture<Void>deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify)Asynchronously moves aMessageto the deadletter sub-queue with modified properties.CompletableFuture<Void>deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)Asynchronously moves aMessageto the deadletter sub-queue with modified properties.intgetPrefetchCount()Get the prefetch value set.voidregisterMessageHandler(IMessageHandler handler)Deprecated.voidregisterMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions)Deprecated.voidregisterMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService)Receive messages continuously from the entity.voidregisterMessageHandler(IMessageHandler handler, ExecutorService executorService)Receive messages continuously from the entity.voidregisterSessionHandler(ISessionHandler handler)Deprecated.voidregisterSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions)Deprecated.voidregisterSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions, ExecutorService executorService)Receive session messages continuously from the queue.voidregisterSessionHandler(ISessionHandler handler, ExecutorService executorService)Receive session messages continuously from the queue.voidsetPrefetchCount(int prefetchCount)Set the prefetch count of the receiver.
-
-
-
Method Detail
-
registerMessageHandler
@Deprecated void registerMessageHandler(IMessageHandler handler) throws InterruptedException, ServiceBusException
Deprecated.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()- Parameters:
handler- TheIMessageHandlerinstance- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
registerMessageHandler
void registerMessageHandler(IMessageHandler handler, ExecutorService executorService) throws InterruptedException, ServiceBusException
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.- Parameters:
handler- TheIMessageHandlerinstanceexecutorService- ExecutorService which is used to executeIMessageHandlermethods.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
registerMessageHandler
@Deprecated void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions) throws InterruptedException, ServiceBusException
Deprecated.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()- Parameters:
handler- TheIMessageHandlerinstancehandlerOptions-MessageHandlerOptions- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
registerMessageHandler
void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService) throws InterruptedException, ServiceBusException
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.- Parameters:
handler- TheIMessageHandlerinstancehandlerOptions-MessageHandlerOptionsexecutorService- ExecutorService which is used to executeIMessageHandlermethods- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
registerSessionHandler
@Deprecated void registerSessionHandler(ISessionHandler handler) throws InterruptedException, ServiceBusException
Deprecated.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()- Parameters:
handler- TheISessionHandlerinstance- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
registerSessionHandler
void registerSessionHandler(ISessionHandler handler, ExecutorService executorService) throws InterruptedException, ServiceBusException
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.- Parameters:
handler- TheISessionHandlerinstanceexecutorService- ExecutorService which is used to executeISessionHandlermethods- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
registerSessionHandler
@Deprecated void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions) throws InterruptedException, ServiceBusException
Deprecated.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()- Parameters:
handler- TheISessionHandlerinstancehandlerOptions-SessionHandlerOptions- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
registerSessionHandler
void registerSessionHandler(ISessionHandler handler, SessionHandlerOptions handlerOptions, ExecutorService executorService) throws InterruptedException, ServiceBusException
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.- Parameters:
handler- TheISessionHandlerinstancehandlerOptions-SessionHandlerOptionsexecutorService- ExecutorService which is used to executeISessionHandlermethods- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
abandon
void abandon(UUID lockToken) throws InterruptedException, ServiceBusException
AbandonMessagewith lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message- Parameters:
lockToken- Message lock tokenMessage.getLockToken()- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if abandon failed
-
abandon
void abandon(UUID lockToken, TransactionContext transaction) throws InterruptedException, ServiceBusException
AbandonMessagewith lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich this operation should enlist to.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if abandon failed
-
abandon
void abandon(UUID lockToken, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
AbandonMessagewith 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- 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
void abandon(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction) throws InterruptedException, ServiceBusException
AbandonMessagewith 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- Parameters:
lockToken- Message lock tokenMessage.getLockToken()propertiesToModify- Message properties to modify.transaction-TransactionContextwhich this operation should enlist to.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if abandon failed
-
abandonAsync
CompletableFuture<Void> abandonAsync(UUID lockToken)
Asynchronously abandonMessagewith lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()- Returns:
- a CompletableFuture representing the pending abandon.
-
abandonAsync
CompletableFuture<Void> abandonAsync(UUID lockToken, TransactionContext transaction)
Asynchronously abandonMessagewith lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich this operation should enlist to.- Returns:
- a CompletableFuture representing the pending abandon.
-
abandonAsync
CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify)
Asynchronously abandonMessagewith 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.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()propertiesToModify- Message properties to modify.- Returns:
- a CompletableFuture representing the pending abandon.
-
abandonAsync
CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)
Asynchronously abandonMessagewith 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.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()propertiesToModify- Message properties to modify.transaction-TransactionContextwhich this operation should enlist to.- Returns:
- a CompletableFuture representing the pending abandon.
-
complete
void complete(UUID lockToken) throws InterruptedException, ServiceBusException
Completes aMessageusing its lock token. This will delete the message from the service.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if abandon failed
-
complete
void complete(UUID lockToken, TransactionContext transaction) throws InterruptedException, ServiceBusException
Completes aMessageusing its lock token. This will delete the message from the service.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich this operation should enlist to.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if abandon failed
-
completeAsync
CompletableFuture<Void> completeAsync(UUID lockToken)
Asynchronously completes aMessageusing its lock token. This will delete the message from the service.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()- Returns:
- a CompletableFuture representing the pending complete.
-
completeAsync
CompletableFuture<Void> completeAsync(UUID lockToken, TransactionContext transaction)
Asynchronously completes aMessageusing its lock token. This will delete the message from the service.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich this operation should enlist to.- Returns:
- a CompletableFuture representing the pending complete.
-
deadLetter
void deadLetter(UUID lockToken) throws InterruptedException, ServiceBusException
Moves aMessageto the deadletter sub-queue.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if deadletter failed
-
deadLetter
void deadLetter(UUID lockToken, TransactionContext transaction) throws InterruptedException, ServiceBusException
Moves aMessageto the deadletter sub-queue.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich this operation should enlist to.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if deadletter failed
-
deadLetter
void deadLetter(UUID lockToken, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Moves aMessageto the deadletter sub-queue with modified message properties.- 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
void deadLetter(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction) throws InterruptedException, ServiceBusException
Moves aMessageto the deadletter sub-queue with modified message properties.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()propertiesToModify- Message properties to modify.transaction-TransactionContextwhich this operation should enlist to.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if deadletter failed
-
deadLetter
void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription) throws InterruptedException, ServiceBusException
Moves aMessageto the deadletter sub-queue with deadletter reason and error description.- 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
void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction) throws InterruptedException, ServiceBusException
Moves aMessageto the deadletter sub-queue with deadletter reason and error description.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()deadLetterReason- The deadletter reason.deadLetterErrorDescription- The deadletter error description.transaction-TransactionContextwhich this operation should enlist to.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if deadletter failed
-
deadLetter
void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Moves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.- 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
void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction) throws InterruptedException, ServiceBusException
Moves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()deadLetterReason- The deadletter reason.deadLetterErrorDescription- The deadletter error description.propertiesToModify- Message properties to modify.transaction-TransactionContextwhich this operation should enlist to.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if deadletter failed
-
deadLetterAsync
CompletableFuture<Void> deadLetterAsync(UUID lockToken)
Asynchronously moves aMessageto the deadletter sub-queue with deadletter.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
CompletableFuture<Void> deadLetterAsync(UUID lockToken, TransactionContext transaction)
Asynchronously moves aMessageto the deadletter sub-queue with deadletter.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
CompletableFuture<Void> deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify)
Asynchronously moves aMessageto the deadletter sub-queue with modified properties.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()propertiesToModify- Message properties to modify.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
CompletableFuture<Void> deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify, TransactionContext transaction)
Asynchronously moves aMessageto the deadletter sub-queue with modified properties.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()propertiesToModify- Message properties to modify.transaction-TransactionContextwhich this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Asynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()deadLetterReason- The deadletter reason.deadLetterErrorDescription- The deadletter error description.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)
Asynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()deadLetterReason- The deadletter reason.deadLetterErrorDescription- The deadletter error description.transaction-TransactionContextwhich this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify)
Asynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.- 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
CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify, TransactionContext transaction)
Asynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.- Parameters:
lockToken- Message lock tokenMessage.getLockToken()deadLetterReason- The deadletter reason.deadLetterErrorDescription- The deadletter error description.propertiesToModify- Message properties to modify.transaction-TransactionContextwhich this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
getPrefetchCount
int getPrefetchCount()
Get the prefetch value set.- Returns:
- The set prefetch count value.
-
setPrefetchCount
void setPrefetchCount(int prefetchCount) throws ServiceBusExceptionSet 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.
- Parameters:
prefetchCount- The desired prefetch count.- Throws:
ServiceBusException- if sets the value failed
-
-