Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-queue/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ should be imported from azure.storage.queue.aio
- `timeout` etc.
- `QueueMessage` has had its parameters renamed from `insertion_time`, `time_next_visible`, `expiration_time`
to `inserted_on`, `next_visible_on`, `expires_on`, respectively.

- `enqueue_message` is now called `send_message`.

**New features**

Expand Down
24 changes: 12 additions & 12 deletions sdk/storage/azure-storage-queue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ The Storage Queues SDK provides two different clients to interact with the Queue
can also be retrieved using the `get_queue_client` function.
2. **QueueClient** - this client represents interaction with a specific
queue, although that queue need not exist yet. It provides operations to create, delete, or
configure queues and includes operations to enqueue, receive, peak, delete, and update messages in the queue.
configure queues and includes operations to send, receive, peak, delete, and update messages in the queue.

#### Messages

Once you've initialized a Client, you can use the following operations to work with the messages in the queue:
* **Enqueue** - Adds a message to the queue and optionally sets a visibility timeout for the message.
* **Send** - Adds a message to the queue and optionally sets a visibility timeout for the message.
* **Receive** - Retrieves a message from the queue and makes it invisible to other consumers.
* **Peek** - Retrieves a message from the front of the queue, without changing the message visibility.
* **Update** - Updates the visibility timeout of a message and/or the message contents.
Expand All @@ -92,7 +92,7 @@ The following sections provide several code snippets covering some of the most c

* [Client creation with a connection string](#client-creation-with-a-connection-string)
* [Create a queue](#create-a-queue)
* [Enqueue messages](#enqueue-messages)
* [Send messages](#send-messages)
* [Receive messages](#receive-messages)


Expand Down Expand Up @@ -121,24 +121,24 @@ from azure.storage.queue.aio import QueueClient
queue = QueueClient.from_connection_string(conn_str="my_connection_string", queue="myqueue")
await queue.create_queue()
```
### Enqueue messages
Enqueue a message in your queue.
### Send messages
Send a message in your queue.

```python
from azure.storage.queue import QueueClient

queue = QueueClient.from_connection_string(conn_str="my_connection_string", queue="myqueue")
queue.enqueue_message("I'm using queues!")
queue.enqueue_message("This is my second message")
queue.send_message("I'm using queues!")
queue.send_message("This is my second message")
```
Enqueue messages with an async client
Send messages with an async client
```python
from azure.storage.queue.aio import QueueClient

queue = QueueClient.from_connection_string(conn_str="my_connection_string", queue="myqueue")
await asyncio.gather(
queue.enqueue_message("I'm using queues!"),
queue.enqueue_message("This is my second message"))
queue.send_message("I'm using queues!"),
queue.send_message("This is my second message"))
```

### Receive messages
Expand Down Expand Up @@ -196,7 +196,7 @@ Several Storage Queues Python SDK samples are available to you in the SDK's GitH
* [`test_queue_samples_hello_world.py`](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-queue/tests/test_queue_samples_hello_world.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-queue/tests/test_queue_samples_hello_world_async.py)) - Examples found in this article:
* Client creation
* Create a queue
* Enqueue messages
* Send messages
* Receive messages

* [`test_queue_samples_authentication.py`](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-queue/tests/test_queue_samples_authentication.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-queue/tests/test_queue_samples_authentication_async.py)) - Examples for authenticating and creating the client:
Expand All @@ -214,7 +214,7 @@ Several Storage Queues Python SDK samples are available to you in the SDK's GitH
* [`test_queue_samples_message.py`](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-queue/tests/test_queue_samples_message.py) ([async version](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/storage/azure-storage-queue/tests/test_queue_samples_message_async.py)) - Examples for working with queues and messages:
* Set an access policy
* Get and set queue metadata
* Enqueue and receive messages
* Send and receive messages
* Delete specified messages and clear all messages
* Peek and update messages

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ async def set_queue_access_policy(self, signed_identifiers, **kwargs): # type:
process_storage_error(error)

@distributed_trace_async
async def enqueue_message( # type: ignore
async def send_message( # type: ignore
self,
content, # type: Any
**kwargs # type: Optional[Any]
Expand Down Expand Up @@ -370,11 +370,11 @@ async def enqueue_message( # type: ignore
.. admonition:: Example:

.. literalinclude:: ../tests/test_queue_samples_message_async.py
:start-after: [START async_enqueue_messages]
:end-before: [END async_enqueue_messages]
:start-after: [START async_send_messages]
:end-before: [END async_send_messages]
:language: python
:dedent: 12
:caption: Enqueue messages.
:caption: Send messages.
"""
visibility_timeout = kwargs.pop('visibility_timeout', None)
time_to_live = kwargs.pop('time_to_live', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def set_queue_access_policy(self, signed_identifiers, **kwargs):
process_storage_error(error)

@distributed_trace
def enqueue_message( # type: ignore
def send_message( # type: ignore
self, content, # type: Any
**kwargs # type: Optional[Any]
):
Expand Down Expand Up @@ -524,11 +524,11 @@ def enqueue_message( # type: ignore
.. admonition:: Example:

.. literalinclude:: ../tests/test_queue_samples_message.py
:start-after: [START enqueue_messages]
:end-before: [END enqueue_messages]
:start-after: [START send_messages]
:end-before: [END send_messages]
:language: python
:dedent: 12
:caption: Enqueue messages.
:caption: Send messages.
"""
visibility_timeout = kwargs.pop('visibility_timeout', None)
time_to_live = kwargs.pop('time_to_live', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ interactions:
Content-Length:
- '0'
User-Agent:
- azsdk-python-storage-queue/12.0.0b4 Python/3.7.3 (Windows-10-10.0.18362-SP0)
- azsdk-python-storage-queue/12.0.0b4 Python/3.7.3 (Windows-10-10.0.17763-SP0)
x-ms-date:
- Mon, 14 Oct 2019 17:42:19 GMT
- Wed, 16 Oct 2019 06:48:07 GMT
x-ms-version:
- '2018-03-28'
method: PUT
Expand All @@ -25,7 +25,7 @@ interactions:
content-length:
- '0'
date:
- Mon, 14 Oct 2019 17:42:15 GMT
- Wed, 16 Oct 2019 06:48:07 GMT
server:
- Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0
x-ms-version:
Expand All @@ -49,24 +49,24 @@ interactions:
Content-Type:
- application/xml; charset=utf-8
User-Agent:
- azsdk-python-storage-queue/12.0.0b4 Python/3.7.3 (Windows-10-10.0.18362-SP0)
- azsdk-python-storage-queue/12.0.0b4 Python/3.7.3 (Windows-10-10.0.17763-SP0)
x-ms-date:
- Mon, 14 Oct 2019 17:42:20 GMT
- Wed, 16 Oct 2019 06:48:08 GMT
x-ms-version:
- '2018-03-28'
method: POST
uri: https://pyacrstorage9c250b25.queue.core.windows.net/pythonqueue9c250b25/messages
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><QueueMessagesList><QueueMessage><MessageId>2ed39c4e-3a6a-4328-b26e-3d47ef45067a</MessageId><InsertionTime>Mon,
14 Oct 2019 17:42:16 GMT</InsertionTime><ExpirationTime>Mon, 21 Oct 2019 17:42:16
GMT</ExpirationTime><PopReceipt>AgAAAAMAAAAAAAAA1PYYuLaC1QE=</PopReceipt><TimeNextVisible>Mon,
14 Oct 2019 17:42:16 GMT</TimeNextVisible></QueueMessage></QueueMessagesList>"
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><QueueMessagesList><QueueMessage><MessageId>be04f687-b93c-4258-8d25-aa95a7213bfc</MessageId><InsertionTime>Wed,
16 Oct 2019 06:48:08 GMT</InsertionTime><ExpirationTime>Wed, 23 Oct 2019 06:48:08
GMT</ExpirationTime><PopReceipt>AgAAAAMAAAAAAAAACdlBq+2D1QE=</PopReceipt><TimeNextVisible>Wed,
16 Oct 2019 06:48:08 GMT</TimeNextVisible></QueueMessage></QueueMessagesList>"
headers:
content-type:
- application/xml
date:
- Mon, 14 Oct 2019 17:42:16 GMT
- Wed, 16 Oct 2019 06:48:07 GMT
server:
- Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0
transfer-encoding:
Expand All @@ -86,25 +86,25 @@ interactions:
Connection:
- keep-alive
User-Agent:
- azsdk-python-storage-queue/12.0.0b4 Python/3.7.3 (Windows-10-10.0.18362-SP0)
- azsdk-python-storage-queue/12.0.0b4 Python/3.7.3 (Windows-10-10.0.17763-SP0)
x-ms-date:
- Mon, 14 Oct 2019 17:42:20 GMT
- Wed, 16 Oct 2019 06:48:08 GMT
x-ms-version:
- '2018-03-28'
method: GET
uri: https://pyacrstorage9c250b25.queue.core.windows.net/pythonqueue9c250b25/messages?peekonly=true&st=2019-10-14T17%3A37%3A20Z&se=2019-10-14T18%3A42%3A20Z&sp=r&sv=2018-03-28&ss=q&srt=o&sig=KlW5dNogfEs3vFfAVtYWPKqJrAIF2GerVf8APb/Zf5I%3D
uri: https://pyacrstorage9c250b25.queue.core.windows.net/pythonqueue9c250b25/messages?peekonly=true&st=2019-10-16T06%3A43%3A08Z&se=2019-10-16T07%3A48%3A08Z&sp=r&sv=2018-03-28&ss=q&srt=o&sig=wpUYEjYfIjW%2BHV6awhFphqsB/fY5p5RPpjDP8QGY3yw%3D
response:
body:
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><QueueMessagesList><QueueMessage><MessageId>2ed39c4e-3a6a-4328-b26e-3d47ef45067a</MessageId><InsertionTime>Mon,
14 Oct 2019 17:42:16 GMT</InsertionTime><ExpirationTime>Mon, 21 Oct 2019 17:42:16
string: "\uFEFF<?xml version=\"1.0\" encoding=\"utf-8\"?><QueueMessagesList><QueueMessage><MessageId>be04f687-b93c-4258-8d25-aa95a7213bfc</MessageId><InsertionTime>Wed,
16 Oct 2019 06:48:08 GMT</InsertionTime><ExpirationTime>Wed, 23 Oct 2019 06:48:08
GMT</ExpirationTime><DequeueCount>0</DequeueCount><MessageText>message1</MessageText></QueueMessage></QueueMessagesList>"
headers:
cache-control:
- no-cache
content-type:
- application/xml
date:
- Mon, 14 Oct 2019 17:42:16 GMT
- Wed, 16 Oct 2019 06:48:08 GMT
server:
- Windows-Azure-Queue/1.0 Microsoft-HTTPAPI/2.0
transfer-encoding:
Expand Down
Loading