Enum ServiceBusReceiveMode
- All Implemented Interfaces:
Serializable
,Comparable<ServiceBusReceiveMode>
,java.lang.constant.Constable
Defines the modes for receiving messages.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIn this mode, received message is not deleted from the queue or subscription, instead it is temporarily locked to the receiver, making it invisible to other receivers.In this mode, received message is removed from the queue or subscription and immediately deleted. -
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceBusReceiveMode
Returns the enum constant of this type with the specified name.static ServiceBusReceiveMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
PEEK_LOCK
In this mode, received message is not deleted from the queue or subscription, instead it is temporarily locked to the receiver, making it invisible to other receivers. Then the service waits for one of the following events:- If the receiver processes the message successfully, it calls
ServiceBusReceiverClient.complete(ServiceBusReceivedMessage)
orServiceBusReceiverAsyncClient.complete(ServiceBusReceivedMessage)
and the message will be deleted. - If the receiver decides that it can't process the message successfully, it calls
ServiceBusReceiverClient.abandon(ServiceBusReceivedMessage)
orServiceBusReceiverAsyncClient.abandon(ServiceBusReceivedMessage)
and the message will be unlocked and made available to other receivers. - If the receiver wants to defer the processing of the message to a later point in time, it calls
ServiceBusReceiverClient.defer(ServiceBusReceivedMessage)
orServiceBusReceiverAsyncClient.defer(ServiceBusReceivedMessage)
and the message will be deferred. A deferred can only be received by its sequence number. - If the receiver wants to dead-letter the message, it calls
ServiceBusReceiverClient.deadLetter(ServiceBusReceivedMessage)
orServiceBusReceiverAsyncClient.deadLetter(ServiceBusReceivedMessage)
and the message will be moved to a special sub-queue called dead-letter queue. - If the receiver calls neither of these methods within a configurable period of time
(by default, 60 seconds), the service assumes the receiver has failed. In this case, it behaves as if the
receiver had called
abandon
, making the message available to other receivers
- If the receiver processes the message successfully, it calls
-
RECEIVE_AND_DELETE
In this mode, received message is removed from the queue or subscription and immediately deleted. This option is simple, but if the receiver crashes before it finishes processing the message, the message is lost. Because it has been removed from the queue, no other receiver can access it.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-