-
Hi, I'm not sure if it's a issue or not so i prefer to start a new discussion. I use the SDK Java Jersey 2.4 with Spring Boot. I've added a bean When "FeatureHubConfig" is initialized, a newContext is built : (FeatureHub SDK sources)
With this new context, the repository and a new JerseyClient are created : (still FeatureHub SDK sources)
Everything is ok. The JerseyClient start to listen and the repository is populated. Then, for every request, a new context is created and with the supplier Each JerseyClient start its own requests and listen in order to update the same repository. At the end of every request, the "requestScope" bean Should the Some commentaries aren't coherent :
Why Am I not understanding something ? It works very well with a single unclosabled Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hey there! The source of the newConext in your example is missing some critical checks: `
` If null is passed in both cases (as it is for newContext().build()), it is checking if the edge and repository already exist on the FHClient, so it won't create them again, unless I am missing a logic bomb of some kind? I think your comment about closing the context at the end of the requestScoped bean is the confusion here. The close actually doing anything should only be on the ServerEvaluatedFeatureContext, you should not call it when you are using client-evaluated (for your Spring Boot server). I think the "weOwnRepositoryAndEdge" was me thinking it was the only connection you had and you were using client evaluated features, but thats pretty unlikely, so I should just make that close method do nothing. Apologies for the confusion! |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for the fast answer ! With
Thus the line You can easily check it with a breakpoint in the constructor. Since ClientEvalFeatureContext is always created with a new JerseyClient (it seems like a bug), it's normal to close it. java reflection + ... in :
I hope it will help. |
Beta Was this translation helpful? Give feedback.
-
Took me a while to find this again! I totally get you and on the other SDKs, I haven't made this mistake 🤦 - there are a few issues i'll fix over this coming weekend and this is one of them. If you could like to track it, you could open this as a bug in that repo? |
Beta Was this translation helpful? Give feedback.
Took me a while to find this again! I totally get you and on the other SDKs, I haven't made this mistake 🤦 - there are a few issues i'll fix over this coming weekend and this is one of them. If you could like to track it, you could open this as a bug in that repo?