Skip to content

Commit c23e61e

Browse files
Merge pull request #294065 from EldertGrootenboer/patch-5
Update message-sequencing.md
2 parents 1bd520a + c82acb9 commit c23e61e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

articles/service-bus-messaging/message-sequencing.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Azure Service Bus message sequencing and timestamps
33
description: This article explains how to preserve sequencing and ordering (with timestamps) of Azure Service Bus messages.
44
ms.topic: concept-article
5-
ms.date: 07/24/2024
5+
ms.date: 02/04/2025
66
#customer intent: As an architect or a developer, I want to know how the messages are sequenced (stamped with sequence number) and time-stamped in a queue or a topic in Azure Service Bus.
77
---
88

@@ -25,7 +25,7 @@ The time-stamping capability acts as a neutral and trustworthy authority that ac
2525
> [!NOTE]
2626
> Sequence number on its own guarantees the queuing order and the extractor order of messages, but not the processing order, which requires [sessions](message-sessions.md).
2727
>
28-
> Say, there are 5 messages in the queue and 2 consumers. Consumer 1 picks up message 1. Consumer 2 picks up message 2. Consumer 2 finishes processing message 2 and picks up message 3 while Consumer 1 is not done with processing message 1 yet. Consumer 2 finishes processing message 3 but consumer 1 is still not done with processing message 1 yet. Finally, consumer 1 completes processing message 1. So, the messages are processed in this order: message 2, message 3, and message 1. If you need message 1, 2, and 3 to be processed in order, you need to use sessions.
28+
> Say, there are five messages in the queue and two consumers. Consumer 1 picks up message 1. Consumer 2 picks up message 2. Consumer 2 finishes processing message 2 and picks up message 3 while Consumer 1 isn't done with processing message 1 yet. Consumer 2 finishes processing message 3 but consumer 1 is still not done with processing message 1 yet. Finally, consumer 1 completes processing message 1. So, the messages are processed in this order: message 2, message 3, and message 1. If you need message 1, 2, and 3 to be processed in order, you need to use sessions.
2929
>
3030
> So, if messages just need to be retrieved in order, you don't need to use sessions. If messages need to be processed in order, use sessions. The same session ID should be set on messages that belong together, which could be message 1, 4, and 8 in one set, and 2, 3, and 6 in another set.
3131
>
@@ -40,7 +40,10 @@ Scheduled messages don't materialize in the queue until the defined enqueue time
4040
You can schedule messages using any of our clients in two ways:
4141

4242
- Use the regular send API, but set the `Scheduled​Enqueue​Time​Utc` property on the message before sending.
43-
- Use the schedule message API, pass both the normal message and the scheduled time. The API returns the scheduled message's `SequenceNumber`, which you can later use to cancel the scheduled message if needed.
43+
- Use the schedule message API, pass both the normal message and the scheduled time. The API returns the scheduled message's `SequenceNumber`, which you can later use to cancel the scheduled message if needed.
44+
45+
> [!NOTE]
46+
> Messages that are larger than 1 MB can only be scheduled using the regular API and setting the `Scheduled​Enqueue​Time​Utc` property.
4447
4548
Scheduled messages and their sequence numbers can also be discovered using [message browsing](message-browsing.md).
4649

@@ -49,12 +52,12 @@ The `SequenceNumber` for a scheduled message is only valid while the message is
4952
Because the feature is anchored on individual messages and messages can only be enqueued once, Service Bus doesn't support recurring schedules for messages.
5053

5154
> [!NOTE]
52-
> - Message enqueuing time doesn't mean that the message will be sent at the same time. It will get enqueued, but the actual sending time depends on the queue's workload and its state.
53-
> - Due to performance considerations, the activation and cancellation of scheduled messages are independent operations without mutual locking. If a message is in the process of being activated and is simultaneously cancelled, the activation process will not be reversed and the message will still be activated. Moreover, this can potentially lead to a negative count of scheduled messages. To minimize this race condition, we recommend that you avoid scheduling activation and cancellation operations in close succession.
55+
> - Message enqueuing time doesn't mean that the message is sent at the same time. It's enqueued, but the actual sending time depends on the queue's workload and its state.
56+
> - Due to performance considerations, the activation and cancellation of scheduled messages are independent operations without mutual locking. If a message is in the process of being activated and is simultaneously canceled, the activation process won't be reversed and the message will still be activated. Moreover, it can potentially lead to a negative count of scheduled messages. To minimize this race condition, we recommend that you avoid scheduling activation and cancellation operations in close succession.
5457
5558
### Using scheduled messages with workflows
5659

57-
It's common to see longer-running business workflows that have an explicit time component to them, like 5-minute timeouts for 2-factor authentication, hour-long timeouts for users confirming their email address, and multi-day, week, or month long time components in domains like banking and insurance.
60+
It's common to see longer-running business workflows that have an explicit time component to them, like 5-minute time-outs for 2-factor authentication, hour-long time-outs for users confirming their email address, and multi-day, week, or month long time components in domains like banking and insurance.
5861

5962
These workflows are often kicked off by the processing of some message, which then stores some state, and then schedules a message to continue the process at a later time. Frameworks like [NServiceBus](https://docs.particular.net/tutorials/nservicebus-sagas/2-timeouts/) and [MassTransit](https://masstransit.io/documentation/configuration/sagas/overview) make it easier to integrate all of these elements together.
6063

0 commit comments

Comments
 (0)