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

Support Switching broker Url for Operational(Publish only) failures #1970

Open
dheerajtenepalli opened this issue Mar 14, 2024 · 0 comments
Open

Comments

@dheerajtenepalli
Copy link

Good evening folks,

Given a list of urls or a string containing multiple urls to the Kombu Connection object, I see that kombu currently supports switching between broker urls for connection failovers i.e. when trying to create connections.

For Operational failovers like publish failures, it retries the same url according the given retry_policy. We were wondering if kombu has any plans to support switching connections to other broker urls as specified by the failover_strategy and try to publish to the new broker url.

This would be an additional feature that would be supported by a new variable.

Solution:
I played around with the solution a bit and found that adding self.maybe_switch_next() line at https://github.com/celery/kombu/blob/main/kombu/connection.py#L577 would solve the issue. But, I am not completely sure if this needs to be added anywhere else as well.

Ofc, the above needs to be tested. Let me know if kombu already has plans to implement such option. Thanks.

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

1 participant