Results 1 to 3 of 3

Thread: how to map sync EJB call to async JMS req/resp pair

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Posts
    1

    Default how to map sync EJB call to async JMS req/resp pair

    Folks,

    Basically, we have the situation our session bean synchronous
    call map to asynchronous JMS messages.
    In other words, a session bean method call would have the
    following implementation logic:
    1. marshall params and send async JMS message.
    2. wait around for a reply message to be ready
    3. receive a reply JMS message, unmarshall response.
    4. return.
    The problem, clearly, is that we can't do step 2 in the EJB method itself for fear
    of tying up threads.

    I use JMSTemplate to send and receive (block with timeout and select on correlationid)

    This seems like a classic problem of mapping synchronous EJB calls to asynchronous
    backends.

    Any suggestions how to do this?

    Thanks,
    Jabir

  2. #2
    Join Date
    Aug 2005
    Location
    Oklahoma City, OK, USA
    Posts
    1

    Default

    This may be a silly and late response, but why aren't you using Message Driven Beans?
    ______________
    John Mufarrige
    john@jmuf.net

  3. #3
    Join Date
    Feb 2005
    Location
    Boston, MA
    Posts
    1,142

    Default

    The alternative is to create a local object which sends the message to JMS and does a receive, typing up the thread on the client side, not the server side.

    Ultimately all synchronous calls are asynchronous with some sort of waiting in the middle. It just depends where you want to put the wait. If you were to call a database directly from an EJB using the underlying database API would have to submit an asynchronous call and then some sort of wait tying up the thread.

    I imagine you want to use JMS to make you application more scalable on the server side. For this you need to make your client side either more complicated or consume more resources.

Similar Threads

  1. Replies: 1
    Last Post: Feb 10th, 2005, 09:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •