Class: Azure::ServiceBus::Queue
- Defined in:
- lib/azure/service_bus/queue.rb
Instance Attribute Summary
Attributes inherited from Resource
#author_name, #description, #id, #name, #published, #updated
Instance Method Summary collapse
-
#dead_lettering_on_message_expiration ⇒ Object
DeadLetteringOnMessageExpiration: True, False.
-
#default_message_time_to_live ⇒ Object
DefaultMessageTimeToLive: XML datetime.
- #default_message_time_to_live=(val) ⇒ Object
-
#duplicate_detection_history_time_window ⇒ Object
DuplicateDetectionHistoryTimeWindow.
- #duplicate_detection_history_time_window=(val) ⇒ Object
-
#enable_batched_operations ⇒ Object
EnableBatchedOperations.
- #enable_batched_operations=(val) ⇒ Object
- #enable_dead_lettering_on_message_expiration=(val) ⇒ Object
-
#initialize(name, options = {}) ⇒ Queue
constructor
Public: Initialize the queue.
-
#lock_duration ⇒ Object
LockDuration: XML datetime.
- #lock_duration=(val) ⇒ Object
-
#max_delivery_count ⇒ Object
MaxDeliveryCount: Number.
- #max_delivery_count=(val) ⇒ Object
-
#max_size_in_megabytes ⇒ Object
MaxSizeInMegaBytes: Number.
- #max_size_in_megabytes=(val) ⇒ Object
-
#message_count ⇒ Object
MessageCount: Number.
- #message_count=(val) ⇒ Object
- #ordered_props ⇒ Object
-
#requires_duplicate_detection ⇒ Object
RequiresDuplicateDetection: True, False.
- #requires_duplicate_detection=(val) ⇒ Object
-
#requires_session ⇒ Object
RequiresSession: True, False.
- #requires_session=(val) ⇒ Object
-
#size_in_bytes ⇒ Object
SizeinBytes: Number.
- #size_in_bytes=(val) ⇒ Object
Methods inherited from Resource
Constructor Details
#initialize(name, options = {}) ⇒ Queue
Public: Initialize the queue.
Attributes
-
name
- A String with the name of the queue. -
options
- The resource options Hash
Options
Accepted key/value pairs in options parameter are:
-
:default_message_time_to_live
- XML datetime. Determines how long a message lives in the associated subscriptions. -
:duplicate_detection_history_time_window
- XML datetime. Specifies the time span during which the Service Bus will detect message duplication. -
:enable_batched_operations
- Boolean. Enables or disables service side batching behavior when performing operations for the specific queue. -
:dead_lettering_on_message_expiration:
- Boolean. This field controls how the Service Bus handles a message whose TTL has expired. -
:lock_duration
- XML datetime. Determines the amount of time in seconds in which a message should be locked for processing by a receiver. -
:max_delivery_count
- Number. A message is automatically deadlettered after this number of deliveries. -
:max_size_in_megabytes
- Number. Specifies the maximum topic size in megabytes -
:message_count
- Number. Displays the number of messages currently in the queue. -
:requires_duplicate_detection
- Boolean. If enabled, the topic will detect duplicate messages within the time span specified by the DuplicateDetectionHistoryTimeWindow property -
:requires_session
- Boolean. If set to true, the queue will be session-aware and only SessionReceiver will be supported. -
:size_in_bytes
- Number. Reflects the actual bytes toward the topic quota that messages in the topic currently occupy.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/azure/service_bus/queue.rb', line 42 def initialize(name, = {}) = {} ["DefaultMessageTimeToLive"] = [:default_message_time_to_live].to_s if .has_key?(:default_message_time_to_live) ["DuplicateDetectionHistoryTimeWindow"] = [:duplicate_detection_history_time_window].to_s if .has_key?(:duplicate_detection_history_time_window) ["EnableBatchedOperations"] = [:enable_batched_operations].to_s if .has_key?(:enable_batched_operations) ["DeadLetteringOnMessageExpiration"] = [:dead_lettering_on_message_expiration].to_s if .has_key?(:dead_lettering_on_message_expiration) ["LockDuration"] = [:lock_duration].to_s if .has_key?(:lock_duration) ["MaxDeliveryCount"] = [:max_delivery_count].to_s if .has_key?(:max_delivery_count) ["MaxSizeInMegabytes"] = [:max_size_in_megabytes].to_s if .has_key?(:max_size_in_megabytes) ["MessageCount"] = [:message_count].to_s if .has_key?(:message_count) ["RequiresDuplicateDetection"] = [:requires_duplicate_detection].to_s if .has_key?(:requires_duplicate_detection) ["RequiresSession"] = [:requires_session].to_s if .has_key?(:requires_session) ["SizeInBytes"] = [:size_in_bytes].to_s if .has_key?(:size_in_bytes) super(name, ) end |
Instance Method Details
#dead_lettering_on_message_expiration ⇒ Object
DeadLetteringOnMessageExpiration: True, False
This field controls how the Service Bus handles a message whose TTL has expired. If it is enabled and a message expires, the Service Bus moves the message from the queue into the queue’s dead-letter sub-queue. If disabled, message will be permanently deleted from the queue. Settable only at queue creation time.
Default: false
107 108 109 |
# File 'lib/azure/service_bus/queue.rb', line 107 def to_bool description['DeadLetteringOnMessageExpiration'] end |
#default_message_time_to_live ⇒ Object
DefaultMessageTimeToLive: XML datetime
Depending on whether DeadLettering is enabled, a message is automatically moved to the DeadLetterQueue or deleted if it has been stored in the queue for longer than the specified time. This value is overwritten by a TTL specified on the message if and only if the message TTL is smaller than the TTL set on the queue. This value is immutable after the Queue has been created:
Range: 1 second - TimeSpan.MaxValue Default: TimeSpan.MaxValue
164 165 166 |
# File 'lib/azure/service_bus/queue.rb', line 164 def to_interval description['DefaultMessageTimeToLive'] end |
#default_message_time_to_live=(val) ⇒ Object
168 169 170 |
# File 'lib/azure/service_bus/queue.rb', line 168 def (val) _set 'DefaultMessageTimeToLive', val end |
#duplicate_detection_history_time_window ⇒ Object
DuplicateDetectionHistoryTimeWindow
Specifies the time span during which the Service Bus will detect message duplication.
Range: 1 second - 7 days Default: 10 minutes
191 192 193 |
# File 'lib/azure/service_bus/queue.rb', line 191 def duplicate_detection_history_time_window to_interval description['DuplicateDetectionHistoryTimeWindow'] end |
#duplicate_detection_history_time_window=(val) ⇒ Object
195 196 197 |
# File 'lib/azure/service_bus/queue.rb', line 195 def duplicate_detection_history_time_window=(val) _set 'DuplicateDetectionHistoryTimeWindow', val end |
#enable_batched_operations ⇒ Object
EnableBatchedOperations
Enables or disables service side batching behavior when performing operations for the specific queue. When enabled, service bus will collect/batch multiple operations to the backend to be more connection efficient.
If user wants lower operation latency then they can disable this feature.
205 206 207 |
# File 'lib/azure/service_bus/queue.rb', line 205 def enable_batched_operations to_bool description['EnableBatchedOperations'] end |
#enable_batched_operations=(val) ⇒ Object
209 210 211 |
# File 'lib/azure/service_bus/queue.rb', line 209 def enable_batched_operations=(val) _set 'EnableBatchedOperations', val end |
#enable_dead_lettering_on_message_expiration=(val) ⇒ Object
111 112 113 |
# File 'lib/azure/service_bus/queue.rb', line 111 def (val) _set 'DeadLetteringOnMessageExpiration', val end |
#lock_duration ⇒ Object
LockDuration: XML datetime
Determines the amount of time in seconds in which a message should be locked for processing by a receiver. After this period, the message is unlocked and available for consumption by the next receiver. Settable only at queue creation time:
Range: 0 - 5 minutes. 0 means that the message is not locked Default: 30 seconds
78 79 80 |
# File 'lib/azure/service_bus/queue.rb', line 78 def lock_duration to_interval description['LockDuration'] end |
#lock_duration=(val) ⇒ Object
82 83 84 |
# File 'lib/azure/service_bus/queue.rb', line 82 def lock_duration=(val) _set 'LockDuration', val end |
#max_delivery_count ⇒ Object
MaxDeliveryCount: Number
A message is automatically deadlettered after this number of deliveries.
118 119 120 |
# File 'lib/azure/service_bus/queue.rb', line 118 def max_delivery_count to_i description['MaxDeliveryCount'] end |
#max_delivery_count=(val) ⇒ Object
122 123 124 |
# File 'lib/azure/service_bus/queue.rb', line 122 def max_delivery_count=(val) _set 'MaxDeliveryCount', val end |
#max_size_in_megabytes ⇒ Object
MaxSizeInMegaBytes: Number
Specifies the maximum queue size in megabytes. Any attempt to enqueue a message that will cause the queue to exceed this value will fail. You can only set this parameter at queue creation time using the following values:
Range: 1 - 1024 (valid values are 1024, 2048, 3072, 4096, 5120) Default: 1*1024 (valid values are 1024, 2048, 3072, 4096, 5120)
133 134 135 |
# File 'lib/azure/service_bus/queue.rb', line 133 def max_size_in_megabytes to_i description['MaxSizeInMegabytes'] end |
#max_size_in_megabytes=(val) ⇒ Object
137 138 139 |
# File 'lib/azure/service_bus/queue.rb', line 137 def max_size_in_megabytes=(val) _set 'MaxSizeInMegabytes', val end |
#message_count ⇒ Object
MessageCount: Number
Displays the number of messages currently in the queue.
62 63 64 |
# File 'lib/azure/service_bus/queue.rb', line 62 def to_i description['MessageCount'] end |
#message_count=(val) ⇒ Object
66 67 68 |
# File 'lib/azure/service_bus/queue.rb', line 66 def (val) _set 'MessageCount', val end |
#ordered_props ⇒ Object
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/azure/service_bus/queue.rb', line 213 def ordered_props [ 'LockDuration', 'MaxSizeInMegabytes', 'RequiresDuplicateDetection', 'RequiresSession', 'DefaultMessageTimeToLive', 'DeadLetteringOnMessageExpiration', 'DuplicateDetectionHistoryTimeWindow', 'MaxDeliveryCount', 'EnableBatchedOperations', 'SizeInBytes', 'MessageCount' ] end |
#requires_duplicate_detection ⇒ Object
RequiresDuplicateDetection: True, False
Settable only at queue creation time.
Default for durable queue: false
177 178 179 |
# File 'lib/azure/service_bus/queue.rb', line 177 def requires_duplicate_detection to_bool description['RequiresDuplicateDetection'] end |
#requires_duplicate_detection=(val) ⇒ Object
181 182 183 |
# File 'lib/azure/service_bus/queue.rb', line 181 def requires_duplicate_detection=(val) _set 'RequiresDuplicateDetection', val end |
#requires_session ⇒ Object
RequiresSession: True, False
Settable only at queue creation time. If set to true, the queue will be session-aware and only SessionReceiver will be supported. Session-aware queues are not supported through REST.
Default for durable queue: false
92 93 94 |
# File 'lib/azure/service_bus/queue.rb', line 92 def requires_session to_bool description['RequiresSession'] end |
#requires_session=(val) ⇒ Object
96 97 98 |
# File 'lib/azure/service_bus/queue.rb', line 96 def requires_session=(val) _set 'RequiresSession', val end |
#size_in_bytes ⇒ Object
SizeinBytes: Number
Reflects the actual bytes that messages in the queue currently occupy toward the queue’s quota.
Range: 0 - MaxTopicSizeinMegaBytes
146 147 148 |
# File 'lib/azure/service_bus/queue.rb', line 146 def size_in_bytes to_i description['SizeInBytes'] end |
#size_in_bytes=(val) ⇒ Object
150 151 152 |
# File 'lib/azure/service_bus/queue.rb', line 150 def size_in_bytes=(val) _set 'SizeInBytes', val end |