Discussions

General J2EE: Approaches for multi-threading in an App Server?

  1. Approaches for multi-threading in an App Server? (2 messages)

    Hello. I'm building a Spring MVC+Hibernate web application using WebLogic and have a need for multi-threaded processing (i.e. process a JMS message after persisting the contents).

    What is the recommended approach for this? I've considered the following so far:
    1. Create a thread (or pool of threads)
    2. Trigger some Spring scheduled process (or have it run frequently)
    2. Start up another Servlet and communicate with that from the Spring MVC app

    Any ideas would be appreciated. Thanks.
  2. Why not just use an MDB to process the JMS Message? This way you can use your Hibernate classes to persist the contents of the message and then carry on whatever other processing you have to do. Pooling etc. is handled by the container for the MDB.
  3. Unfortunately, I'm using an internal API that wraps the JMS stuff. But, I understand your point and I should be able to do the same with the wrapper version. Thanks.