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

Add support for any kind of declarations when reconnecting #152

Closed
wants to merge 2 commits into from

Conversation

hofmeister
Copy link

Reason:
Because of auto-deletions, exclusivity etc all rabbitmq topology needs to be definable by clients.
This will add a more flexible topology definition which will ensure the topology is recreated on reconnection if needed.

Note: Breaking Changes

  • Changes all single-queue or single-exchange options to be arrays
  • Adds QueueName to ConsumerOptions to define the queue that should be listened to
  • Adds ExchangeName to the PublisherOptions to define the default exchange to publish to
  • Adds Queues, Exchanges and Bindings to both ConsumerOptions and PublisherOptions
  • Expands Binding struct to allow for exchange bindings and non-primary queue bindings

Changes are only breaking if accessing the options structs directly - all With* handlers have been made backwards-compatible and a few new ones added to support common cases.

…nsumer

Note: Breaking Changes
- Removes ConsumerOptions.QueueOptions is removed
- Removes ConsumerOptions.ExchangeOptions is removed
- Adds ConsumerOptions.QueueName as the queue to listen to
- Adds slices Queues, Exchanges and Bindings to ConsumerOptions
- Adds slices Queues, Exchanges and Bindings to PublisherOptions
- Expands Binding to allow for exchange bindings
@wagslane
Copy link
Owner

wagslane commented Mar 4, 2024

I made an update that I think might resolve your primary concerns, check the WithConsumerOptionsExchangeOptions function.

I think using multiple exchanges isn't crazy common, so I left the other functions, they just modify the first exchange. If you want multiple exchanges you're expected to define all the configuration explicitly.

@hofmeister
Copy link
Author

hofmeister commented Apr 8, 2024

I think it makes sense to support all topology definitions given if you don't - it basically means this library can not be used in those cases - since you own the connections (and do not expose them in the API). This makes transient topology impossible to define unless this library does it because of exclusive / auto-delete things (you can not access that on a secondary connection).

But we're ok the use our fork in any case.

@hofmeister hofmeister closed this Apr 10, 2024
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

Successfully merging this pull request may close these issues.

2 participants