Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockFanoutExchange constructor accessibility #181

Open
vstoyanov opened this issue Jan 15, 2021 · 1 comment
Open

MockFanoutExchange constructor accessibility #181

vstoyanov opened this issue Jan 15, 2021 · 1 comment

Comments

@vstoyanov
Copy link

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

@ledoyen
Copy link
Contributor

ledoyen commented Jan 15, 2021

Hello 👋

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants