IMessageReceiver Interface
public interface IMessageReceiver extends IMessageEntityClient,IMessageBrowser
Defines message receiver interface. The MessageReceiver can be used to receive messages from Queues and Subscriptions and acknowledge them.
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
abandon(UUID lockToken)
Abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message |
void |
abandon(UUID lockToken, Map<String, Object> propertiesToModify)
Abandon Message 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 |
void |
abandon(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction)
Abandon Message 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 |
void |
abandon(UUID lockToken, TransactionContext transaction)
Abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message |
CompletableFuture<Void> |
abandonAsync(UUID lockToken)
Asynchronously abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message. |
CompletableFuture<Void> |
abandonAsync(UUID lockToken, Map<String, Object> propertiesToModify)
Asynchronously abandon Message 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. |
CompletableFuture<Void> |
abandonAsync(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction)
Asynchronously abandon Message 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. |
CompletableFuture<Void> |
abandonAsync(UUID lockToken, TransactionContext transaction)
Asynchronously abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message. |
void |
complete(UUID lockToken)
Completes a Message using its lock token. This will delete the message from the service. |
void |
complete(UUID lockToken, TransactionContext transaction)
Completes a Message using its lock token. This will delete the message from the service. |
CompletableFuture<Void> |
completeAsync(UUID lockToken)
Asynchronously completes a Message using its lock token. This will delete the message from the service. |
CompletableFuture<Void> |
completeAsync(UUID lockToken, TransactionContext transaction)
Asynchronously completes a Message using its lock token. This will delete the message from the service. |
void |
deadLetter(UUID lockToken)
Moves a Message to the deadletter sub-queue. |
void |
deadLetter(UUID lockToken, Map<String, Object> propertiesToModify)
Moves a Message to the deadletter sub-queue with modified message properties. |
void |
deadLetter(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction)
Moves a Message to the deadletter sub-queue with modified message properties. |
void |
deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Moves a Message to the deadletter sub-queue with deadletter reason and error description. |
void |
deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String, Object> propertiesToModify)
Moves a Message 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 a Message to the deadletter sub-queue with deadletter reason and error description and modified properties. |
void |
deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)
Moves a Message to the deadletter sub-queue with deadletter reason and error description. |
void |
deadLetter(UUID lockToken, TransactionContext transaction)
Moves a Message to the deadletter sub-queue. |
CompletableFuture<Void> |
deadLetterAsync(UUID lockToken)
Asynchronously moves a Message to the deadletter sub-queue with deadletter. |
CompletableFuture<Void> |
deadLetterAsync(UUID lockToken, Map<String, Object> propertiesToModify)
Asynchronously moves a Message to the deadletter sub-queue with modified properties. |
CompletableFuture<Void> |
deadLetterAsync(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction)
Asynchronously moves a Message to the deadletter sub-queue with modified properties. |
CompletableFuture<Void> |
deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Asynchronously moves a Message 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 a Message 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 a Message to the deadletter sub-queue with deadletter reason and error description and modified properties. |
CompletableFuture<Void> |
deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description. |
CompletableFuture<Void> |
deadLetterAsync(UUID lockToken, TransactionContext transaction)
Asynchronously moves a Message to the deadletter sub-queue with deadletter. |
void |
defer(UUID lockToken)
Defers a Message using its lock token. This will move message into deferred subqueue. |
void |
defer(UUID lockToken, Map<String, Object> propertiesToModify)
Defers a Message using its lock token with modified message property. This will move message into deferred subqueue. |
void |
defer(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction)
Defers a Message using its lock token with modified message property. This will move message into deferred subqueue. |
void |
defer(UUID lockToken, TransactionContext transaction)
Defers a Message using its lock token. This will move message into deferred subqueue. |
CompletableFuture<Void> |
deferAsync(UUID lockToken)
Asynchronously defers a Message using its lock token. This will move message into deferred subqueue. |
CompletableFuture<Void> |
deferAsync(UUID lockToken, Map<String, Object> propertiesToModify)
Asynchronously defers a Message using its lock token with modified message propert. This will move message into deferred subqueue. |
CompletableFuture<Void> |
deferAsync(UUID lockToken, Map<String, Object> propertiesToModify, TransactionContext transaction)
Asynchronously defers a Message using its lock token with modified message propert. This will move message into deferred subqueue. |
CompletableFuture<Void> |
deferAsync(UUID lockToken, TransactionContext transaction)
Asynchronously defers a Message using its lock token. This will move message into deferred subqueue. |
int |
getPrefetchCount()
Get the prefetch value set. |
Receive |
getReceiveMode()
Get current receiver's ReceiveMode. |
IMessage |
receive()
Receives a Message with default server wait time. |
IMessage |
receive(Duration serverWaitTime)
Receives a Message with specified server wait time. |
CompletableFuture<IMessage> |
receiveAsync()
Receives a Message from Azure Service Bus. |
CompletableFuture<IMessage> |
receiveAsync(Duration serverWaitTime)
Receives a Message from Azure Service Bus with server wait time. |
Collection<IMessage> |
receiveBatch(int maxMessageCount)
Receives a maximum of maxMessageCount Message from Azure Service Bus. |
Collection<IMessage> |
receiveBatch(int maxMessageCount, Duration serverWaitTime)
Receives a maximum of maxMessageCount Message from Azure Service Bus with server wait time. |
CompletableFuture<Collection<IMessage>> |
receiveBatchAsync(int maxMessageCount)
Asynchronously receives a maximum of maxMessageCount Message from the entity. |
CompletableFuture<Collection<IMessage>> |
receiveBatchAsync(int maxMessageCount, Duration serverWaitTime)
Asynchronously receives a maximum of maxMessageCount Message from Azure Service Bus with server wait time. |
IMessage |
receiveDeferredMessage(long sequenceNumber)
Receives a deferred Message. Deferred messages can only be received by using sequence number. |
CompletableFuture<IMessage> |
receiveDeferredMessageAsync(long sequenceNumber)
Asynchronously receives a specific deferred Message identified by sequence number. |
Collection<IMessage> |
receiveDeferredMessageBatch(Collection<Long> sequenceNumbers)
Receives a batch of deferred Message. |
CompletableFuture<Collection<IMessage>> |
receiveDeferredMessageBatchAsync(Collection<Long> sequenceNumbers)
Asynchronously receives a set of deferred Message from the entity. |
Instant |
renewMessageLock(IMessage message)
Renews the lock on the message specified by the lock token. The lock will be renewed based on the setting specified on the entity. When a message is received in PEEKLOCK mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, the lock is reset to the entity's LockDuration value. |
Instant |
renewMessageLock(UUID lockToken)
Renews the lock on the message specified by the lock token. The lock will be renewed based on the setting specified on the entity. When a message is received in PEEKLOCK mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, the lock is reset to the entity's LockDuration value. Note - calling this will not update getLockedUntilUtc() and updated lockedUntilUtc must be tracked by the application. |
CompletableFuture<Instant> |
renewMessageLockAsync(IMessage message)
Asynchronously renews the lock on the message specified by the lock token. The lock will be renewed based on the setting specified on the entity. When a message is received in PEEKLOCK mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, the lock is reset to the entity's LockDuration value. |
CompletableFuture<Instant> |
renewMessageLockAsync(UUID lockToken)
Renews the lock on the message specified by the lock token. The lock will be renewed based on the setting specified on the entity. When a message is received in PEEKLOCK mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, the lock is reset to the entity's LockDuration value. Note - calling this will not update getLockedUntilUtc() and updated lockedUntilUtc must be tracked by the application. |
void |
setPrefetchCount(int prefetchCount)
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 both PEEKLOCK mode and RECEIVEANDDELETE mode, the default value is 0. The value cannot be set until the receiver is created. |
Inherited Members
Method Details
abandon
public void abandon(UUID lockToken)
Abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message
Parameters:
Throws:
abandon
public void abandon(UUID lockToken, Map
Abandon Message 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:
Throws:
abandon
public void abandon(UUID lockToken, Map
Abandon Message 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:
TransactionContext which this operation should enlist to.
Throws:
abandon
public void abandon(UUID lockToken, TransactionContext transaction)
Abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message
Parameters:
TransactionContext which this operation should enlist to.
Throws:
abandonAsync
public CompletableFuture
Asynchronously abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.
Parameters:
Returns:
abandonAsync
public CompletableFuture
Asynchronously abandon Message 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:
Returns:
abandonAsync
public CompletableFuture
Asynchronously abandon Message 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:
TransactionContext which this operation should enlist to.
Returns:
abandonAsync
public CompletableFuture
Asynchronously abandon Message with lock token. This will make the message available again for processing. Abandoning a message will increase the delivery count on the message.
Parameters:
TransactionContext which this operation should enlist to.
Returns:
complete
public void complete(UUID lockToken)
Completes a Message using its lock token. This will delete the message from the service.
Parameters:
Throws:
complete
public void complete(UUID lockToken, TransactionContext transaction)
Completes a Message using its lock token. This will delete the message from the service.
Parameters:
TransactionContext which this operation should enlist to.
Throws:
completeAsync
public CompletableFuture
Asynchronously completes a Message using its lock token. This will delete the message from the service.
Parameters:
Returns:
completeAsync
public CompletableFuture
Asynchronously completes a Message using its lock token. This will delete the message from the service.
Parameters:
TransactionContext which this operation should enlist to.
Returns:
deadLetter
public void deadLetter(UUID lockToken)
Moves a Message to the deadletter sub-queue.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, Map
Moves a Message to the deadletter sub-queue with modified message properties.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, Map
Moves a Message to the deadletter sub-queue with modified message properties.
Parameters:
TransactionContext which this operation should enlist to.
Throws:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription)
Moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map
Moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
Throws:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map
Moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
TransactionContext which this operation should enlist to.
Throws:
deadLetter
public void deadLetter(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, TransactionContext transaction)
Moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
TransactionContext which this operation should enlist to.
Throws:
deadLetter
public void deadLetter(UUID lockToken, TransactionContext transaction)
Moves a Message to the deadletter sub-queue.
Parameters:
TransactionContext which this operation should enlist to.
Throws:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter.
Parameters:
Returns:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with modified properties.
Parameters:
Returns:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with modified properties.
Parameters:
TransactionContext which this operation should enlist to.
Returns:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
Returns:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
Returns:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
TransactionContext which this operation should enlist to.
Returns:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
TransactionContext which this operation should enlist to.
Returns:
deadLetterAsync
public CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter.
Parameters:
TransactionContext which this operation should enlist to.
Returns:
defer
public void defer(UUID lockToken)
Defers a Message using its lock token. This will move message into deferred subqueue.
Parameters:
Throws:
defer
public void defer(UUID lockToken, Map
Defers a Message using its lock token with modified message property. This will move message into deferred subqueue.
Parameters:
Throws:
defer
public void defer(UUID lockToken, Map
Defers a Message using its lock token with modified message property. This will move message into deferred subqueue.
Parameters:
TransactionContext which this operation should enlist to.
Throws:
defer
public void defer(UUID lockToken, TransactionContext transaction)
Defers a Message using its lock token. This will move message into deferred subqueue.
Parameters:
TransactionContext which this operation should enlist to.
Throws:
deferAsync
public CompletableFuture
Asynchronously defers a Message using its lock token. This will move message into deferred subqueue.
Parameters:
Returns:
deferAsync
public CompletableFuture
Asynchronously defers a Message using its lock token with modified message propert. This will move message into deferred subqueue.
Parameters:
Returns:
deferAsync
public CompletableFuture
Asynchronously defers a Message using its lock token with modified message propert. This will move message into deferred subqueue.
Parameters:
TransactionContext which this operation should enlist to.
Returns:
deferAsync
public CompletableFuture
Asynchronously defers a Message using its lock token. This will move message into deferred subqueue.
Parameters:
TransactionContext which this operation should enlist to.
Returns:
getPrefetchCount
public int getPrefetchCount()
Get the prefetch value set.
Returns:
getReceiveMode
receive
receive
public IMessage receive(Duration serverWaitTime)
Receives a Message with specified server wait time.
Parameters:
Returns:
Throws:
receiveAsync
public CompletableFuture
Receives a Message from Azure Service Bus.
Returns:
receiveAsync
public CompletableFuture
Receives a Message from Azure Service Bus with server wait time.
Parameters:
Returns:
receiveBatch
public Collection
Receives a maximum of maxMessageCount Message from Azure Service Bus.
Parameters:
Returns:
Throws:
receiveBatch
public Collection
Receives a maximum of maxMessageCount Message from Azure Service Bus with server wait time.
Parameters:
Returns:
Throws:
receiveBatchAsync
public CompletableFuture
Asynchronously receives a maximum of maxMessageCount Message from the entity.
Parameters:
Returns:
receiveBatchAsync
public CompletableFuture
Asynchronously receives a maximum of maxMessageCount Message from Azure Service Bus with server wait time.
Parameters:
Returns:
receiveDeferredMessage
public IMessage receiveDeferredMessage(long sequenceNumber)
Receives a deferred Message. Deferred messages can only be received by using sequence number.
Parameters:
Returns:
Throws:
receiveDeferredMessageAsync
public CompletableFuture
Asynchronously receives a specific deferred Message identified by sequence number.
Parameters:
Returns:
receiveDeferredMessageBatch
public Collection
Receives a batch of deferred Message.
Parameters:
Returns:
Throws:
receiveDeferredMessageBatchAsync
public CompletableFuture
Asynchronously receives a set of deferred Message from the entity.
Parameters:
Returns:
renewMessageLock
public Instant renewMessageLock(IMessage message)
Renews the lock on the message specified by the lock token. The lock will be renewed based on the setting specified on the entity. When a message is received in PEEKLOCK mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, the lock is reset to the entity's LockDuration value.
Parameters:
Returns:
Throws:
renewMessageLock
public Instant renewMessageLock(UUID lockToken)
Renews the lock on the message specified by the lock token. The lock will be renewed based on the setting specified on the entity. When a message is received in PEEKLOCK mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, the lock is reset to the entity's LockDuration value.
Note - calling this will not update getLockedUntilUtc() and updated lockedUntilUtc must be tracked by the application.
Parameters:
Returns:
Throws:
renewMessageLockAsync
public CompletableFuture
Asynchronously renews the lock on the message specified by the lock token. The lock will be renewed based on the setting specified on the entity. When a message is received in PEEKLOCK mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, the lock is reset to the entity's LockDuration value.
Parameters:
Returns:
renewMessageLockAsync
public CompletableFuture
Renews the lock on the message specified by the lock token. The lock will be renewed based on the setting specified on the entity. When a message is received in PEEKLOCK mode, the message is locked on the server for this receiver instance for a duration as specified during the Queue/Subscription creation (LockDuration). If processing of the message requires longer than this duration, the lock needs to be renewed. For each renewal, the lock is reset to the entity's LockDuration value.
Note - calling this will not update getLockedUntilUtc() and updated lockedUntilUtc must be tracked by the application.
Parameters:
Returns:
setPrefetchCount
public void setPrefetchCount(int prefetchCount)
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 both PEEKLOCK mode and RECEIVEANDDELETE mode, the default value is 0.
The value cannot be set until the receiver is created.
Parameters:
Throws:
Applies to
Azure SDK for Java