1 Reply Latest reply on Aug 26, 2009 11:27 AM by Manik Surtani

    A Simple Question

    Evrde Frssw Newbie

      I've just read an interview on infoq.

      http://www.infoq.com/news/2009/05/infinispan


      "I have seen data grids used for message passing though, this is a de�nite no-no. This can put a lot of unnecessary pressure on nodes where keys get mapped to. If you need to use a distributed tool for message passing, use JMS. Thatʼs what JMS is optimized for."


      and this statement makes me knock my head to the walls, because this is the solution which I am thinking of.

      Actually I have a problem like this:

      Front end web servers creates web service calls to third parties, has a business requirement of 2 min timeout and front end user awareness of the web service call result.

      When the third party servers are in high traffic this makes our web servers too loaded also, because the threads in our servers are hang up to wait for the timeout period.

      Anyway I thought a solution that a distributed hash map will solve all my problems, just check a key, and the executor thread updates the key.

      Anyway ,I am very sorry to take your precise time.

      If you have time to explain what should I do, i will be glad.

        • 1. Re: A Simple Question
          Manik Surtani Master

          You could implement this using a mix of a JMS queue and Infinispan.

          E.g., incoming requests check infinispan for the state. If it is not there it puts a request on the queue with all the necessary parameters. You then have a MDB which processes this queue. As the MDB reads stuff off the queue, it first checks the cache to see if the key is present. If it is, it continues as per normal. Otherwise, it retrieves state from the web service and adds this to the cache with a strict timeout (to make sure the state expires and doesn't live in the cache forever). Your request threads, in the meanwhile, have registered a listener on the cache so is notified of the added key and is then able to proceed.