SubscriptionDescription Class

  • java.lang.Object
    • com.microsoft.azure.servicebus.management.UnknownPropertiesHolder
      • com.microsoft.azure.servicebus.management.SubscriptionDescription

public class SubscriptionDescription
extends com.microsoft.azure.servicebus.management.UnknownPropertiesHolder

Represents the metadata description of the subscription.

Constructor Summary

Constructor Description
SubscriptionDescription(String topicPath, String subscriptionName)

Initializes a new instance of SubscriptionDescription with the specified relative path.

Method Summary

Modifier and Type Method and Description
boolean equals(Object o)
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.

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.

String getPath()
String getSubscriptionName()
String getTopicPath()
String getUserMetadata()
int hashCode()
boolean isEnableBatchedOperations()
boolean isEnableDeadLetteringOnFilterEvaluationException()
boolean isEnableDeadLetteringOnMessageExpiration()

Indicates whether this subscription has dead letter support when a message expires.

boolean isRequiresSession()
void setAutoDeleteOnIdle(Duration autoDeleteOnIdle)
void setDefaultMessageTimeToLive(Duration defaultMessageTimeToLive)
void setEnableBatchedOperations(boolean enableBatchedOperations)
void setEnableDeadLetteringOnFilterEvaluationException(boolean enableDeadLetteringOnFilterEvaluationException)
void setEnableDeadLetteringOnMessageExpiration(boolean enableDeadLetteringOnMessageExpiration)
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 setRequiresSession(boolean requiresSession)
void setUserMetadata(String userMetadata)

Methods inherited from java.lang.Object

Constructor Details

SubscriptionDescription

public SubscriptionDescription(String topicPath, String subscriptionName)

Initializes a new instance of SubscriptionDescription with the specified relative path.

Parameters:

topicPath -
  • Path of the topic Max length is 260 chars. Cannot start or end with a slash. Cannot have restricted characters: '@','?','#','*'
subscriptionName -
  • Name of the subscription Max length is 50 chars. Cannot have restricted characters: '@','?','#','*','/'

Method Details

equals

public boolean equals(Object o)

Overrides:

SubscriptionDescription.equals(Object o)

Parameters:

o

getAutoDeleteOnIdle

public Duration getAutoDeleteOnIdle()

Returns:

The idle interval after which the subscription is automatically deleted. Default value is MAX_DURATION

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 when 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 MAX_DURATION

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.

getForwardDeadLetteredMessagesTo

public String getForwardDeadLetteredMessagesTo()

Returns:

The path of the recipient entity to which all the dead-lettered messages of this subscription are forwarded to. If set, user cannot manually receive dead-lettered messages from this subscription. The destination entity must already exist.

getForwardTo

public String getForwardTo()

Returns:

The path of the recipient entity to which all the messages sent to the subscription are forwarded to. If set, user cannot manually receive messages from this subscription. The destination entity must be an already existing entity.

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.

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 in PEEKLOCK mode and didn't complete the message before the message lock expired.

Returns:

Default value is 10.

getPath

public String getPath()

Returns:

the path of the subscription, including the topic.

getSubscriptionName

public String getSubscriptionName()

Returns:

the subscription name.

getTopicPath

public String getTopicPath()

Returns:

the path of the topic.

getUserMetadata

public String getUserMetadata()

Returns:

Custom metdata that user can associate with the description.

hashCode

public int hashCode()

Overrides:

SubscriptionDescription.hashCode()

isEnableBatchedOperations

public boolean isEnableBatchedOperations()

Returns:

Indicates whether server-side batched operations are enabled. Defaults to true.

isEnableDeadLetteringOnFilterEvaluationException

public boolean isEnableDeadLetteringOnFilterEvaluationException()

Returns:

boolean indicating whether messages need to be forwarded to dead-letter subqueue when subscription rule evaluation fails. Default value is true.

isEnableDeadLetteringOnMessageExpiration

public boolean isEnableDeadLetteringOnMessageExpiration()

Indicates whether this subscription has dead letter support when a message expires.

Returns:

If true, the expired messages are moved to dead-letter subqueue. Default value is false.

isRequiresSession

public boolean isRequiresSession()

Returns:

This indicates whether the subscription supports the concept of session. Sessionful-messages follow FIFO ordering.

setAutoDeleteOnIdle

public void setAutoDeleteOnIdle(Duration autoDeleteOnIdle)

Parameters:

autoDeleteOnIdle -
  • The idle interval after which the subscription is automatically deleted. The minimum duration is 5 minutes.

setDefaultMessageTimeToLive

public void setDefaultMessageTimeToLive(Duration defaultMessageTimeToLive)

Parameters:

defaultMessageTimeToLive -

setEnableBatchedOperations

public void setEnableBatchedOperations(boolean enableBatchedOperations)

Parameters:

enableBatchedOperations -
  • Indicates whether server-side batched operations are enabled.

setEnableDeadLetteringOnFilterEvaluationException

public void setEnableDeadLetteringOnFilterEvaluationException(boolean enableDeadLetteringOnFilterEvaluationException)

Parameters:

enableDeadLetteringOnFilterEvaluationException -

setEnableDeadLetteringOnMessageExpiration

public void setEnableDeadLetteringOnMessageExpiration(boolean enableDeadLetteringOnMessageExpiration)

Parameters:

enableDeadLetteringOnMessageExpiration -

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.

setForwardDeadLetteredMessagesTo

public void setForwardDeadLetteredMessagesTo(String forwardDeadLetteredMessagesTo)

Parameters:

forwardDeadLetteredMessagesTo -
  • The path of the recipient entity to which all the dead-lettered messages of this subscription are forwarded to. If set, user cannot manually receive dead-lettered messages from this subscription. The destination entity must already exist.

setForwardTo

public void setForwardTo(String forwardTo)

Parameters:

forwardTo -
  • The path of the recipient entity to which all the messages sent to the subscription are forwarded to. If set, user cannot manually receive messages from this subscription. The destination entity must be an already existing entity.

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.

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 in PEEKLOCK mode and didn't complete the message before the message lock expired.

Parameters:

maxDeliveryCount -
  • Minimum value is 1.

setRequiresSession

public void setRequiresSession(boolean requiresSession)

Parameters:

requiresSession -
  • Set to true if subscription should support sessions.

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

Applies to