rebus-org / Rebus.RabbitMq

:bus: RabbitMQ transport for Rebus
https://mookid.dk/category/rebus
Other
65 stars 45 forks source link

RabbitMq transport does not honor options when creating queues during send. #109

Closed antpata closed 10 months ago

antpata commented 1 year ago

BabbitMqTransport.CheckQueueExistence() does not check _declareExchanges, _declareInputQueue nor _bindInputQueue when creating queues during send. https://github.com/rebus-org/Rebus.RabbitMq/blob/6137a7ce7754e0c855865657822e062283cf09bb/Rebus.RabbitMq/RabbitMq/RabbitMqTransport.cs#L893C14-L893C14

It is little bit questionable what it should do but like in case where a receiver will create queues & exchanges and sender does not know what kind of routing and queues the receiver will use it would be nice if these option will be followed in all use cases.

Yes there is an work-a-round to enable the mandatory call back but it is little confusing to enable a feature to disable another one which already have a disable option but it does not work on send but that option seems to works on receive.

mookid8000 commented 1 year ago

First off, I want to make it entirely clear that there's no connection between CheckQueueExistence and the transport's _declareExchanges, _declareInputQueue, and _bindInputQueue settings, because the settings are relevant only to the instance's OWN input queue.

The CheckQueueExistence thing does not actually create queues or exchanges, it only checks whether the destination exchange and queue exist (via [Queue|Exchange]DeclarePassive calls), and then it proactively binds the queue to the correct routing key.

If anything, there should maybe be a separate option to _disableDestinationQueueCheck or something like that, if you do not like this behavior. But please note that you will then be able to send messages to non-existing queues, which will cause the messages to disappear without any warnings of any kind.

If you'd like to be able to disable destination queue checking, I would be happy to guide you in creating a PR.

mookid8000 commented 10 months ago

Closing for now. Let me know if you still feel something needs to be done about this. 🙂