YAMCqrs.EventBus.Core
10.0.1
dotnet add package YAMCqrs.EventBus.Core --version 10.0.1
NuGet\Install-Package YAMCqrs.EventBus.Core -Version 10.0.1
<PackageReference Include="YAMCqrs.EventBus.Core" Version="10.0.1" />
<PackageVersion Include="YAMCqrs.EventBus.Core" Version="10.0.1" />
<PackageReference Include="YAMCqrs.EventBus.Core" />
paket add YAMCqrs.EventBus.Core --version 10.0.1
#r "nuget: YAMCqrs.EventBus.Core, 10.0.1"
#:package YAMCqrs.EventBus.Core@10.0.1
#addin nuget:?package=YAMCqrs.EventBus.Core&version=10.0.1
#tool nuget:?package=YAMCqrs.EventBus.Core&version=10.0.1
YAMCqrs.EventBus.Core
Core event management library for the YAMCqrs ecosystem.
The package is completely messaging-provider agnostic and provides a decoupled infrastructure for event publishing, persistence, processing, and subscription.
It also includes an InMemory implementation that enables local Domain Event simulation and allows evolving those events into real Integration Events following ADR 6 guidelines.
⚙️ Installation
dotnet add package YAMCqrs.EventBus.Core
🚀 Quick Start
builder.Services.AddEventBus(opt =>
{
opt.SubscribeConfiguration.ConcurrentWorkers = 1;
opt.PublishConfiguration.ConcurrentWorkers = 1;
});
⚙️ Configuration
PublishConfiguration and SubscribeConfiguration contain the same properties. PublishConfiguration defines the configuration for outgoing messages, while SubscribeConfiguration defines the configuration for incoming messages, allowing different settings to be applied independently for each flow.
ConcurrentWorkersNumber of concurrent workers for parallel processing.BatchSizeMaximum number of events processed per execution.PollingIntervalSecondsPolling interval used to fetch pending events.ErrorThresholdPercentageMaximum allowed error percentage before marking a batch as failed.
🛠️ Core Components
IEventBusPublisher
Allows extending event publishing to:
- Kafka
- RabbitMQ
- Azure Service Bus
- AWS SQS/SNS
- Custom providers
The library includes an InMemory implementation for local Domain Events.
IEventPublisher
Registers the intent to publish events while respecting the current transactional scope.
Benefits:
- prevents inconsistent persistence
- decouples business logic
- supports asynchronous processing
IPublishEventStore
Responsible for storing pending events before publishing.
Includes:
- auditing
- tracking
- retries
- processing decoupling
⚠️ The InMemory implementation is not recommended for production.
ISubscribeEventStore
Stores received events before processing.
Enables:
- reprocessing
- auditing
- decoupling reception and consumption
📡 Domain Events with InMemory
Outgoing event
internal sealed class DomainEventPublishEvent : InMemoryPublishEvent
{
public const string TopicName = "domain-event-topic";
public int Numerito { get; init; }
public override string Topic()
{
return TopicName;
}
}
Publish the event
await eventPublisher.PublishAsync(
new DomainEventPublishEvent(),
cancellationToken);
Incoming event
internal sealed class DomainEventSubscribeEvent()
: InMemorySuscribeEvent(DomainEventPublishEvent.TopicName)
{
public int Numerito { get; init; }
}
Process the event
internal sealed class DomainEventSubscribeHanlder
: ICommandHandler<DomainEventSubscribeEvent, bool>
{
public Task<Result<bool>> HandleAsync(
DomainEventSubscribeEvent command,
CancellationToken cancellationToken = default)
{
return Task.FromResult(Result<bool>.Success(true));
}
}
⚡ Architectural Features
- Event-driven architecture
- Domain Events
- Integration Events
- Outbox-like processing
- Asynchronous processing
- Low coupling
- Extensible infrastructure
- Event auditing
- Retry support
📋 Dependencies
YAMCqrs.EventBus.CoreYAMCqrs.BackgroundWorker
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.7)
- Microsoft.Extensions.Logging (>= 10.0.2)
- YAMCqrs.BackgroundWorker.Core (>= 10.0.1)
- YAMCqrs.Core (>= 10.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on YAMCqrs.EventBus.Core:
| Package | Downloads |
|---|---|
|
YAMCqrs.EventBus.Provider.Kafka
Package Description |
|
|
YAMCqrs.EventBus.Storage.MongoDb
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.