jakartaee / rest

Jakarta RESTful Web Services
Other
351 stars 114 forks source link

CDI details : Configuration #1195

Open jansupol opened 7 months ago

jansupol commented 7 months ago

In the environment of shared CDI, if multiple Applications are started/deployed, what is the expected behavior? Do the applications share their configuration? Or do the implementations need to find a way to distinguish between the configuration, providers, and properties for each Application when injecting them? Or is the expectation to have just one microservice runtime for each application?

Was this already discussed and I missed the discussion?

spericas commented 7 months ago

@jansupol Is this related to the proposal to evaluate multiple applications in 4.0? Is that what you mean by "shared CDI"?

jansupol commented 7 months ago

@spericas No, my original concern was an application server such as Glassfish running a single CDI instance while deploying multiple applications/wars and registering the respective Configuration beans into this shared CDI BeanManager. In the end, yes, it is the same as supporting multiple Applications at a time.

spericas commented 7 months ago

@jansupol In an app server environment, shouldn't applications be completely isolated to each other? Isn't this typically accomplished using independent CLs? Maybe I'm just not understanding the "shared CDI" use case and you can elaborate it a bit more.

jansupol commented 5 months ago

@spericas Is it isolated in the EAR, too? There are multiple WARs and multiple applications at the same war, too.

jamezp commented 5 months ago

From what I understand, there was no decision made on whether more than one application could be defined per WAR, https://github.com/jakartaee/rest/issues/1158. In the API section there seems to be an open question of:

Review support for Application subclasses: zero or more? zero or one?

The current spec itself doesn't indicate whether multiple applications are supported.

arjantijms commented 4 months ago

Is it isolated in the EAR, too? There are multiple WARs and multiple applications at the same war, too.

Actually, CDI has never really worked well with an EAR. The specification just wasn't designed for it, even though it tries some things with hierarchical bean archives. EARs are more associated with EJB and JNDI, maybe just about SOAP, and many "reffing" (role-refs, datasource-refs, etc).

Modern REST / CDI applications don't seem to be used with EARs at all, at least that's my perception (and those specs somewhat back that up).

Some good resources on this: