IMessageReceiver Interface
Implements
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
Method Details
abandon
public abstract 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 abstract 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:
Throws:
abandon
public abstract 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 abstract 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:
abandonAsync
public abstract 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 abstract 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 abstract 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 abstract 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:
complete
public abstract void complete(UUID lockToken)
Completes a Message using its lock token. This will delete the message from the service.
Parameters:
Throws:
complete
public abstract void complete(UUID lockToken, TransactionContext transaction)
Completes a Message using its lock token. This will delete the message from the service.
Parameters:
Throws:
completeAsync
public abstract CompletableFuture
Asynchronously completes a Message using its lock token. This will delete the message from the service.
Parameters:
Returns:
completeAsync
public abstract CompletableFuture
Asynchronously completes a Message using its lock token. This will delete the message from the service.
Parameters:
Returns:
deadLetter
public abstract void deadLetter(UUID lockToken)
Moves a Message to the deadletter sub-queue.
Parameters:
Throws:
deadLetter
public abstract void deadLetter(UUID lockToken, TransactionContext transaction)
Moves a Message to the deadletter sub-queue.
Parameters:
Throws:
deadLetter
public abstract 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 abstract 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:
Throws:
deadLetter
public abstract 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 abstract 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 abstract void deadLetter(UUID lockToken, Map
Moves a Message to the deadletter sub-queue with modified message properties.
Parameters:
Throws:
deadLetter
public abstract void deadLetter(UUID lockToken, Map
Moves a Message to the deadletter sub-queue with modified message properties.
Parameters:
Throws:
deadLetterAsync
public abstract CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter.
Parameters:
Returns:
deadLetterAsync
public abstract CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter.
Parameters:
Returns:
deadLetterAsync
public abstract CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
Returns:
deadLetterAsync
public abstract CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description.
Parameters:
Returns:
deadLetterAsync
public abstract CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
Returns:
deadLetterAsync
public abstract CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with deadletter reason and error description and modified properties.
Parameters:
Returns:
deadLetterAsync
public abstract CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with modified properties.
Parameters:
Returns:
deadLetterAsync
public abstract CompletableFuture
Asynchronously moves a Message to the deadletter sub-queue with modified properties.
Parameters:
Returns:
defer
public abstract void defer(UUID lockToken)
Defers a Message using its lock token. This will move message into deferred subqueue.
Parameters:
Throws:
defer
public abstract void defer(UUID lockToken, TransactionContext transaction)
Defers a Message using its lock token. This will move message into deferred subqueue.
Parameters:
Throws:
defer
public abstract 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 abstract 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:
deferAsync
public abstract CompletableFuture
Asynchronously defers a Message using its lock token. This will move message into deferred subqueue.
Parameters:
Returns:
deferAsync
public abstract CompletableFuture
Asynchronously defers a Message using its lock token. This will move message into deferred subqueue.
Parameters:
Returns:
deferAsync
public abstract CompletableFuture
Asynchronously defers a Message using its lock token with modified message propert. This will move message into deferred subqueue.
Parameters:
Returns:
deferAsync
public abstract CompletableFuture
Asynchronously defers a Message using its lock token with modified message propert. This will move message into deferred subqueue.
Parameters:
Returns:
getPrefetchCount
public abstract int getPrefetchCount()
Get the prefetch value set.
Returns:
getReceiveMode
receive
public abstract IMessage receive()
Receives a Message with default server wait time.
Returns:
Throws:
receive
public abstract IMessage receive(Duration serverWaitTime)
Receives a Message with specified server wait time.
Parameters:
Returns:
Throws:
receiveAsync
public abstract CompletableFuture
Receives a Message from Azure Service Bus.
Returns:
receiveAsync
public abstract CompletableFuture
Receives a Message from Azure Service Bus with server wait time.
Parameters:
Returns:
receiveBatch
public abstract Collection
Receives a maximum of maxMessageCount Message from Azure Service Bus.
Parameters:
Returns:
Throws:
receiveBatch
public abstract Collection
Receives a maximum of maxMessageCount Message from Azure Service Bus with server wait time.
Parameters:
Returns:
Throws:
receiveBatchAsync
public abstract CompletableFuture<>
Asynchronously receives a maximum of maxMessageCount Message from the entity.
Parameters:
Returns:
receiveBatchAsync
public abstract CompletableFuture<>
Asynchronously receives a maximum of maxMessageCount Message from Azure Service Bus with server wait time.
Parameters:
Returns:
receiveDeferredMessage
public abstract IMessage receiveDeferredMessage(long sequenceNumber)
Receives a deferred Message. Deferred messages can only be received by using sequence number.
Parameters:
Returns:
Throws:
receiveDeferredMessageAsync
public abstract CompletableFuture
Asynchronously receives a specific deferred Message identified by sequence number.
Parameters:
Returns:
receiveDeferredMessageBatch
public abstract Collection
Receives a batch of deferred Message.
Parameters:
Returns:
Throws:
receiveDeferredMessageBatchAsync
public abstract CompletableFuture<>
Asynchronously receives a set of deferred Message from the entity.
Parameters:
Returns:
renewMessageLock
public abstract 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 abstract 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 abstract 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 abstract 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 abstract 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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for