Skip to content

Commit d3b051f

Browse files
authored
Merge pull request #7033 from Particular/azure-review
Review of sample: Azure Table Persistence Usage
2 parents 338f891 + 62bd539 commit d3b051f

File tree

1 file changed

+12
-10
lines changed
  • samples/azure/azure-table/transactions

1 file changed

+12
-10
lines changed

samples/azure/azure-table/transactions/sample.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Azure Table Persistence Usage with transactions
2+
title: Azure Table Persistence Usage with Transactions
33
summary: Using Azure Table Persistence to store sagas and outbox records atomically
4-
reviewed: 2022-11-17
4+
reviewed: 2025-03-06
55
component: ASP
66
related:
77
- nservicebus/sagas
88
---
99

10-
This sample shows a client/server scenario using saga and outbox persistences to store records atomically by leveraging transactions.
10+
This sample demonstrates a client/server scenario using sagas and outbox persistences to store records atomically by leveraging transactions.
1111

1212
## Projects
1313

@@ -25,31 +25,33 @@ The shared message contracts used by all endpoints.
2525
* Receive the `StartOrder` message and initiate an `OrderSaga`.
2626
* `OrderSaga` requests a timeout with an instance of `CompleteOrder` with the saga data.
2727
* Receive the `OrderShipped` message with a custom header.
28-
* `OrderSaga` publishes an `OrderCompleted` event when the `CompleteOrder` timeout fires.
28+
* `OrderSaga` publishes an `OrderCompleted` event when the `CompleteOrder` timeout is triggered.
2929

3030
### Persistence config
3131

3232
Configure the endpoint to use Azure Table Persistence.
3333

3434
snippet: AzureTableConfig
3535

36-
The order id is used as a partition key.
36+
The OrderId is used as the partition key.
3737

38-
## Behaviors
38+
## Using Behaviors
3939

40-
Most messages implement `IProvideOrderId` and thus a logical behavior can use the provided order identification as a partition key.
40+
The following shows two different ways to provide OrderIDs to the saga using [behaviors](/nservicebus/pipeline/manipulate-with-behaviors.md).
41+
42+
1. Most messages implement `IProvideOrderId` allowing the OrderId to be used as the partition key.
4143

4244
snippet: BehaviorUsingIProvideOrderId
4345

44-
One handler publishes an event that doesn't implement `IProvideOrderId` but adds a custom header to indicate the order identification. The handler also creates `OrderShippingInformation` by participating in the transactional batch provided by NServiceBus.
46+
2. One handler publishes an event that does not implement `IProvideOrderId` but adds a custom header containing the OrderId. The handler also creates `OrderShippingInformation` as part of the transactional batch provided by NServiceBus.
4547

4648
snippet: UseHeader
4749

48-
The header can be used to determine the partition key in the transport receive context
50+
The custom header added then allows the partition key to be determined within `OrderIdHeaderAsPartitionKeyBehavior`.
4951

5052
snippet: BehaviorUsingHeader
5153

52-
Finally the above behaviors are registered in the pipeline.
54+
Finally, the above behaviors are registered in the pipeline.
5355

5456
snippet: BehaviorRegistration
5557

0 commit comments

Comments
 (0)