HyperDev.ActiveMQ
1.2.1
dotnet add package HyperDev.ActiveMQ --version 1.2.1
NuGet\Install-Package HyperDev.ActiveMQ -Version 1.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HyperDev.ActiveMQ" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HyperDev.ActiveMQ" Version="1.2.1" />
<PackageReference Include="HyperDev.ActiveMQ" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HyperDev.ActiveMQ --version 1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HyperDev.ActiveMQ, 1.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HyperDev.ActiveMQ@1.2.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HyperDev.ActiveMQ&version=1.2.1
#tool nuget:?package=HyperDev.ActiveMQ&version=1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
HyperDev.ActiveMQ
Typed JSON messaging for ActiveMQ Artemis, built on ArtemisNetClient, part of the HyperDev Fatum framework.
- Named broker endpoints from the
ActiveMQconfiguration section (IEndpointManager, registered withAddEndpointFactory, with anEndpointResolvingevent for custom resolution) AddActiveMq(configuration, name, aliases): registers an ArtemisNetClient connection on the configured endpoints- Typed consumers (
ITypedConsumer<TMessage>,AddTypedConsumer): JSON body deserialized, consumer resolved in a DI scope, message accepted on success and rejected (and logged) on exception - Typed producers (
ITypedProducer<TMessage>,MessageProducer<TMessage>): messages serialized to JSON with Newtonsoft.Json
Installation
dotnet add package HyperDev.ActiveMQ
Quick start
{
"ActiveMQ": {
"Endpoints": [
{ "Name": "Primary", "Server": "localhost", "Port": 5672, "User": "artemis", "Password": "artemis", "Scheme": "Amqp" }
]
}
}
using ActiveMQ.Artemis.Client;
using ActiveMQ.Artemis.Client.Extensions.DependencyInjection;
using ActiveMQ.Artemis.Client.Extensions.Hosting;
using HyperDev.ActiveMQ;
using HyperDev.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddScoped<OrderCreatedConsumer>();
var activeMq = builder.Services.AddActiveMq(builder.Configuration, "orders-bus", "Primary");
activeMq.AddTypedConsumer<OrderCreated, OrderCreatedConsumer>("orders", RoutingType.Anycast, new ConsumerOptions());
builder.Services.AddActiveMqHostedService();
builder.Build().Run();
public record OrderCreated(int OrderId, decimal Total);
public class OrderCreatedConsumer : ITypedConsumer<OrderCreated>
{
public Task ConsumeAsync(OrderCreated message, ConsumerContext context)
{
Console.WriteLine($"Order {message.OrderId} created, total {message.Total}");
return Task.CompletedTask;
}
}
Requirements
An Apache ActiveMQ Artemis broker reachable over AMQP (Scheme: Amqp, Amqps, Ws or Wss).
Target frameworks
.NET 8.0, .NET 10.0
License
MIT, © Ivan Senatore, Wemake Informatica srl. Third-party dependencies keep their own licenses (ArtemisNetClient and its extensions: MIT, Newtonsoft.Json: MIT, Microsoft.Extensions.*: MIT).
| 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 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- ArtemisNetClient (>= 3.1.1)
- ArtemisNetClient.Extensions.DependencyInjection (>= 3.1.1)
- ArtemisNetClient.Extensions.Hosting (>= 3.1.1)
- HyperDev.Core (>= 1.2.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.10)
- Newtonsoft.Json (>= 13.0.4)
-
net8.0
- ArtemisNetClient (>= 3.1.1)
- ArtemisNetClient.Extensions.DependencyInjection (>= 3.1.1)
- ArtemisNetClient.Extensions.Hosting (>= 3.1.1)
- HyperDev.Core (>= 1.2.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.