Skip to content

Commit 8b2622f

Browse files
Update cosmosdb for patch releases
1 parent f46b4e7 commit 8b2622f

5 files changed

+28
-9
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> [!WARNING]
2+
> For control messages, a default partition key in the format `{messageId}` will be used, however these Outbox records are not separated by endpoint name. As a result, multiple logical endpoints _cannot_ share the same database and container since [message identities are not unique across endpoints from a processing perspective](/nservicebus/outbox/#message-identity). To avoid conflicts, either separate different endpoints into different containers, [override the partition key](transactions.md), or update to the latest package of `NServiceBus.Persistence.CosmosDB`.

persistence/cosmosdb/index_outboxstorageformat_CosmosDB_(,2].partial.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
> [!NOTE]
2+
> **Versions `v2.0.4` and up:** For control messages, a default partition key in the format `{endpointName}-{messageId}` will be used. As a result, multiple logical endpoints _can_ share the same database and container.
3+
4+
> [!WARNING]
5+
> **Versions `v2.0.3` and under:** For control messages, a default partition key in the format `{messageId}` will be used, however these Outbox records are not separated by endpoint name. As a result, multiple logical endpoints _cannot_ share the same database and container since [message identities are not unique across endpoints from a processing perspective](/nservicebus/outbox/#message-identity). To avoid conflicts, either separate different endpoints into different containers, [override the partition key](transactions.md), or update to `NServiceBus.Persistence.CosmosDB 2.0.4`.

persistence/cosmosdb/index_outboxstorageformat_CosmosDB_[3,).partial.md renamed to persistence/cosmosdb/index_outboxstorageformat_CosmosDB_[3,3].partial.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#### Version 3.2.0 and over
1+
#### Version 3.2 and up
22

33
A default [synthetic partition key](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/synthetic-partition-keys) will be used for all incoming messages, in the format `{endpointName}-{messageId}`, if not explicitly [overwritten](/persistence/cosmosdb/transactions.md#specifying-the-partitionkey-to-use-for-the-transaction) at runtime.
44

@@ -16,9 +16,10 @@ endpointConfiguration
1616
> [!WARNING]
1717
> Since [message identities are not unique across endpoints from a processing perspective](/nservicebus/outbox/#message-identity), when overwriting the default synthetic key, either separate different endpoints into different containers or [override the default synthetic partition key](transactions.md) in a way that ensures message identities are unique to each processing endpoint.
1818
19-
#### Version 3.1.0 and under
19+
#### Version 3.1 and under
20+
21+
> [!NOTE]
22+
> **Versions `v3.1.3` and up:** For control messages, a default partition key in the format `{endpointName}-{messageId}` will be used. As a result, multiple logical endpoints _can_ share the same database and container.
2023
2124
> [!WARNING]
22-
> _The below limitation has been resolved in `NServiceBus.Persistence.CosmosDB 3.2.0`. Its recommended that customers [update to 3.2](/persistence/upgrades/cosmosdb-3.1to3.2.md) if affected._
23-
>
24-
> For control messages, a default partition key in the format `{messageId}` will be used, however these Outbox records are not separated by endpoint name. As a result, multiple logical endpoints cannot share the same database and container since [message identities are not unique across endpoints from a processing perspective](/nservicebus/outbox/#message-identity). To avoid conflicts, either separate different endpoints into different containers, [override the partition key](transactions.md), or [update to NServiceBus.Persistence.CosmosDB 3.2](/persistence/upgrades/cosmosdb-3.1to3.2.md).
25+
> **Versions `v3.1.2` and under:** For control messages, a default partition key in the format `{messageId}` will be used, however these Outbox records are not separated by endpoint name. As a result, multiple logical endpoints _cannot_ share the same database and container since [message identities are not unique across endpoints from a processing perspective](/nservicebus/outbox/#message-identity). To avoid conflicts, either separate different endpoints into different containers, [override the partition key](transactions.md), or update to `NServiceBus.Persistence.CosmosDB 3.1.3`.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
A default [synthetic partition key](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/synthetic-partition-keys) will be used for all incoming messages, in the format `{endpointName}-{messageId}`, if not explicitly [overwritten](/persistence/cosmosdb/transactions.md#specifying-the-partitionkey-to-use-for-the-transaction) at runtime.
2+
3+
> [!NOTE]
4+
> The [default partition key should be overwritten](/persistence/cosmosdb/transactions.md#specifying-the-partitionkey-to-use-for-the-transaction) whenever the message handler creates or updates business records in CosmosDB. To guarantee atomicity, explicitly set the Outbox partition key to match the partition key of your business record. This is a requirement for including both the business record and the Outbox record in the same [Cosmos DB transactional batch](https://learn.microsoft.com/en-us/azure/cosmos-db/partitioning-overview). Conversely, for simplicity, you can use the default partition key when a handler's logic does not involve persisting business data.
5+
6+
To support backward compatibility of control messages during migration, the persistence includes a fallback mechanism. When enabled (default), and if a record is not found using the synthetic key format, the system falls back to the legacy `{messageId}` format. Since the fallback mechanism involves an additional read operation on the Outbox container, it is recommended to turn it off once all legacy records have expired.
7+
8+
```csharp
9+
endpointConfiguration
10+
.EnableOutbox()
11+
.DisableReadFallback();
12+
```
13+
14+
> [!WARNING]
15+
> Since [message identities are not unique across endpoints from a processing perspective](/nservicebus/outbox/#message-identity), when overwriting the default synthetic key, either separate different endpoints into different containers or [override the default synthetic partition key](transactions.md) in a way that ensures message identities are unique to each processing endpoint.

0 commit comments

Comments
 (0)