Shuttle.Esb.Sql.Subscription
20.0.0
Prefix Reserved
dotnet add package Shuttle.Esb.Sql.Subscription --version 20.0.0
NuGet\Install-Package Shuttle.Esb.Sql.Subscription -Version 20.0.0
<PackageReference Include="Shuttle.Esb.Sql.Subscription" Version="20.0.0" />
<PackageVersion Include="Shuttle.Esb.Sql.Subscription" Version="20.0.0" />
<PackageReference Include="Shuttle.Esb.Sql.Subscription" />
paket add Shuttle.Esb.Sql.Subscription --version 20.0.0
#r "nuget: Shuttle.Esb.Sql.Subscription, 20.0.0"
#:package Shuttle.Esb.Sql.Subscription@20.0.0
#addin nuget:?package=Shuttle.Esb.Sql.Subscription&version=20.0.0
#tool nuget:?package=Shuttle.Esb.Sql.Subscription&version=20.0.0
SQL
PM> Install-Package Shuttle.Esb.Sql.Subscription
Contains a sql-based ISubscriptionService implementation. The subscription service caches all subscriptions but a timeout for the cache may be set. If you need to be sure that a new subscriber is picked up by a publisher the safest is to restart the relevant publisher(s).
Registration
The required components may be registered by calling:
services.AddSqlSubscription(builder =>
{
// defaults
builder.Options.ConnectionStringName = "Subscription";
builder.Options.Schema = "dbo";
builder.Options.CacheTimeout = TimeSpan.FromMinutes(5);
builder.UseSqlServer(); // SqlServer
builder.UseNpgsql(); // Postgres
});
The SubscriptionService that implements the ISubscriptionService interface makes use of the SubscriptionOptions configured with the ServiceBusOptions to register, or ensure, any subscriptions:
services.AddServiceBus(builder =>
{
builder.Subscription.SubscribeType = SubscribeType.Normal; // default
// add subscription to message types directly; else below options on builder
builder.Subscription.MessageTypes.Add(messageType);
// using type
builder.AddSubscription(typeof(Event1));
builder.AddSubscription(typeof(Event2));
// using a full type name
builder.AddSubscription(typeof(Event1).FullName);
builder.AddSubscription(typeof(Event2).FullName);
// using a generic
builder.AddSubscription<Event1>();
builder.AddSubscription<Event2>();
});
And the JSON configuration structure:
{
"Shuttle": {
"Sql": {
"Subscription": {
"ConnectionStringName": "Subscription",
"Schema": "dbo",
"CacheTimeout": "00:05:00"
}
},
"ServiceBus": {
"Subscription": {
"SubscribeType": "Normal",
"MessageTypes": [
"message-type-a",
"message-type-b"
]
}
}
}
}
Options
| Option | Default | Description |
|---|---|---|
ConnectionStringName |
Subscription | The name of the ConnectionString to use to connect to the subscription store. |
Schema |
dbo | The name of the database schema to use when accessing the subscription tables. |
CacheTimeout |
00:05:00 |
How long event subscribers should be cached for before refreshing the list. |
When moving to a non-development environment it is recommended that you make use of the Ensure option for the SubscribeType.
Supported providers
Microsoft.Data.SqlClientNpgsql/ thanks to hopla
If you'd like support for another SQL-based provider please feel free to give it a bash and send a pull request if you do go this route. You are welcome to create an issue and assistance will be provided where possible.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
-
- Shuttle.Core.Data (>= 20.0.0)
- Shuttle.Esb (>= 20.0.0)
- System.Runtime.Caching (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 20.0.0 | 1,056 | 2/2/2025 | |
| 16.0.0 | 812 | 8/5/2024 | |
| 15.0.1 | 281 | 7/16/2024 | |
| 14.0.1 | 1,719 | 5/3/2024 | |
| 14.0.0 | 289 | 4/30/2024 | |
| 13.2.2 | 4,794 | 12/1/2022 | |
| 13.2.1 | 633 | 11/26/2022 | |
| 13.2.0 | 707 | 9/16/2022 | |
| 13.1.0 | 629 | 9/11/2022 | |
| 13.0.0 | 624 | 9/4/2022 | |
| 12.1.0 | 643 | 8/25/2022 | |
| 12.0.2 | 823 | 4/9/2022 | |
| 12.0.1 | 651 | 4/9/2022 | |
| 12.0.0 | 678 | 3/21/2022 | |
| 11.0.4 | 1,097 | 1/21/2021 | |
| 11.0.1 | 973 | 4/16/2020 | |
| 11.0.0 | 5,661 | 6/21/2019 | |
| 10.1.3 | 5,296 | 11/26/2018 |