Package com.microsoft.azure.servicebus
Interface ISubscriptionClient
-
- All Superinterfaces:
ICloseable
,IMessageEntityClient
- All Known Implementing Classes:
SubscriptionClient
public interface ISubscriptionClient extends IMessageEntityClient
SubscriptionClient can be used for all basic interactions with a Service Bus Subscription.
-
-
Method Summary
All Methods Instance Methods Abstract 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
addRule(RuleDescription ruleDescription)
Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.void
addRule(String ruleName, Filter filter)
Adds a rule with specified name andFilter
to 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 andFilter
to the current subscription to filter the messages reaching from topic to the subscription.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.int
getPrefetchCount()
Get the prefetch value set.ReceiveMode
getReceiveMode()
Gets theReceiveMode
of the current receiverCollection<RuleDescription>
getRules()
Get all rules associated with the subscription.CompletableFuture<Collection<RuleDescription>>
getRulesAsync()
Get all rules associated with the subscription.String
getSubscriptionName()
Gets the subscription name.String
getTopicName()
Gets the name of the topic, for this subscription.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.void
removeRule(String ruleName)
Removes the rule on the subscription identified by ruleNameCompletableFuture<Void>
removeRuleAsync(String ruleName)
Asynchronously removes the rule on the subscription identified by ruleNamevoid
setPrefetchCount(int prefetchCount)
Set the prefetch count of the receiver.-
Methods inherited from interface com.microsoft.azure.servicebus.ICloseable
close, closeAsync
-
Methods inherited from interface com.microsoft.azure.servicebus.IMessageEntityClient
getEntityPath
-
-
-
-
Method Detail
-
getReceiveMode
ReceiveMode getReceiveMode()
Gets theReceiveMode
of the current receiver- Returns:
- The receive mode.
-
addRule
void addRule(RuleDescription ruleDescription) throws InterruptedException, ServiceBusException
Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.- 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
CompletableFuture<Void> addRuleAsync(RuleDescription ruleDescription)
Asynchronously adds a rule to the current subscription to filter the messages reaching from topic to the subscription.- Parameters:
ruleDescription
- The rule description that provides the rule to add.- Returns:
- a CompletableFuture representing the pending rule add operation.
-
addRule
void addRule(String ruleName, Filter filter) throws InterruptedException, ServiceBusException
Adds a rule with specified name andFilter
to the current subscription to filter the messages reaching from topic to the subscription.- Parameters:
ruleName
- The rule namefilter
- TheFilter
to add.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if add rule failed
-
addRuleAsync
CompletableFuture<Void> addRuleAsync(String ruleName, Filter filter)
Asynchronously adds a rule with specified name andFilter
to the current subscription to filter the messages reaching from topic to the subscription.- Parameters:
ruleName
- The rule namefilter
- TheFilter
to add.- Returns:
- a CompletableFuture representing the pending rule add operation.
-
removeRuleAsync
CompletableFuture<Void> removeRuleAsync(String ruleName)
Asynchronously removes the rule on the subscription identified by ruleName- Parameters:
ruleName
- he name of rule.- Returns:
- a CompletableFuture representing the pending rule remove operation.
-
removeRule
void removeRule(String ruleName) throws InterruptedException, ServiceBusException
Removes the rule on the subscription identified by ruleName- Parameters:
ruleName
- The name of rule.- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if remove rule failed
-
getRules
Collection<RuleDescription> getRules() throws ServiceBusException, InterruptedException
Get all rules associated with the subscription.- Returns:
- The collection fo the rules.
- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if get rules failed
-
getRulesAsync
CompletableFuture<Collection<RuleDescription>> getRulesAsync()
Get all rules associated with the subscription.- Returns:
- a CompletableFuture representing the pending get rules operation.
-
getTopicName
String getTopicName()
Gets the name of the topic, for this subscription.- Returns:
- the name of the topic
-
getSubscriptionName
String getSubscriptionName()
Gets the subscription name.- Returns:
- The subscription name.
-
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
- TheIMessageHandler
instance- 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
- TheIMessageHandler
instanceexecutorService
- ExecutorService which is used to executeIMessageHandler
methods.- 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
- TheIMessageHandler
instancehandlerOptions
-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
- 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
@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
- TheISessionHandler
instance- 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
- TheISessionHandler
instanceexecutorService
- ExecutorService which is used to executeISessionHandler
methods- 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
- TheISessionHandler
instancehandlerOptions
-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
- TheISessionHandler
instancehandlerOptions
-SessionHandlerOptions
executorService
- ExecutorService which is used to executeISessionHandler
methods- Throws:
InterruptedException
- if the current thread was interrupted while waitingServiceBusException
- if register failed
-
abandon
void abandon(UUID lockToken) throws InterruptedException, ServiceBusException
AbandonMessage
with 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
AbandonMessage
with 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
-TransactionContext
which 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
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- 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
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- 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
CompletableFuture<Void> abandonAsync(UUID lockToken)
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.- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
- Returns:
- a CompletableFuture representing the pending abandon.
-
abandonAsync
CompletableFuture<Void> abandonAsync(UUID lockToken, TransactionContext transaction)
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.- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending abandon.
-
abandonAsync
CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String,Object> propertiesToModify)
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.- 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 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.- 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
void complete(UUID lockToken) throws InterruptedException, ServiceBusException
Completes aMessage
using 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 aMessage
using its lock token. This will delete the message from the service.- 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
CompletableFuture<Void> completeAsync(UUID lockToken)
Asynchronously completes aMessage
using 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 aMessage
using its lock token. This will delete the message from the service.- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending complete.
-
deadLetter
void deadLetter(UUID lockToken) throws InterruptedException, ServiceBusException
Moves aMessage
to 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 aMessage
to the deadletter sub-queue.- 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
void deadLetter(UUID lockToken, Map<String,Object> propertiesToModify) throws InterruptedException, ServiceBusException
Moves aMessage
to 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 aMessage
to the deadletter sub-queue with modified message properties.- 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
void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription) throws InterruptedException, ServiceBusException
Moves aMessage
to 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 aMessage
to 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
-TransactionContext
which 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 aMessage
to 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 aMessage
to 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
-TransactionContext
which 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 aMessage
to 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 aMessage
to the deadletter sub-queue with deadletter.- Parameters:
lockToken
- Message lock tokenMessage.getLockToken()
transaction
-TransactionContext
which this operation should enlist to.- Returns:
- a CompletableFuture representing the pending deadletter.
-
deadLetterAsync
CompletableFuture<Void> deadLetterAsync(UUID lockToken, Map<String,Object> propertiesToModify)
Asynchronously moves aMessage
to 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 aMessage
to the deadletter sub-queue with modified properties.- 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
CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Asynchronously moves aMessage
to 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 aMessage
to 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
-TransactionContext
which 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 aMessage
to 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 aMessage
to 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
-TransactionContext
which 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 ServiceBusException
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.
- Parameters:
prefetchCount
- The desired prefetch count.- Throws:
ServiceBusException
- if sets the value failed
-
-