Search code examples
c#.net-coreamazon-sqsmasstransitamazon-mq

Share single AmazonMQ with multiple Environments?


I'd like to use MassTransit with Amazon MQ (maybe Amazon SQS/SNS?). When creating the MassTransit Bus is there some means to give the bus a name or prefix? This would allow a team of developers to share the same instance as each queue, route, bridge, etc. name would be prefixed (and thus unique).

Digging thru the MassTransit configuration code for both brokers, it doesn't look like that is possible. Though I would think this would be a broker-independent setting.

RabbitMQ supports virtual hosts which could be used for this purpose, but I think that is specific to RabbitMQ.


Solution

  • You can specify your own EntityNameFormatter, which is used to generate the name for published events. To send messages, you can format the queue names yourself, so you could add a prefix at that level.

    This isn't something that is handled at the host level today, though it continues to come up and might be worth further investigation.