Package com.microsoft.azure.servicebus
Enum ReceiveMode
- java.lang.Object
-
- java.lang.Enum<ReceiveMode>
-
- com.microsoft.azure.servicebus.ReceiveMode
-
- All Implemented Interfaces:
Serializable
,Comparable<ReceiveMode>
public enum ReceiveMode extends Enum<ReceiveMode>
Enumeration to represent the two receive modes Azure Service Bus supports.- Since:
- 1.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description PEEKLOCK
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.RECEIVEANDDELETE
In this mode, received message is removed from the queue or subscription and immediately deleted.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ReceiveMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static ReceiveMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PEEKLOCK
public static final ReceiveMode PEEKLOCK
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 three events- If the receiver processes the message successfully, it calls
complete
and the message will be deleted. - If the receiver decides that it can't process the message successfully, it calls
abandon
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
defer
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
deadLetter
and the message will be moved to a special sub-queue called deadletter 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
-
RECEIVEANDDELETE
public static final ReceiveMode RECEIVEANDDELETE
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's been removed from the queue, no other receiver can access it.
-
-
Method Detail
-
values
public static ReceiveMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ReceiveMode c : ReceiveMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ReceiveMode valueOf(String name)
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
-
-