0
0
Azurecloud~30 mins

Message ordering and sessions in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
Azure Service Bus: Message Ordering and Sessions
📖 Scenario: You are building a messaging system for a retail application. Orders must be processed in the exact order they are received per customer. To achieve this, you will use Azure Service Bus with sessions to ensure message ordering for each customer's order stream.
🎯 Goal: Create an Azure Service Bus queue with sessions enabled to guarantee message ordering per customer session.
📋 What You'll Learn
Create an Azure Service Bus queue named orders
Enable sessions on the orders queue
Set the MaxDeliveryCount to 10
Set the LockDuration to 1 minute
Configure DefaultMessageTimeToLive to 14 days
💡 Why This Matters
🌍 Real World
Message ordering per customer is critical in retail order processing to avoid confusion and ensure correct fulfillment.
💼 Career
Understanding how to configure Azure Service Bus queues with sessions is essential for cloud architects and developers building reliable, ordered messaging systems.
Progress0 / 4 steps
1
Create the basic Azure Service Bus queue
Write the Azure Resource Manager (ARM) template snippet to create a Service Bus queue named orders inside a resource group. Include only the basic queue resource with the name property set to orders.
Azure
Need a hint?

Use the resource type Microsoft.ServiceBus/namespaces/queues and set the name property to orders.

2
Enable sessions on the queue
Add the property requiresSession and set it to true inside the properties of the orders queue to enable message sessions.
Azure
Need a hint?

Inside properties, add "requiresSession": true to enable sessions.

3
Configure delivery count, lock duration, and message TTL
Inside the properties of the orders queue, add these exact properties: maxDeliveryCount set to 10, lockDuration set to "PT1M" (1 minute), and defaultMessageTimeToLive set to "P14D" (14 days).
Azure
Need a hint?

Use ISO 8601 duration format for lockDuration and defaultMessageTimeToLive.

4
Complete the ARM template with namespace and queue resource
Wrap the orders queue resource inside a Service Bus namespace resource named retailnamespace. Use Microsoft.ServiceBus/namespaces as the type for the namespace. The queue resource should be a child resource of the namespace. Use API version 2021-06-01-preview for both resources.
Azure
Need a hint?

Use nested resources array inside the namespace resource to define the queue.