Skip to content

Commit 531abb4

Browse files
Merge pull request #246019 from pauljewellmsft/pauljewell-queue-update
Update links for queue samples
2 parents 677d78c + e6e1827 commit 531abb4

File tree

3 files changed

+9
-55
lines changed

3 files changed

+9
-55
lines changed

articles/storage/queues/queues-v11-samples-dotnet.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: pauljewellmsft
77
ms.service: azure-queue-storage
88
ms.custom: devx-track-dotnet
99
ms.topic: how-to
10-
ms.date: 04/26/2023
10+
ms.date: 07/24/2023
1111
ms.author: pauljewell
1212
---
1313

@@ -17,9 +17,9 @@ This article shows code samples that use version 11.x of the Azure Queue Storage
1717

1818
[!INCLUDE [storage-v11-sdk-support-retirement](../../../includes/storage-v11-sdk-support-retirement.md)]
1919

20-
## Create a Queue Storage client
20+
For code samples using the latest version 12.x client library version, see [Quickstart: Azure Queue Storage client library for .NET](storage-quickstart-queues-dotnet.md).
2121

22-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
22+
## Create a Queue Storage client
2323

2424
The [`CloudQueueClient`](/dotnet/api/microsoft.azure.storage.queue.cloudqueueclient?view=azure-dotnet-legacy&preserve-view=true) class enables you to retrieve queues stored in Queue Storage. Here's one way to create the service client:
2525

@@ -34,8 +34,6 @@ CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
3434

3535
## Create a queue
3636

37-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
38-
3937
This example shows how to create a queue:
4038

4139
```csharp
@@ -55,8 +53,6 @@ queue.CreateIfNotExists();
5553

5654
## Insert a message into a queue
5755

58-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
59-
6056
To insert a message into an existing queue, first create a new [`CloudQueueMessage`](/dotnet/api/microsoft.azure.storage.queue.cloudqueuemessage?view=azure-dotnet-legacy&preserve-view=true). Next, call the [`AddMessage`](/dotnet/api/microsoft.azure.storage.queue.cloudqueue.addmessage?view=azure-dotnet-legacy&preserve-view=true) method. A `CloudQueueMessage` can be created from either a string (in UTF-8 format) or a byte array. The following code example creates a queue (if it doesn't already exist) and inserts the message `Hello, World`:
6157

6258
```csharp
@@ -80,8 +76,6 @@ queue.AddMessage(message);
8076

8177
## Peek at the next message
8278

83-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
84-
8579
You can peek at the message in the front of a queue without removing it from the queue by calling the [`PeekMessage`](/dotnet/api/microsoft.azure.storage.queue.cloudqueue.peekmessage?view=azure-dotnet-legacy&preserve-view=true) method.
8680

8781
```csharp
@@ -104,8 +98,6 @@ Console.WriteLine(peekedMessage.AsString);
10498

10599
## Change the contents of a queued message
106100

107-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
108-
109101
```csharp
110102
// Retrieve storage account from connection string.
111103
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
@@ -127,8 +119,6 @@ queue.UpdateMessage(message,
127119

128120
## Dequeue the next message
129121

130-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
131-
132122
Your code dequeues a message from a queue in two steps. When you call [`GetMessage`](/dotnet/api/microsoft.azure.storage.queue.cloudqueue.getmessage?view=azure-dotnet-legacy&preserve-view=true), you get the next message in a queue. A message returned from `GetMessage` becomes invisible to any other code reading messages from this queue. By default, this message stays invisible for 30 seconds. To finish removing the message from the queue, you must also call [`DeleteMessage`](/dotnet/api/microsoft.azure.storage.queue.cloudqueue.deletemessage?view=azure-dotnet-legacy&preserve-view=true). This two-step process of removing a message assures that if your code fails to process a message due to hardware or software failure, another instance of your code can get the same message and try again. Your code calls `DeleteMessage` right after the message has been processed.
133123

134124
```csharp
@@ -151,8 +141,6 @@ queue.DeleteMessage(retrievedMessage);
151141

152142
## Use the async-await pattern with common Queue Storage APIs
153143

154-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
155-
156144
```csharp
157145
// Create the queue if it doesn't already exist
158146
if(await queue.CreateIfNotExistsAsync())
@@ -182,8 +170,6 @@ Console.WriteLine("Deleted message");
182170

183171
## Use additional options for dequeuing messages
184172

185-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
186-
187173
The following code example uses the [`GetMessages`](/dotnet/api/microsoft.azure.storage.queue.cloudqueue.getmessages?view=azure-dotnet-legacy&preserve-view=true) method to get 20 messages in one call. Then it processes each message using a `foreach` loop. It also sets the invisibility timeout to five minutes for each message. The timeout starts for all messages at the same time, so after five minutes have passed since the call to `GetMessages`, any messages that haven't been deleted will become visible again.
188174

189175
```csharp
@@ -206,8 +192,6 @@ foreach (CloudQueueMessage message in queue.GetMessages(20, TimeSpan.FromMinutes
206192

207193
## Get the queue length
208194

209-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
210-
211195
You can get an estimate of the number of messages in a queue. The [`FetchAttributes`](/dotnet/api/microsoft.azure.storage.queue.cloudqueue.fetchattributes?view=azure-dotnet-legacy&preserve-view=true) method returns queue attributes including the message count. The [`ApproximateMessageCount`](/dotnet/api/microsoft.azure.storage.queue.cloudqueue.approximatemessagecount?view=azure-dotnet-legacy&preserve-view=true) property returns the last value retrieved by the `FetchAttributes` method, without calling Queue Storage.
212196

213197
```csharp
@@ -233,8 +217,6 @@ Console.WriteLine("Number of messages in queue: " + cachedMessageCount);
233217

234218
## Delete a queue
235219

236-
Related article: [Get started with Azure Queue Storage using .NET](storage-quickstart-queues-dotnet.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
237-
238220
To delete a queue and all the messages contained in it, call the [`Delete`](/dotnet/api/microsoft.azure.storage.queue.cloudqueue.delete?view=azure-dotnet-legacy&preserve-view=true) method on the queue object.
239221

240222
```csharp

articles/storage/queues/queues-v2-samples-python.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: pauljewellmsft
77
ms.service: azure-queue-storage
88
ms.custom: devx-track-python
99
ms.topic: how-to
10-
ms.date: 04/26/2023
10+
ms.date: 07/24/2023
1111
ms.author: pauljewell
1212
---
1313

@@ -17,9 +17,9 @@ This article shows code samples that use version 2 of the Azure Queue Storage cl
1717

1818
[!INCLUDE [storage-v11-sdk-support-retirement](../../../includes/storage-v11-sdk-support-retirement.md)]
1919

20-
## Create a queue
20+
For code samples using the latest version 12.x client library version, see [Quickstart: Azure Queue Storage client library for Python](storage-quickstart-queues-python.md).
2121

22-
Related article: [Get started with Azure Queue Storage using Python](storage-quickstart-queues-python.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2C)
22+
## Create a queue
2323

2424
Add the following `import` directives:
2525

@@ -61,8 +61,6 @@ queue_service.decode_function = QueueMessageFormat.binary_base64decode
6161

6262
## Insert a message into a queue
6363

64-
Related article: [Get started with Azure Queue Storage using Python](storage-quickstart-queues-python.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
65-
6664
To insert a message into a queue, use the [`put_message`](/azure/developer/python/sdk/storage/azure-storage-queue/azure.storage.queue.queueservice.queueservice?view=storage-py-v2&preserve-view=true#put-message-queue-name--content--visibility-timeout-none--time-to-live-none--timeout-none-) method to create a new message and add it to the queue.
6765

6866
```python
@@ -73,8 +71,6 @@ queue_service.put_message(queue_name, message)
7371

7472
## Peek at messages
7573

76-
Related article: [Get started with Azure Queue Storage using Python](storage-quickstart-queues-python.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
77-
7874
You can peek at messages without removing them from the queue by calling the [`peek_messages`](/azure/developer/python/sdk/storage/azure-storage-queue/azure.storage.queue.queueservice.queueservice?view=storage-py-v2&preserve-view=true#peek-messages-queue-name--num-messages-none--timeout-none-) method. By default, this method peeks at a single message.
7975

8076
```python
@@ -86,8 +82,6 @@ for peeked_message in messages:
8682

8783
## Change the contents of a queued message
8884

89-
Related article: [Get started with Azure Queue Storage using Python](storage-quickstart-queues-python.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
90-
9185
The following code uses the [`update_message`](/azure/developer/python/sdk/storage/azure-storage-queue/azure.storage.queue.queueservice.queueservice?view=storage-py-v2&preserve-view=true#update-message-queue-name--message-id--pop-receipt--visibility-timeout--content-none--timeout-none-) method to update a message. The visibility timeout is set to 0, meaning the message appears immediately and the content is updated.
9286

9387
```python
@@ -100,8 +94,6 @@ for message in messages:
10094

10195
## Get the queue length
10296

103-
Related article: [Get started with Azure Queue Storage using Python](storage-quickstart-queues-python.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
104-
10597
The [`get_queue_metadata`](/azure/developer/python/sdk/storage/azure-storage-queue/azure.storage.queue.queueservice.queueservice?view=storage-py-v2&preserve-view=true#get-queue-metadata-queue-name--timeout-none-) method returns queue properties including `approximate_message_count`.
10698

10799
```python
@@ -114,8 +106,6 @@ The result is only approximate because messages can be added or removed after th
114106

115107
## Dequeue messages
116108

117-
Related article: [Get started with Azure Queue Storage using Python](storage-quickstart-queues-python.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
118-
119109
When you call [get_messages](/azure/developer/python/sdk/storage/azure-storage-queue/azure.storage.queue.queueservice.queueservice?view=storage-py-v2&preserve-view=true#get-messages-queue-name--num-messages-none--visibility-timeout-none--timeout-none-), you get the next message in the queue by default. A message returned from `get_messages` becomes invisible to any other code reading messages from this queue. By default, this message stays invisible for 30 seconds. To finish removing the message from the queue, you must also call [delete_message](/azure/developer/python/sdk/storage/azure-storage-queue/azure.storage.queue.queueservice.queueservice?view=storage-py-v2&preserve-view=true#delete-message-queue-name--message-id--pop-receipt--timeout-none-).
120110

121111
```python
@@ -140,8 +130,6 @@ for message in messages:
140130

141131
## Delete a queue
142132

143-
Related article: [Get started with Azure Queue Storage using Python](storage-quickstart-queues-python.md?tabs=passwordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
144-
145133
To delete a queue and all the messages contained in it, call the [`delete_queue`](/azure/developer/python/sdk/storage/azure-storage-queue/azure.storage.queue.queueservice.queueservice?view=storage-py-v2&preserve-view=true#delete-queue-queue-name--fail-not-exist-false--timeout-none-) method.
146134

147135
```python

articles/storage/queues/queues-v8-samples-java.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: pauljewellmsft
77
ms.service: azure-queue-storage
88
ms.custom: devx-track-extended-java
99
ms.topic: how-to
10-
ms.date: 04/26/2023
10+
ms.date: 07/24/2023
1111
ms.author: pauljewell
1212
---
1313

@@ -17,9 +17,9 @@ This article shows code samples that use version 8 of the Azure Queue Storage cl
1717

1818
[!INCLUDE [storage-v11-sdk-support-retirement](../../../includes/storage-v11-sdk-support-retirement.md)]
1919

20-
## Create a queue
20+
For code samples using the latest version 12.x client library version, see [Quickstart: Azure Queue Storage client library for Java](storage-quickstart-queues-java.md).
2121

22-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
22+
## Create a queue
2323

2424
Add the following `import` directives:
2525

@@ -58,8 +58,6 @@ catch (Exception e)
5858

5959
## Add a message to a queue
6060

61-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
62-
6361
To insert a message into an existing queue, first create a new `CloudQueueMessage`. Next, call the `addMessage` method. A `CloudQueueMessage` can be created from either a string (in UTF-8 format) or a byte array. The following code example creates a queue (if it doesn't exist) and inserts the message `Hello, World`.
6462

6563
```java
@@ -91,8 +89,6 @@ catch (Exception e)
9189

9290
## Peek at the next message
9391

94-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
95-
9692
You can peek at the message in the front of a queue without removing it from the queue by calling `peekMessage`.
9793

9894
```java
@@ -126,8 +122,6 @@ catch (Exception e)
126122

127123
## Change the contents of a queued message
128124

129-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
130-
131125
The following code sample searches through the queue of messages, locates the first message content that matches `Hello, world`, modifies the message content, and exits.
132126

133127
```java
@@ -210,8 +204,6 @@ catch (Exception e)
210204

211205
## Get the queue length
212206

213-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
214-
215207
The `downloadAttributes` method retrieves several values including the number of messages currently in a queue. The count is only approximate because messages can be added or removed after your request. The `getApproximateMessageCount` method returns the last value retrieved by the call to `downloadAttributes`, without calling Queue Storage.
216208

217209
```java
@@ -245,8 +237,6 @@ catch (Exception e)
245237

246238
## Dequeue the next message
247239

248-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
249-
250240
Your code dequeues a message from a queue in two steps. When you call `retrieveMessage`, you get the next message in a queue. A message returned from `retrieveMessage` becomes invisible to any other code reading messages from this queue. By default, this message stays invisible for 30 seconds. To finish removing the message from the queue, you must also call `deleteMessage`. If your code fails to process a message, this two-step process ensures that you can get the same message and try again. Your code calls `deleteMessage` right after the message has been processed.
251241

252242
```java
@@ -280,8 +270,6 @@ catch (Exception e)
280270

281271
## Additional options for dequeuing messages
282272

283-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
284-
285273
The following code example uses the `retrieveMessages` method to get 20 messages in one call. Then it processes each message using a `for` loop. It also sets the invisibility timeout to five minutes (300 seconds) for each message. The timeout starts for all messages at the same time. When five minutes have passed since the call to `retrieveMessages`, any messages not deleted becomes visible again.
286274

287275
```java
@@ -313,8 +301,6 @@ catch (Exception e)
313301

314302
## List the queues
315303

316-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
317-
318304
To obtain a list of the current queues, call the `CloudQueueClient.listQueues()` method, which returns a collection of `CloudQueue` objects.
319305

320306
```java
@@ -344,8 +330,6 @@ catch (Exception e)
344330

345331
## Delete a queue
346332

347-
Related article: [Get started with Azure Queue Storage using Java](storage-quickstart-queues-java.md?tabs=powershell%2Cpasswordless%2Croles-azure-portal%2Cenvironment-variable-windows%2Csign-in-azure-cli)
348-
349333
To delete a queue and all the messages contained in it, call the `deleteIfExists` method on the `CloudQueue` object.
350334

351335
```java

0 commit comments

Comments
 (0)