Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MassTransit: Publish message with specified queue name

Tags:

masstransit

Is there any way to publish message with specified queue name in IPublishEndpoint without configure the queue name in startup class?

e.g.: I have this call and i want to pass the queue name inside it

await _publishEndpoint.Publish<SendMassege>(new { Body = message.Body });
like image 418
Adnan Avatar asked Jul 10 '26 22:07

Adnan


1 Answers

You don’t publish to queues, you send to queues.

You can get a send endpoint from the ConsumeContext or IBus by calling GetSendEndpoint with a URI specifying the queue name, such as queue:name.

like image 133
Chris Patterson Avatar answered Jul 18 '26 17:07

Chris Patterson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!