smallrye-graphql icon indicating copy to clipboard operation
smallrye-graphql copied to clipboard

Allow configuring the CDI scope of configured clients

Open jmartisk opened this issue 3 years ago • 4 comments

Right now, configured typesafe clients are always a Singleton (which also prevents mocking them!), dynamic clients are Dependent REST Client allows configuring the scope, so we should probably do the same

jmartisk avatar Mar 03 '22 07:03 jmartisk

We have the same problem, and it cause hibernate session holding all the time(a Singleton every request). So when it can be fix ^_^

meepown avatar Jul 12 '22 10:07 meepown

I'm fine with a hard dependency on CDI, but we tried to avoid until now. Or do you think we can still keep it optional?

t1 avatar Jul 12 '22 11:07 t1

I'm fine with a hard dependency on CDI, but we tried to avoid until now. Or do you think we can still keep it optional?

I'm so appreciate it if it can be optional. Because some other lib is stateful like hibernate. CDI can't be avoided if we use these stateful lib.

meepown avatar Jul 12 '22 11:07 meepown

I haven't gotten around to it yet. You're welcome to work on it if you wish ;) I think CDI can still remain optional for the client library with this (the scope will just be ignored)

jmartisk avatar Jul 27 '22 09:07 jmartisk