Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Migrating Azure Functions in-process to Isolated Worker
summary: Instructions on how to migrate Azure Functions in-process to Azure Functions Isolated Worker
component: ASBFunctionsWorker
reviewed: 2024-07-29
reviewed: 2024-08-23
related:
- nservicebus/hosting/azure-functions-service-bus/in-process
- samples/azure-functions/service-bus
Expand Down Expand Up @@ -146,3 +146,27 @@ class HttpSender
}
}
```

## Ensuring consistency in the Isolated Worker model

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:

1. **Implement the [Outbox pattern](/architecture/consistency.md#transactions-outbox-pattern)** to simulate atomic transactions. (Recommended)
2. Ensure that all receiver message handlers are [idempotent](/architecture/consistency.md#idempotency).
3. Ensure that the system infrastructure guarantees consistency between business data and messages.

### Using SendsAtomicWithReceive in the In-Process model

In the in-process model, `SendsAtomicWithReceive` could be enabled by setting a boolean value to true in the assembly attribute:

```csharp
[assembly: NServiceBusTriggerFunction("ASBFunctionEndpoint", SendsAtomicWithReceive = true)]
```

### Changes in the Isolated Worker model

However, in the isolated worker model, the `SendsAtomicWithReceive` attribute is not supported yet. Therefore, this setting needs to be removed from the assembly attribute.

```csharp
[assembly: NServiceBusTriggerFunction("ASBFunctionEndpoint")]
```