[jax-rs-spec users] [jsr339-experts] Re: Server sided use of JAX-RS client API: Valid in which server sided components?

From: Jan Algermissen <>
Date: Tue, 26 Jun 2012 23:41:16 +0200

Hi Markus,

On Jun 16, 2012, at 3:50 PM, Markus KARG wrote:

> Experts,
> some weeks ago we discussed server sided use of the new JAX-RS client API, e. g. to pull information from an external RESTful web service.
> As I remember, at least for EJBs (SBs, MDBs) it is forbidden to use blocking operations, threading operations, files API and sockets API. All this for the sake of stability and security.

Yes, this is a good question because it is too easy to assume you could just chunk up a larger system into HTTP services and fire calls between the services all over the place.

In my opinion, serving an HTTP request must not involve an upstream HTTP call unless in the case of relatively infrequent requests (e.g. order submission) or unless a local cache is very well known to have a sufficient hit ration.

Turning every user request into a (cascade of) upstream HTTP requests is not really what we want. This statement is not as ridiculous as it sounds because software architects and consulting firms come up with such designs all over the place :-) ... or, well, rather :-(

I am not sure how a container could 'enforce' anything here, but IMHO HTTP-servers-as-clients is as much a container issue as transactions are.



> So the good question now is: Is this at least allowed for managed beans (CDI / JSF) or servlets? Anybody being a member of that particular EGs, knowing the answer for sure? Because if the same rule would apply to managed beans, JSF and servlets, what server side use case did we actually had in mind back then? RAR? JCA? Please comment. :-)
> Thanks
> Markus