Marquitos.Events.Abstractions 1.2.6

dotnet add package Marquitos.Events.Abstractions --version 1.2.6                
NuGet\Install-Package Marquitos.Events.Abstractions -Version 1.2.6                
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="Marquitos.Events.Abstractions" Version="1.2.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Marquitos.Events.Abstractions --version 1.2.6                
#r "nuget: Marquitos.Events.Abstractions, 1.2.6"                
#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.
// Install Marquitos.Events.Abstractions as a Cake Addin
#addin nuget:?package=Marquitos.Events.Abstractions&version=1.2.6

// Install Marquitos.Events.Abstractions as a Cake Tool
#tool nuget:?package=Marquitos.Events.Abstractions&version=1.2.6                

NuGet Version

Marquitos.Events

A simple event system in top of RabbitMQ using EasyNetQ for AspNetCore applications.

Usage

To notify an event, first create a class that implements the IEvent interface.

    // Your event class
    public class ExampleCreated : IEvent
    {
        /// <summary>
        /// The example name just created
        /// </summary>
        public string ExampleName { get; set; } = "My Example";
    }

Then inject IEventService to your service and call NotifyAsync to notify your event.

    // Your Service class that notifies events
    public class ExampleService
    {
        private readonly IEventService _eventService;

        public WeatherForecastController(IEventService eventService)
        {
            _eventService = eventService;
        }

        public async Task CreateExampleAsync(string name, CancellationToken cancellationToken = default)
        {
            // call repository to register the example name

            // then notify your event to RabbitMQ
            await _eventService.NotifyAsync(new ExampleCreated() { ExampleName = name });
        }
    }

To consume an event create an event consumer. First create a class that descends of EventConsumer.

    public class ExampleConsumer : EventConsumer<ExampleCreated>
    {
        public override async Task HandleMessageAsync(ExampleCreated message, CancellationToken cancellationToken = default)
        {
            Console.WriteLine("Received an message!");
            await Task.CompletedTask;
        }
    }

Then register the RabbitMQ Consumer Service Engine and the Event Consumer on your services configuration.

...
    // Register the RabbitMQ connections string
    builder.Services.AddRabbitMQConnectionWithSystemTextJson(builder.Configuration.GetConnectionString("RabbitConnection"));

    // Register the Event Service to notify events
    builder.Services.AddRabbitMQEventService();

    // Register the Consumer Service Engine
    builder.Services.AddRabbitMQConsumerService();

    // Register your Consumer
    builder.Services.AddRabbitMQEventConsumer<ExampleConsumer, ExampleCreated>((sp, o) =>
    {
        // For example add two retry options
        o.Retries = new[] { 0.5, 1 }; // 30s and 1min
        o.IsEnabled = true;
    });
...
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Marquitos.Events.Abstractions:

Package Downloads
Marquitos.Events.RabbitMQ

A simple event system in top of RabbitMQ using EasyNetQ for AspNetCore applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.6 72 2/8/2025
1.2.5 65 2/6/2025
1.2.4 109 11/14/2024
1.2.3 1,222 10/20/2023
1.2.2 535 7/10/2023
1.2.1 422 4/19/2023
1.2.0 514 3/22/2023
1.1.0 692 2/20/2023
1.0.4 381 2/1/2023
1.0.3 319 1/31/2023
1.0.2 336 1/23/2023
1.0.1 336 1/23/2023
1.0.0 387 10/29/2022