Dosaic.Plugins.Messaging.MassTransit
1.0.25
See the version list below for details.
dotnet add package Dosaic.Plugins.Messaging.MassTransit --version 1.0.25
NuGet\Install-Package Dosaic.Plugins.Messaging.MassTransit -Version 1.0.25
<PackageReference Include="Dosaic.Plugins.Messaging.MassTransit" Version="1.0.25" />
paket add Dosaic.Plugins.Messaging.MassTransit --version 1.0.25
#r "nuget: Dosaic.Plugins.Messaging.MassTransit, 1.0.25"
// Install Dosaic.Plugins.Messaging.MassTransit as a Cake Addin #addin nuget:?package=Dosaic.Plugins.Messaging.MassTransit&version=1.0.25 // Install Dosaic.Plugins.Messaging.MassTransit as a Cake Tool #tool nuget:?package=Dosaic.Plugins.Messaging.MassTransit&version=1.0.25
Dosaic.Plugins.Messaging.MassTransit
Dosaic.Plugins.Messaging.MassTransit is a plugin
that allows other Dosaic components
to use messaging using MassTransit
.
Installation
To install the nuget package follow these steps:
dotnet add package Dosaic.Plugins.Messaging.MassTransit
or add as package reference to your .csproj
<PackageReference Include="Dosaic.Plugins.Messaging.MassTransit" Version="" />
Appsettings.yml
Configure your appsettings.yml with these properties
Postgres for example
messageBus:
host: localhost
port: 5672
vhost: /
username: rabbitmq
password: rabbitmq
Usage
This plugin automatically detects all queues by their implementation (IMessageConsumer<T>) and starts listening to them. The queue name is resolved using the message type name. If you want to override this behavior, you can use the QueueNameAttribute. You can have multiple consumers for the same message type, because it is wrapped into one consumer. It will throw exceptions and uses the MassTransit logic for error handling, if a consumer fails. So you will get a "QUEUE_NAME_error"-queue with the exception details and the original message.
Example:
```csharp
internal record TestMessage : IMessage;
internal class TestService(IMessageBus bus)
{
public Task DoStuff()
{
return bus.SendAsync(new TestMessage());
}
}
internal class TestConsumer : IMessageConsumer<TestMessage>
{
public async Task ProcessAsync(TestMessage message, CancellationToken cancellationToken)
{
Console.WriteLine("Received message");
}
}
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. |
-
net9.0
- Dosaic.Hosting.Abstractions (>= 1.0.25)
- Dosaic.Plugins.Messaging.Abstractions (>= 1.0.25)
- MassTransit (>= 8.3.4)
- MassTransit.RabbitMQ (>= 8.3.4)
- Polly (>= 8.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.