queue
Creates, updates, deletes, gets or lists a queue resource.
Overview
| Name | queue |
| Type | Resource |
| Id | azure.storage_queue.queue |
Fields
The following fields are returned by SELECT queries:
- get_access_policy
| Name | Datatype | Description |
|---|---|---|
items_ | array | The list of signed identifiers. Required. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_access_policy | select | account | timeout | Gets the access policy for the specified queue. |
clear | delete | account | timeout | Deletes all messages from the specified queue. |
get_properties | exec | account | timeout | Returns all user-defined metadata and system properties for the specified queue. |
set_metadata | exec | account | timeout, x-ms-meta | Sets user-defined metadata for the specified queue. |
set_access_policy | exec | account, items_ | timeout | Sets the permissions for the specified queue. |
receive_messages | exec | account | numofmessages, visibilitytimeout, timeout | Retrieves one or more messages from the front of the queue. |
send_message | exec | account, messageText | visibilitytimeout, messagettl, timeout | Adds a new message to the back of the message queue. A visibility timeout can also be specified to make the message invisible until the visibility timeout expires. |
peek_messages | exec | account | numofmessages, timeout | Retrieves one or more messages from the front of the queue, but does not alter the visibility of the message. |
update_message | exec | message_id, popreceipt, visibilitytimeout, account, messageText | timeout | Updates the visibility timeout of a message. This operation can also be used to update the contents of a message. |
delete_message | exec | message_id, popreceipt, account | timeout | Deletes the specified message. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account | string | Storage account name. (default: ) |
message_id | string | The ID of the queue message. Required. |
popreceipt | string | An opaque value required to delete the message. If deletion fails using this PopReceipt then the message has been dequeued by another client. Required. |
visibilitytimeout | integer | Specifies the new visibility timeout value, in seconds, relative to server time. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time. Required. |
messagettl | integer | Specifies the time-to-live interval for the message, in seconds. Prior to version 2017-07-29, the maximum time-to-live allowed is 7 days. For version 2017-07-29 or later, the maximum time-to-live can be any positive number, as well as -1 indicating that the message does not expire. If this parameter is omitted, the default time-to-live is 7 days. Default value is None. |
numofmessages | integer | A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. If fewer are visible, the visible messages are returned. By default, a single message is retrieved from the queue with this operation. Default value is None. |
timeout | integer | The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Queue Service Operations.. Default value is None. |
visibilitytimeout | integer | Specifies the new visibility timeout value, in seconds, relative to server time. A specified value must be larger than or equal to 1 second, and cannot be larger than 7 days. The visibility timeout of a message can be set to a value later than the expiry time. Default value is None. |
x-ms-meta | string | The metadata headers. Default value is None. |
SELECT examples
- get_access_policy
Gets the access policy for the specified queue.
SELECT
items_
FROM azure.storage_queue.queue
WHERE account = '{{ account }}' -- required
AND timeout = '{{ timeout }}'
;
DELETE examples
- clear
Deletes all messages from the specified queue.
DELETE FROM azure.storage_queue.queue
WHERE account = '{{ account }}' --required
AND timeout = '{{ timeout }}'
;
Lifecycle Methods
- get_properties
- set_metadata
- set_access_policy
- receive_messages
- send_message
- peek_messages
- update_message
- delete_message
Returns all user-defined metadata and system properties for the specified queue.
EXEC azure.storage_queue.queue.get_properties
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
;
Sets user-defined metadata for the specified queue.
EXEC azure.storage_queue.queue.set_metadata
@account='{{ account }}' --required,
@timeout='{{ timeout }}',
@x-ms-meta='{{ x-ms-meta }}'
;
Sets the permissions for the specified queue.
EXEC azure.storage_queue.queue.set_access_policy
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
@@json=
'{
"items_": "{{ items_ }}"
}'
;
Retrieves one or more messages from the front of the queue.
EXEC azure.storage_queue.queue.receive_messages
@account='{{ account }}' --required,
@numofmessages='{{ numofmessages }}',
@visibilitytimeout='{{ visibilitytimeout }}',
@timeout='{{ timeout }}'
;
Adds a new message to the back of the message queue. A visibility timeout can also be specified to make the message invisible until the visibility timeout expires.
EXEC azure.storage_queue.queue.send_message
@account='{{ account }}' --required,
@visibilitytimeout='{{ visibilitytimeout }}',
@messagettl='{{ messagettl }}',
@timeout='{{ timeout }}'
@@json=
'{
"messageText": "{{ messageText }}"
}'
;
Retrieves one or more messages from the front of the queue, but does not alter the visibility of the message.
EXEC azure.storage_queue.queue.peek_messages
@account='{{ account }}' --required,
@numofmessages='{{ numofmessages }}',
@timeout='{{ timeout }}'
;
Updates the visibility timeout of a message. This operation can also be used to update the contents of a message.
EXEC azure.storage_queue.queue.update_message
@message_id='{{ message_id }}' --required,
@popreceipt='{{ popreceipt }}' --required,
@visibilitytimeout='{{ visibilitytimeout }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
@@json=
'{
"messageText": "{{ messageText }}"
}'
;
Deletes the specified message.
EXEC azure.storage_queue.queue.delete_message
@message_id='{{ message_id }}' --required,
@popreceipt='{{ popreceipt }}' --required,
@account='{{ account }}' --required,
@timeout='{{ timeout }}'
;