batteries.Apache.NMS
1.0.11
See the version list below for details.
dotnet add package batteries.Apache.NMS --version 1.0.11
NuGet\Install-Package batteries.Apache.NMS -Version 1.0.11
<PackageReference Include="batteries.Apache.NMS" Version="1.0.11" />
paket add batteries.Apache.NMS --version 1.0.11
#r "nuget: batteries.Apache.NMS, 1.0.11"
// Install batteries.Apache.NMS as a Cake Addin #addin nuget:?package=batteries.Apache.NMS&version=1.0.11 // Install batteries.Apache.NMS as a Cake Tool #tool nuget:?package=batteries.Apache.NMS&version=1.0.11
batteries.Apache.NMS
Description
This package contains useful implementations of message bus services based on apache NMS.
Usage
With Message Bus Manager
The message bus manager can be used for managing multiple instances of message bus on different locations.
Here is how to use it:
Add the setting binding
builder.Services.AddOptions<BusManagerSettings>() .BindConfiguration("BusManagerSettings") .ValidateDataAnnotations() .ValidateOnStart(); builder.Services.AddSingleton(resolver => resolver.GetRequiredService<IOptions<BusManagerSettings>>().Value);
Adapt your
appsettings.json
and include the necessary settings:"BusManagerSettings":{ "BusSettings": [ { "Name": "test", "ServerUrl":"activemq:tcp://localhost:61616?retryInterval=1000&retryIntervalMultiplier=1.5&maxRetryInterval=60000&reconnectAttempts=1000", "Username": "artemis", "Password": "artemis", "DefaultDestination": "topic://fancytopic" } ], "Destinations": { "abc": "queue://abc.xyz" } }
Add the background service
builder.Services.AddSingleton<MessageBusManagerService>(); builder.Services.AddSingleton<IHostedService, MessageBusManagerService>(serviceProvider => serviceProvider.GetService<MessageBusManagerService>()); builder.Services.AddSingleton<IBusManager, MessageBusManagerService>(serviceProvider => serviceProvider.GetService<MessageBusManagerService>());
Inject the service (for example in one controller)
public class DataController : ControllerBase { private readonly ILogger<DataController> logger; private readonly IBusManager busManager; public DataController(ILogger<DataController> logger, IBusManager busManager) { this.logger = logger; this.busManager = busManager; } }
Without Message Bus Manager
The usage without the manager has very similar steps. Unter theese condition the software will ony have a single instance of the message bus.
Here is how to use it:
Add the setting binding
builder.Services.AddOptions<MessageBusSessionSettings>() .BindConfiguration("MessageBusSessionSettings") .ValidateDataAnnotations() .ValidateOnStart(); builder.Services.AddSingleton(resolver => resolver.GetRequiredService<IOptions<MessageBusSessionSettings>>().Value);
Adapt your
appsettings.json
and include the necessary settings:"MessageBusSessionSettings": { "Name": "test", "ServerUrl":"activemq:tcp://localhost:61616?retryInterval=1000&retryIntervalMultiplier=1.5&maxRetryInterval=60000&reconnectAttempts=1000", "Username": "artemis", "Password": "artemis", "DefaultDestination": "topic://fancytopic" }
Add the background service
builder.Services.AddSingleton<MessageBus>(); builder.Services.AddSingleton<IHostedService, MessageBus>(serviceProvider => serviceProvider.GetService<MessageBus>()); builder.Services.AddSingleton<IMessageBus, MessageBus>(serviceProvider => serviceProvider.GetService<MessageBus>());
Inject the service (for example in one controller)
public class DataController : ControllerBase { private readonly ILogger<DataController> logger; private readonly IMessageBus messageBus; public DataController(ILogger<DataController> logger, IMessageBus messageBus) { this.logger = logger; this.messageBus = messageBus; } }
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. |
-
net8.0
- Apache.NMS (>= 2.0.0)
- Apache.NMS.ActiveMQ (>= 2.0.0)
- batteries (>= 1.0.11)
- Microsoft.Extensions.Hosting (>= 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.