rabbitmq-mock
rabbitmq-mock copied to clipboard
MockFanoutExchange constructor accessibility
Hello everyone,
First of all thank you to the maintainers for your amazing piece of software - it has saved us tons of time and seems to be quite nicely extensible.
Is there a reason why com.github.fridujo.rabbitmq.mock.exchange.MockFanoutExchange.MockFanoutExchange() is protected?
I only want to implement a delegating "x-delayed-message" mock where the underlying exchange type is defined by "x-delayed-type" AmqArgument.
Best regards, Vasil Stoyanov
Hello :wave:
Thanks for your compliments, it is a pleasure !
I guess the initial motivation for keeping the constructor of MockFanoutExchange
protected
is to encourage creating a subclass of BindableMockExchange
or one of its existing subclasses when in need of a new exchange type.
You can find an implementation of a delaying exchange in tests (cf https://github.com/fridujo/rabbitmq-mock/blob/master/src/test/java/com/github/fridujo/rabbitmq/mock/exchange/FixDelayExchange.java).
You can use this implementation and change its super class to MockFanoutExchange
if that is you need.
For the dynamic part of the delegate exchange, why not simply chain two exchanges ? (or more if you need specific routing strategies depending on a message property)