Hi folks, We are developing an application with the following characteristics: - users can invoke requests on our appl and they will expect a quick response - to obtain the information requested by the user, our application talks with Tibco using RV. This communication follows a pub/sub messaging paradigm and is asynchronous. - thus, we have a synchronous req/resp front-end and an asynch back-end.
We would like some advice as to the best way of architecting this application. Here is our approach. Please critic and suggest alternatives.
1. Consider an user who has requested something from our app.
2. The user will be using a JSP based front-end. (S)he submits the request on a form and a servlet is driven.
3. The servlet uses a session EJB and invokes one of its methods, which handles some business-specific logic.
4. The method in the session EJB then instantiates a helper class.
5. A method on our helper class is now driven. This method sends a message to Tibco and it provides a callback method in the helper class.
6. The method in the helper class blocks the thread - basically, it waits.
7. Meanwhile, Tibco does the processing and invokes the callback method (in the helper class) with the result.
8. In the callback method, the data sent by Tibco is stored in member variables of the helper class.
9. The callback method wakes up the blocking thread.
10. The method in step 6 wakes up and returns the information to the session EJB.
11. The session EJB returns the information to the invoking servlet.
12. The servlet provides the information back to the user.
The version of Tibco-RV that we are using is not JMS compliant.
We keep hearing that threads should be handled very carefully in an EJB container environment, so we would like to know if the way we are handling the thread in the helper class is okay. Could we remove the helper class and do the same thread-handling in the session EJB itself?
Can we use JMS in this solution even though our Tibco-RV does not support JMS?
Tools: Weblogic App Server 6.1, JBuilder 5.0.
Thanks for your advice and suggestions!