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

Reconnecting synchronous sink #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

SpeedyCoder
Copy link
Contributor

Add experimental version of synchronous sink adapter that automatically reconnects on failures using the provided backoff strategy. It also periodically checks the status of the underlying async sink and reconnects as necessary. I've just quickly put this together, so it's not fully tested yet, but I think it should work. It's a breaking change so I've put it to experimental folder for now.

…ly reconnects on failures using the provided backoff strategy.
@mjgarton
Copy link
Contributor

Why implement reconnection at the synchronous level?

A reconnecting async sink would be more flexible and useful in a wider set of contexts.

@mjgarton
Copy link
Contributor

How might this interact with suburl?

@SpeedyCoder
Copy link
Contributor Author

SpeedyCoder commented Mar 27, 2019

The reason why I've implemented it at the synchronous level is that I can just return error to any pending write calls, when the sink is disconnected, as I don't know whether the message was sent successfully. This is not possible in the asynchronous case as then I can only send an acknowledgement. We could do something similar for async sink, but in that case we could only reconnect when there are no pending messages.

We could make this a parameter in the suburl, so that the resulting sink is wrapped in the reconnecting one.

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

Successfully merging this pull request may close these issues.

2 participants