Skip to content

Commit c655f92

Browse files
author
Travis Nickels
committed
Add consistency section for migration guide
1 parent b05c9b4 commit c655f92

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

nservicebus/upgrades/azure-functions-service-bus-in-process-isolated-worker.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,27 @@ class HttpSender
146146
}
147147
}
148148
```
149+
150+
## Ensuring consistency in the Isolated Worker model
151+
152+
It's important to be able to maintain the consistency guarantees that were previously available in the in-process model when using `SendsAtomicWithReceive`. To achieve this, there are a few options:
153+
154+
1. **Implement the [Outbox pattern](https://docs.particular.net/architecture/consistency#transactions-outbox-pattern)** to simulate atomic transactions. (Recommended)
155+
2. Ensure that all receiver message handlers are [idempotent](https://docs.particular.net/architecture/consistency#idempotency).
156+
3. Ensure that the system infrastructure guarantees consistency between business data and messages.
157+
158+
### Using SendsAtomicWithReceive in the In-Process model
159+
160+
In the in-process model, `SendsAtomicWithReceive` could be enabled by setting a boolean value in the assembly attribute:
161+
162+
```csharp
163+
[assembly: NServiceBusTriggerFunction("ASBFunctionEndpoint", SendsAtomicWithReceive = true)]
164+
```
165+
166+
### Changes in the Isolated Worker model
167+
168+
However, in the isolated worker model, the `SendsAtomicWithReceive` attribute is not supported yet. Therefore, this setting needs to be removed from the assembly attribute.
169+
170+
```csharp
171+
[assembly: NServiceBusTriggerFunction("ASBFunctionEndpoint")]
172+
```

0 commit comments

Comments
 (0)