We have another team that publish events using Masstransit & RabbitMQ.
They are publishing the event with full name Namespace1.Namespace2.EventHappened
On RabbitMq, it is publishing on an Exchange of type “Topic” with nanme:
Namespace1.Namespace2:EventHappened
I wrote the handler for the event as follows:
public class EventHappenedConsumer : IConsumer<EventHappened>
{
private readonly ICompanyUpdatedProcessingTask companyUpdatedProcessingTask;
public async Task Consume(ConsumeContext<EventHappened> context)
{
await companyUpdatedProcessingTask.Process(context.Message);
}
}
I want to listen to the event using Masstransit version 7.2.4
I am adding the consumer as follows:
services.AddMassTransit(x =>
{
x.UseEndpointConventions();
x.AddConsumer<EventHappenedConsumer>();
}
As I said the publishing is updating an Exchange on RabbitMq with type “Topic”
and the Exchange is Namespace1.Namespace2:EventHappened
Adding just the consumer is not enough to listen to that event.
What endpoint I should configure on my side (the consumer side), to listen to those events.