Class QueueDescription
- java.lang.Object
-
- com.microsoft.azure.servicebus.management.QueueDescription
-
public class QueueDescription extends Object
Represents the metadata description of the queue.
-
-
Constructor Summary
Constructors Constructor Description QueueDescription(String path)
Initializes a new instance of QueueDescription with the specified relative path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
List<AuthorizationRule>
getAuthorizationRules()
Duration
getAutoDeleteOnIdle()
Duration
getDefaultMessageTimeToLive()
Time-To-Live is the duration after which the message expires, starting from when the message is sent to Service Bus.Duration
getDuplicationDetectionHistoryTimeWindow()
EntityStatus
getEntityStatus()
Gets the status of the entity.String
getForwardDeadLetteredMessagesTo()
String
getForwardTo()
Duration
getLockDuration()
The amount of time that the message is locked by a given receiver so that no other receiver receives the same message.int
getMaxDeliveryCount()
The maximum delivery count of a message before it is dead-lettered.long
getMaxSizeInMB()
String
getPath()
String
getUserMetadata()
int
hashCode()
boolean
isEnableBatchedOperations()
boolean
isEnableDeadLetteringOnMessageExpiration()
Indicates whether this queue has dead letter support when a message expires.boolean
isEnablePartitioning()
boolean
isRequiresDuplicateDetection()
If enabled, duplicate messages having sameIMessage.getMessageId()
and sent to queue within duration ofgetDuplicationDetectionHistoryTimeWindow()
will be discarded.boolean
isRequiresSession()
void
setAuthorizationRules(List<AuthorizationRule> authorizationRules)
void
setAutoDeleteOnIdle(Duration autoDeleteOnIdle)
void
setDefaultMessageTimeToLive(Duration defaultMessageTimeToLive)
void
setDuplicationDetectionHistoryTimeWindow(Duration duplicationDetectionHistoryTimeWindow)
void
setEnableBatchedOperations(boolean enableBatchedOperations)
void
setEnableDeadLetteringOnMessageExpiration(boolean enableDeadLetteringOnMessageExpiration)
void
setEnablePartitioning(boolean enablePartitioning)
void
setEntityStatus(EntityStatus status)
void
setForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo)
void
setForwardTo(String forwardTo)
void
setLockDuration(Duration lockDuration)
Sets The amount of time that the message is locked by a given receiver so that no other receiver receives the same message.void
setMaxDeliveryCount(int maxDeliveryCount)
The maximum delivery count of a message before it is dead-lettered.void
setMaxSizeInMB(long maxSize)
void
setRequiresDuplicateDetection(boolean requiresDuplicateDetection)
void
setRequiresSession(boolean requiresSession)
void
setUserMetadata(String userMetadata)
-
-
-
Constructor Detail
-
QueueDescription
public QueueDescription(String path)
Initializes a new instance of QueueDescription with the specified relative path.- Parameters:
path
- - Path of the topic. Max length is 260 chars. Cannot start or end with a slash. Cannot have restricted characters: '@','?','#','*'
-
-
Method Detail
-
getPath
public String getPath()
- Returns:
- The path of the queue.
-
getLockDuration
public Duration getLockDuration()
The amount of time that the message is locked by a given receiver so that no other receiver receives the same message.- Returns:
- The duration of a peek lock. Default value is 60 seconds.
-
setLockDuration
public void setLockDuration(Duration lockDuration)
Sets The amount of time that the message is locked by a given receiver so that no other receiver receives the same message.- Parameters:
lockDuration
- - The duration of a peek lock. Max value is 5 minutes.
-
getMaxSizeInMB
public long getMaxSizeInMB()
- Returns:
- the maximum size of the queue in megabytes, which is the size of memory allocated for the queue. Default value is 1024.
-
setMaxSizeInMB
public void setMaxSizeInMB(long maxSize)
- Parameters:
maxSize
- - Maximum size of the queue in megabytes, which is the size of memory allocated for the queue.
-
isRequiresDuplicateDetection
public boolean isRequiresDuplicateDetection()
If enabled, duplicate messages having sameIMessage.getMessageId()
and sent to queue within duration ofgetDuplicationDetectionHistoryTimeWindow()
will be discarded.- Returns:
- value indicating if the queue requires guard against duplicate messages.
-
setRequiresDuplicateDetection
public void setRequiresDuplicateDetection(boolean requiresDuplicateDetection)
- Parameters:
requiresDuplicateDetection
- - True if duplicate detection needs to be enabled. See also -isRequiresDuplicateDetection()
-
isRequiresSession
public boolean isRequiresSession()
- Returns:
- boolean that indicates whether the queue supports the concept of session. Sessionful-messages follow FIFO ordering.
-
setRequiresSession
public void setRequiresSession(boolean requiresSession)
- Parameters:
requiresSession
- - True if queue should support sessions.
-
getDefaultMessageTimeToLive
public Duration getDefaultMessageTimeToLive()
Time-To-Live is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used whenIMessage.getTimeToLive()
is not set on a message itself. Messages older than their TimeToLive value will expire and no longer be retained in the message store. Subscribers will be unable to receive expired messages.- Returns:
- The default time to live value for the messages. Default value is
ManagementClientConstants.MAX_DURATION
-
setDefaultMessageTimeToLive
public void setDefaultMessageTimeToLive(Duration defaultMessageTimeToLive)
- Parameters:
defaultMessageTimeToLive
- - The default message time to live value. Value cannot be lower than 1 second. SeegetDefaultMessageTimeToLive()
-
getAutoDeleteOnIdle
public Duration getAutoDeleteOnIdle()
- Returns:
- The idle interval after which the queue is automatically deleted.
Default value is
ManagementClientConstants.MAX_DURATION
-
setAutoDeleteOnIdle
public void setAutoDeleteOnIdle(Duration autoDeleteOnIdle)
- Parameters:
autoDeleteOnIdle
- - The idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes.
-
isEnableDeadLetteringOnMessageExpiration
public boolean isEnableDeadLetteringOnMessageExpiration()
Indicates whether this queue has dead letter support when a message expires.- Returns:
- If true, the expired messages are moved to dead-letter sub-queue. Default value is false.
-
setEnableDeadLetteringOnMessageExpiration
public void setEnableDeadLetteringOnMessageExpiration(boolean enableDeadLetteringOnMessageExpiration)
- Parameters:
enableDeadLetteringOnMessageExpiration
- - True if messages should be dead-lettered on expiration. SeeisEnableDeadLetteringOnMessageExpiration()
-
getDuplicationDetectionHistoryTimeWindow
public Duration getDuplicationDetectionHistoryTimeWindow()
- Returns:
- The duration of duplicate detection history that is maintained by the service. The default value is 1 minute.
-
setDuplicationDetectionHistoryTimeWindow
public void setDuplicationDetectionHistoryTimeWindow(Duration duplicationDetectionHistoryTimeWindow)
- Parameters:
duplicationDetectionHistoryTimeWindow
- - The duration of duplicate detection history that is maintained by the service. Max value is 1 day and minimum is 20 seconds.
-
getMaxDeliveryCount
public int getMaxDeliveryCount()
The maximum delivery count of a message before it is dead-lettered. The delivery count is increased when a message is received inReceiveMode.PEEKLOCK
mode and didn't complete the message before the message lock expired.- Returns:
- Default value is 10.
-
setMaxDeliveryCount
public void setMaxDeliveryCount(int maxDeliveryCount)
The maximum delivery count of a message before it is dead-lettered. The delivery count is increased when a message is received inReceiveMode.PEEKLOCK
mode and didn't complete the message before the message lock expired.- Parameters:
maxDeliveryCount
- - Minimum value is 1.
-
isEnableBatchedOperations
public boolean isEnableBatchedOperations()
- Returns:
- Indicates whether server-side batched operations are enabled. Defaults to true.
-
setEnableBatchedOperations
public void setEnableBatchedOperations(boolean enableBatchedOperations)
- Parameters:
enableBatchedOperations
- - Indicates whether server-side batched operations are enabled.
-
getAuthorizationRules
public List<AuthorizationRule> getAuthorizationRules()
- Returns:
- The
AuthorizationRule
on the queue to control user access at entity level.
-
setAuthorizationRules
public void setAuthorizationRules(List<AuthorizationRule> authorizationRules)
- Parameters:
authorizationRules
- - TheAuthorizationRule
on the queue to control user access at entity level.
-
getEntityStatus
public EntityStatus getEntityStatus()
Gets the status of the entity. When an entity is disabled, that entity cannot send or receive messages.- Returns:
- The current status of the queue (Enabled / Disabled). The default value is Enabled.
-
setEntityStatus
public void setEntityStatus(EntityStatus status)
- Parameters:
status
- - the status of the queue (Enabled / Disabled). When an entity is disabled, that entity cannot send or receive messages.
-
getForwardTo
public String getForwardTo()
- Returns:
- The path of the recipient entity to which all the messages sent to the queue are forwarded to. If set, user cannot manually receive messages from this queue. The destination entity must be an already existing entity.
-
setForwardTo
public void setForwardTo(String forwardTo)
- Parameters:
forwardTo
- - The path of the recipient entity to which all the messages sent to the queue are forwarded to. If set, user cannot manually receive messages from this queue. The destination entity must be an already existing entity.
-
getForwardDeadLetteredMessagesTo
public String getForwardDeadLetteredMessagesTo()
- Returns:
- The path of the recipient entity to which all the dead-lettered messages of this queue are forwarded to. If set, user cannot manually receive dead-lettered messages from this queue. The destination entity must already exist.
-
setForwardDeadLetteredMessagesTo
public void setForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo)
- Parameters:
forwardDeadLetteredMessagesTo
- - The path of the recipient entity to which all the dead-lettered messages of this queue are forwarded to. If set, user cannot manually receive dead-lettered messages from this queue. The destination entity must already exist.
-
isEnablePartitioning
public boolean isEnablePartitioning()
- Returns:
- boolean indicating whether the queue is to be partitioned across multiple message brokers. Defaults to false
-
setEnablePartitioning
public void setEnablePartitioning(boolean enablePartitioning)
- Parameters:
enablePartitioning
- - true if queue is to be partitioned across multiple message brokers.
-
getUserMetadata
public String getUserMetadata()
- Returns:
- Custom metdata that user can associate with the description.
-
setUserMetadata
public void setUserMetadata(String userMetadata)
- Parameters:
userMetadata
- - Custom metdata that user can associate with the description. Cannot be null. Max length is 1024 chars
-
-