In my ASP.NET core controller, I send a command using IMediator.Send
await mediator.Send(new SubmitOrder());
The consumer of the SubmitOrder looks like this
public class SubmitOrderConsumer : IConsumer<SubmitOrder>
{
public async Task Consume( ConsumeContext<SubmitOrder> context )
{
var sendEndpoint = await context.GetSendEndpoint( new Uri( "rabbitmq://localhost/notification-service" ) );
await sendEndpoint.Send( new NotifyOrderSubmitted() );
}
}
Sending a message to a transport results in a error message
MassTransit.MessageNotConsumedException: 'loopback://localhost/mediator => The message was not consumed'
Publishing a doest add a message on to RabbitMQ
Is there a way to do this with the ConsumeContext
rather than injecting IBusControl
or IBus
as i would like to keep the context of the message thread