Package com.microsoft.azure.servicebus
Class SubscriptionClient
- java.lang.Object
-
- com.microsoft.azure.servicebus.primitives.ClientEntity
-
- com.microsoft.azure.servicebus.SubscriptionClient
-
- All Implemented Interfaces:
ICloseable,IMessageAndSessionPump,IMessageEntityClient,ISubscriptionClient
public final class SubscriptionClient extends ClientEntity implements ISubscriptionClient
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_RULE_NAME
-
Constructor Summary
Constructors Constructor Description SubscriptionClient(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode)SubscriptionClient(String namespace, String subscriptionPath, ClientSettings clientSettings, ReceiveMode receiveMode)SubscriptionClient(URI namespaceEndpointURI, String subscriptionPath, ClientSettings clientSettings, ReceiveMode receiveMode)
-
Method Summary
All Methods Instance Methods Concrete 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.voidaddRule(RuleDescription ruleDescription)Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.voidaddRule(String ruleName, Filter filter)Adds a rule with specified name andFilterto the current subscription to filter the messages reaching from topic to the subscription.CompletableFuture<Void>addRuleAsync(RuleDescription ruleDescription)Asynchronously adds a rule to the current subscription to filter the messages reaching from topic to the subscription.CompletableFuture<Void>addRuleAsync(String ruleName, Filter filter)Asynchronously adds a rule with specified name andFilterto the current subscription to filter the messages reaching from topic to the subscription.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.StringgetEntityPath()Gets the path of the entity this client is sending messages to or receiving messages from.intgetPrefetchCount()Get the prefetch value set.ReceiveModegetReceiveMode()Gets theReceiveModeof the current receiverCollection<RuleDescription>getRules()Get all rules associated with the subscription.CompletableFuture<Collection<RuleDescription>>getRulesAsync()Get all rules associated with the subscription.StringgetSubscriptionName()Gets the subscription name.StringgetTopicName()Gets the name of the topic, for this subscription.protected CompletableFuture<Void>onClose()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.voidremoveRule(String ruleName)Removes the rule on the subscription identified by ruleNameCompletableFuture<Void>removeRuleAsync(String ruleName)Asynchronously removes the rule on the subscription identified by ruleNamevoidsetPrefetchCount(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
-
-
-
-
Field Detail
-
DEFAULT_RULE_NAME
public static final String DEFAULT_RULE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SubscriptionClient
public SubscriptionClient(ConnectionStringBuilder amqpConnectionStringBuilder, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
-
SubscriptionClient
public SubscriptionClient(String namespace, String subscriptionPath, ClientSettings clientSettings, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
-
SubscriptionClient
public SubscriptionClient(URI namespaceEndpointURI, String subscriptionPath, ClientSettings clientSettings, ReceiveMode receiveMode) throws InterruptedException, ServiceBusException
-
-
Method Detail
-
getReceiveMode
public ReceiveMode getReceiveMode()
Description copied from interface:ISubscriptionClientGets theReceiveModeof the current receiver- Specified by:
getReceiveModein interfaceISubscriptionClient- Returns:
- The receive mode.
-
getEntityPath
public String getEntityPath()
Description copied from interface:IMessageEntityClientGets the path of the entity this client is sending messages to or receiving messages from.- Specified by:
getEntityPathin interfaceIMessageEntityClient- Returns:
- path of the entity this client is connecting to
-
addRule
public void addRule(RuleDescription ruleDescription) throws InterruptedException, ServiceBusException
Description copied from interface:ISubscriptionClientAdds a rule to the current subscription to filter the messages reaching from topic to the subscription.- Specified by:
addRulein interfaceISubscriptionClient- Parameters:
ruleDescription- The rule description that provides the rule to add.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if add rule failed
-
addRuleAsync
public CompletableFuture<Void> addRuleAsync(RuleDescription ruleDescription)
Description copied from interface:ISubscriptionClientAsynchronously adds a rule to the current subscription to filter the messages reaching from topic to the subscription.- Specified by:
addRuleAsyncin interfaceISubscriptionClient- Parameters:
ruleDescription- The rule description that provides the rule to add.- Returns:
- a CompletableFuture representing the pending rule add operation.
-
addRule
public void addRule(String ruleName, Filter filter) throws InterruptedException, ServiceBusException
Description copied from interface:ISubscriptionClientAdds a rule with specified name andFilterto the current subscription to filter the messages reaching from topic to the subscription.- Specified by:
addRulein interfaceISubscriptionClient- Parameters:
ruleName- The rule namefilter- TheFilterto add.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if add rule failed
-
addRuleAsync
public CompletableFuture<Void> addRuleAsync(String ruleName, Filter filter)
Description copied from interface:ISubscriptionClientAsynchronously adds a rule with specified name andFilterto the current subscription to filter the messages reaching from topic to the subscription.- Specified by:
addRuleAsyncin interfaceISubscriptionClient- Parameters:
ruleName- The rule namefilter- TheFilterto add.- Returns:
- a CompletableFuture representing the pending rule add operation.
-
removeRule
public void removeRule(String ruleName) throws InterruptedException, ServiceBusException
Description copied from interface:ISubscriptionClientRemoves the rule on the subscription identified by ruleName- Specified by:
removeRulein interfaceISubscriptionClient- Parameters:
ruleName- The name of rule.- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if remove rule failed
-
removeRuleAsync
public CompletableFuture<Void> removeRuleAsync(String ruleName)
Description copied from interface:ISubscriptionClientAsynchronously removes the rule on the subscription identified by ruleName- Specified by:
removeRuleAsyncin interfaceISubscriptionClient- Parameters:
ruleName- he name of rule.- Returns:
- a CompletableFuture representing the pending rule remove operation.
-
getRules
public Collection<RuleDescription> getRules() throws ServiceBusException, InterruptedException
Description copied from interface:ISubscriptionClientGet all rules associated with the subscription.- Specified by:
getRulesin interfaceISubscriptionClient- Returns:
- The collection fo the rules.
- Throws:
ServiceBusException- if get rules failedInterruptedException- if the current thread was interrupted while waiting
-
getRulesAsync
public CompletableFuture<Collection<RuleDescription>> getRulesAsync()
Description copied from interface:ISubscriptionClientGet all rules associated with the subscription.- Specified by:
getRulesAsyncin interfaceISubscriptionClient- Returns:
- a CompletableFuture representing the pending get rules operation.
-
registerMessageHandler
@Deprecated public void registerMessageHandler(IMessageHandler handler) throws InterruptedException, ServiceBusException
Deprecated.Description copied from interface:IMessageAndSessionPumpReceive 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:
registerMessageHandlerin interfaceIMessageAndSessionPump- Parameters:
handler- TheIMessageHandlerinstance- 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:IMessageAndSessionPumpReceive 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:
registerMessageHandlerin interfaceIMessageAndSessionPump- Parameters:
handler- TheIMessageHandlerinstancehandlerOptions-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:IMessageAndSessionPumpReceive 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:
registerSessionHandlerin interfaceIMessageAndSessionPump- Parameters:
handler- TheISessionHandlerinstance- 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:IMessageAndSessionPumpReceive 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:
registerSessionHandlerin interfaceIMessageAndSessionPump- Parameters:
handler- TheISessionHandlerinstancehandlerOptions-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:IMessageAndSessionPumpReceive 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:
registerMessageHandlerin interfaceIMessageAndSessionPump- Parameters:
handler- TheIMessageHandlerinstanceexecutorService- ExecutorService which is used to executeIMessageHandlermethods.- 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:IMessageAndSessionPumpReceive 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:
registerMessageHandlerin interfaceIMessageAndSessionPump- Parameters:
handler- TheIMessageHandlerinstancehandlerOptions-MessageHandlerOptionsexecutorService- ExecutorService which is used to executeIMessageHandlermethods- 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:IMessageAndSessionPumpReceive 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:
registerSessionHandlerin interfaceIMessageAndSessionPump- Parameters:
handler- TheISessionHandlerinstanceexecutorService- ExecutorService which is used to executeISessionHandlermethods- 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:IMessageAndSessionPumpReceive 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:
registerSessionHandlerin interfaceIMessageAndSessionPump- Parameters:
handler- TheISessionHandlerinstancehandlerOptions-SessionHandlerOptionsexecutorService- ExecutorService which is used to executeISessionHandlermethods- Throws:
InterruptedException- if the current thread was interrupted while waitingServiceBusException- if register failed
-
onClose
protected CompletableFuture<Void> onClose()
- Specified by:
onClosein classClientEntity
-
abandon
public void abandon(UUID lockToken) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPumpAbandonMessagewith lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message- Specified by:
abandonin 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:IMessageAndSessionPumpAbandonMessagewith lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message- Specified by:
abandonin interfaceIMessageAndSessionPump- 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
public void abandon(UUID lockToken, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPumpAbandonMessagewith 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:
abandonin 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:IMessageAndSessionPumpAbandonMessagewith 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:
abandonin interfaceIMessageAndSessionPump- 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
public CompletableFuture<Void> abandonAsync(UUID lockToken)
Description copied from interface:IMessageAndSessionPumpAsynchronously abandonMessagewith lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.- Specified by:
abandonAsyncin 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:IMessageAndSessionPumpAsynchronously abandonMessagewith lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.- Specified by:
abandonAsyncin interfaceIMessageAndSessionPump- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich 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:IMessageAndSessionPumpAsynchronously 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.- Specified by:
abandonAsyncin 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:IMessageAndSessionPumpAsynchronously 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.- Specified by:
abandonAsyncin interfaceIMessageAndSessionPump- 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
public void complete(UUID lockToken) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPumpCompletes aMessageusing its lock token. This will delete the message from the service.- Specified by:
completein 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:IMessageAndSessionPumpCompletes aMessageusing its lock token. This will delete the message from the service.- Specified by:
completein interfaceIMessageAndSessionPump- 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
public CompletableFuture<Void> completeAsync(UUID lockToken)
Description copied from interface:IMessageAndSessionPumpAsynchronously completes aMessageusing its lock token. This will delete the message from the service.- Specified by:
completeAsyncin 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:IMessageAndSessionPumpAsynchronously completes aMessageusing its lock token. This will delete the message from the service.- Specified by:
completeAsyncin interfaceIMessageAndSessionPump- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich 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:IMessageAndSessionPumpMoves aMessageto the deadletter sub-queue.- Specified by:
deadLetterin 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:IMessageAndSessionPumpMoves aMessageto the deadletter sub-queue.- Specified by:
deadLetterin interfaceIMessageAndSessionPump- 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
public void deadLetter(UUID lockToken, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPumpMoves aMessageto the deadletter sub-queue with modified message properties.- Specified by:
deadLetterin 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:IMessageAndSessionPumpMoves aMessageto the deadletter sub-queue with modified message properties.- Specified by:
deadLetterin interfaceIMessageAndSessionPump- 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
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPumpMoves aMessageto the deadletter sub-queue with deadletter reason and error description.- Specified by:
deadLetterin 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:IMessageAndSessionPumpMoves aMessageto the deadletter sub-queue with deadletter reason and error description.- Specified by:
deadLetterin interfaceIMessageAndSessionPump- 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
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Description copied from interface:IMessageAndSessionPumpMoves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.- Specified by:
deadLetterin 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:IMessageAndSessionPumpMoves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.- Specified by:
deadLetterin interfaceIMessageAndSessionPump- 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
public CompletableFuture<Void> deadLetterAsync(UUID lockToken)
Description copied from interface:IMessageAndSessionPumpAsynchronously moves aMessageto the deadletter sub-queue with deadletter.- Specified by:
deadLetterAsyncin 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:IMessageAndSessionPumpAsynchronously moves aMessageto the deadletter sub-queue with deadletter.- Specified by:
deadLetterAsyncin interfaceIMessageAndSessionPump- Parameters:
lockToken- Message lock tokenMessage.getLockToken()transaction-TransactionContextwhich 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:IMessageAndSessionPumpAsynchronously moves aMessageto the deadletter sub-queue with modified properties.- Specified by:
deadLetterAsyncin 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:IMessageAndSessionPumpAsynchronously moves aMessageto the deadletter sub-queue with modified properties.- Specified by:
deadLetterAsyncin interfaceIMessageAndSessionPump- 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
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Description copied from interface:IMessageAndSessionPumpAsynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description.- Specified by:
deadLetterAsyncin 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:IMessageAndSessionPumpAsynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description.- Specified by:
deadLetterAsyncin interfaceIMessageAndSessionPump- 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
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String,Object> propertiesToModify)
Description copied from interface:IMessageAndSessionPumpAsynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.- Specified by:
deadLetterAsyncin 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:IMessageAndSessionPumpAsynchronously moves aMessageto the deadletter sub-queue with deadletter reason and error description and modified properties.- Specified by:
deadLetterAsyncin interfaceIMessageAndSessionPump- 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
public int getPrefetchCount()
Description copied from interface:IMessageAndSessionPumpGet the prefetch value set.- Specified by:
getPrefetchCountin interfaceIMessageAndSessionPump- Returns:
- The set prefetch count value.
-
setPrefetchCount
public void setPrefetchCount(int prefetchCount) throws ServiceBusExceptionDescription copied from interface:IMessageAndSessionPumpSet 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:
setPrefetchCountin interfaceIMessageAndSessionPump- Parameters:
prefetchCount- The desired prefetch count.- Throws:
ServiceBusException- if sets the value failed
-
getTopicName
public String getTopicName()
Description copied from interface:ISubscriptionClientGets the name of the topic, for this subscription.- Specified by:
getTopicNamein interfaceISubscriptionClient- Returns:
- the name of the topic
-
getSubscriptionName
public String getSubscriptionName()
Description copied from interface:ISubscriptionClientGets the subscription name.- Specified by:
getSubscriptionNamein interfaceISubscriptionClient- Returns:
- The subscription name.
-
-