Shared RabbitMQ message bus library used across Hartsy ecosystem projects. This is an internal library that links all projects and keeps them typesafe.
- Type-safe message bus abstractions and implementation
- Shared message contracts and message types
- RabbitMQ connection + topology setup
- DI extension methods
- Logging abstraction via
IMessageBusLogger
- Any site-specific handlers
- Any site-specific logging implementation
- Any site-specific configuration binding logic beyond
MessageBusConfiguration
- Reference the project:
<ItemGroup>
<ProjectReference Include="RabbitMQ/HartsyRabbit/HartsyRabbit.csproj" />
</ItemGroup>-
Implement
IMessageBusLoggerin your site. -
Register the bus and your handlers:
services.AddSingleton<IMessageBusLogger, YourSiteMessageBusLogger>();
services.AddTypeSafeMessageBus(configuration);
services.AddMessageHandler<SomeMessage, SomeHandler>();- Start your hosted service that calls
ITypeSafeMessageBus.StartAsync().