Franz.Common.AzureCosmosDB
1.6.19
dotnet add package Franz.Common.AzureCosmosDB --version 1.6.19
NuGet\Install-Package Franz.Common.AzureCosmosDB -Version 1.6.19
<PackageReference Include="Franz.Common.AzureCosmosDB" Version="1.6.19" />
<PackageVersion Include="Franz.Common.AzureCosmosDB" Version="1.6.19" />
<PackageReference Include="Franz.Common.AzureCosmosDB" />
paket add Franz.Common.AzureCosmosDB --version 1.6.19
#r "nuget: Franz.Common.AzureCosmosDB, 1.6.19"
#:package Franz.Common.AzureCosmosDB@1.6.19
#addin nuget:?package=Franz.Common.AzureCosmosDB&version=1.6.19
#tool nuget:?package=Franz.Common.AzureCosmosDB&version=1.6.19
Franz.Common.AzureCosmosDB
A specialized persistence library within the Franz Framework, providing seamless integration with Azure Cosmos DB. This package extends the polyglot persistence philosophy of the framework by enabling NoSQL storage, outbox pattern messaging, and dead-letter handling alongside existing SQL and Mongo providers.
Features
Cosmos DB Bootstrapping:
ServiceCollectionExtensionsto configure and register Cosmos DB dependencies via configuration.- Automatic registration of
CosmosClient,Database, and container-level resources.
Outbox & Dead-Letter Messaging:
CosmosDBMessageStoreimplementsIMessageStorefrom Franz.Common.Messaging.Storage, enabling reliable message persistence, retries, and dead-letter handling.
Repository Support:
- Generic repository pattern (
ICosmosRepository<T>) for CRUD operations. - Partition key awareness and container management out-of-the-box.
- Generic repository pattern (
Config-Driven:
- Centralized setup through
appsettings.json(CosmosDb:ConnectionString,CosmosDb:DatabaseName).
- Centralized setup through
Polyglot Persistence:
- Aligns with the same philosophy as
Franz.Common.EntityFrameworkandFranz.Common.MongoDB, allowing developers to swap or combine providers effortlessly.
- Aligns with the same philosophy as
Version Information
- Current Version: 1.6.19
- Part of the private Franz Framework ecosystem.
- Extended capacities: Cosmos DB support introduced in 1.6.2.
Installation
From Private Azure Feed
dotnet nuget add source "https://your-private-feed-url" \
--name "AzurePrivateFeed" \
--username "YourAzureUsername" \
--password "YourAzurePassword" \
--store-password-in-clear-text
Install the package:
dotnet add package Franz.Common.AzureCosmosDB
Usage
1. Configure Cosmos Database
In appsettings.json:
{
"CosmosDb": {
"ConnectionString": "AccountEndpoint=https://your-account.documents.azure.com:443/;AccountKey=your-key;",
"DatabaseName": "FranzAppDb"
}
}
2. Register Cosmos in DI
using Franz.Common.Cosmos.Extensions;
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddCosmosDatabase(Configuration);
services.AddCosmosMessageStore(
Configuration["CosmosDb:ConnectionString"],
Configuration["CosmosDb:DatabaseName"]);
}
}
3. Outbox & Dead-Letter Messaging
public class MyService
{
private readonly IMessageStore _messageStore;
public MyService(IMessageStore messageStore)
{
_messageStore = messageStore;
}
public async Task SendMessageAsync()
{
var message = new Message("Hello from Franz!");
await _messageStore.SaveAsync(message);
}
}
Dependencies
- Franz.Common.Messaging: Contracts (
Message,StoredMessage) - Franz.Common.Messaging.Storage:
IMessageStoreabstraction - Microsoft.Azure.Cosmos: Cosmos DB SDK
Contributing
This package is part of a private framework. Contributions are limited to the internal development team.
- Clone the repository @ https://github.com/bestacio89/Franz.Common/
- Create a feature branch.
- Submit a pull request for review.
License
Licensed under the MIT License. See the LICENSE file for more details.
Changelog
Version 1.6.2
- Introduced Azure Cosmos DB integration.
- Added
CosmosDBMessageStoreimplementingIMessageStore. - Added
ICosmosRepository<T>for generic repository patterns. - Enabled Outbox / Dead-Letter pattern in Cosmos DB.
- Extended polyglot persistence bootstrapper to include Cosmos alongside SQL and Mongo.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Franz.Common.Messaging (>= 1.6.19)
- Microsoft.Azure.Cosmos (>= 3.53.1)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.9)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Franz.Common.AzureCosmosDB:
| Package | Downloads |
|---|---|
|
Franz.Common.Messaging.EntityFramework
Shared utility library for the Franz Framework. |
|
|
Franz.Common.Http.EntityFramework
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.