mercredi 13 mai 2015

Injecting ejb in rest service (JAX-RS) on jboss

Currently I am using JNDI look up of an ejb beans in my all rest methods. I am having almost 3-4 JNDI look up in every rest method.

So I thought of injecting ejb's in rest service rather than JNDI look up (I think it will reduce overheads of JNDI look up each time. correct me if I am wrong here)

I found one way for injecting ejb in Rest service is to make Rest service class as bean itself (with @Stateless). But that will increases my total bean instance.

So my questions are:

1-increasing total bean class will reduce performance? as we have max size pool 20(default)

2-when bean instance is created? at the time of starting jboss or when bean method called? (if when bean method is called then my rest service bean instance will never be created as I am not calling rest method by created its object)

3-or JNDI lookup is still better than having this extra beans?

Aucun commentaire:

Enregistrer un commentaire