Table of Contents

Interface ICustomRoutingEvent<TEvent>

Namespace
CarrotMQ.Core.Dto
Assembly
CarrotMQ.Core.dll

Represents an event interface that defines the contract for handling a specific event with custom routing information.

public interface ICustomRoutingEvent<TEvent> : _IMessage<TEvent, NoResponse> where TEvent : ICustomRoutingEvent<TEvent>

Type Parameters

TEvent

The type of the custom routing event.

Examples

Example of an event definition:

public class MyCustomRoutingEvent : ICustomRoutingEvent<MyCustomRoutingEvent>
{
    public MyCustomRoutingEvent(string exchange, string routingKey, string eventData)
    {
        EventData = eventData;
        Exchange = exchange;
        RoutingKey = routingKey;
    }

    public string EventData { get; set; }

    public string Exchange { get; set; }

    public string RoutingKey { get; set; }
}

Properties

Exchange

Exchange where the event will be sent to

string Exchange { get; set; }

Property Value

string

RoutingKey

Routing key used by RabbitMQ to route the message to the right queue

string RoutingKey { get; set; }

Property Value

string

See Also

_IEvent<TEvent>