Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

How do I "restart" watching Key-Value #259

Open
dyeshurun opened this issue Aug 23, 2017 · 4 comments
Open

How do I "restart" watching Key-Value #259

dyeshurun opened this issue Aug 23, 2017 · 4 comments

Comments

@dyeshurun
Copy link

I am connecting consul using a token that can be revoked and then I am starting to watch for changes using KVCache.
When my consul token is expired I see "Error getting response from consul" in the log (coming from ConsulCache onFailure callback).
I couldn't find a way to intercept this failure and re-connect to consul.
Any idea?

@rickfast
Copy link
Owner

You might have to use the lower level API to do this unfortunately. I don't have the time at the moment to update ConsulCache to support this. PRs welcome

@dyeshurun
Copy link
Author

Meanwhile I used "ConsulBookend" , I am checking the status code in the "post" method and do my reconnection there

@koiuo
Copy link

koiuo commented Mar 26, 2018

@rickfast what lower level API exactly are you talking about?

@nicolaos
Copy link

Hello, we have the same problem of reloading the token when it expires.
@dyeshurun can you please share the workaround with ConsulBookend you mentioned?
I am finding it hard to intercept the 403 on callbacks and consequently stop all services caches and property caches without incurring in interrupted exceptions.

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

No branches or pull requests

4 participants