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 callback prior to reconnection attempt #283

Merged
merged 4 commits into from Aug 29, 2019
Merged

Conversation

ajhattozxcorp
Copy link
Contributor

@ajhattozxcorp ajhattozxcorp commented Feb 24, 2019

Added an optional 'OnReconnecting' callback in the client options, which can be used to modify the client options just prior to reconnection attempts.

In our particular case, we needed to do this to update custom authentication tokens in the HTTP headers section, as our authentication tokens can expire and need renewing before reconnection attempts.

@alsm
Copy link
Contributor

alsm commented Mar 20, 2019

I had started doing something more specific to just HTTP Headers, but this would be fine too. I think it should just be named reconnecthandler as the will prefix could be confused to be related to the mqtt will facility. Also I'm not sure the ClientOptions passed to the handler func need wrapping in another struct. You will also need to register with eclipse and sign the CLA to pass the check. Thanks

@ajhattozxcorp
Copy link
Contributor Author

@alsm I've made some updates inline with your suggestions and signed the Eclipse Contributor Agreement.

@alsm
Copy link
Contributor

alsm commented Aug 29, 2019

Thanks for the update on this, apparently you need to sign off your commits for it to pass the eca check.

@alsm alsm merged commit 0cff61e into eclipse:master Aug 29, 2019
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.

None yet

2 participants