-
Let's say I have this :
What will be the default scope ? I cannot really find this information in the documentation, except it says that there will be only a single instance of the REST resource. Is there any reason to explictitely use one of this scope explicitely ? The documentation says that its better to use @ApplicationScoped : https://quarkus.io/guides/cdi#applicationscoped-and-singleton-look-very-similar-which-one-should-i-choose-for-my-quarkus-application But I am not sure if it applies to REST resources. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For
Indeed, this recommendation is intended for application developers. Extensions can decide to use In other words, it does not make sense to add |
Beta Was this translation helpful? Give feedback.
For
quarkus-resteasy
(RESTEasy Classic), it's controlled by thequarkus.resteasy.singleton-resources
config property and it should be@Singleton
by default. Forquarkus-rest
(RESTEasy Reactive, default rest extension), it's@Singleton
by default AFAIK. But maybe there are some exceptions? CC @geoand @FroMage.