Closed mvsmasiero closed 1 month ago
Hello @mvsmasiero! I suppose connection is stable for 5 minutes and after that connection is being closed. Is connection lasting, for example, 30min better for you?
It seems like the cause why it doesn't reconnect is Proxy off. When Backend is working GBFeaturesRepository
successfully reconnects.
Hello @Bohdan-Kim
When the Java application loses connection to GB Proxy, this method on the GBFeatureRepository is called:
When the connectivity issue is fixed, the application only connects to GBProxy after restarting the application.
It seems like we should make changes to the sources in order to handle this.
The pull request was created according on the issue. We expect that calling initialize()
method with retryOnFailure
= true
will lead to execution of this block:
Hello @Bohdan-Kim , I've tested the solution.
With this solution, the Java application reconnects to GB Proxy successfully, but I've found a problem: if a flag is changed before the application reconnects, that change is not reflected.
I tested this change to fix it. What do you think?
if a flag is changed before the application reconnects
How is it possible that the flag can be changed? Calling initialize()
method the second time? The connection already established. Why calling the initialize()
method again is needed?
I think the chances of this happening are low, but I believe it is important to evaluate this possibility. For example: The GB Proxy may be down and the Product Owner does not know about it and activates some Flag or makes some other change.
Ok
I have a scenario where I use the GrowthBook proxy and use the Java SDK's GBFeaturesRepository class using the SERVER_SENT_EVENTS strategy.
When the application loses connection with the proxy (the proxy may restart or there is a network issue) the GBFeaturesRepository doesn't reconnect to the proxy.