Discussions

EJB design: JMS Queue config question ( Can distributed queue be used ? )

  1. I am having a situation where clients from a browser submits Http requests to generate reports. Typically the reports takes from 1 min to 20 minutes to run.
    In our current implementation, there is a servlet that gets the reporting request and processess synchronously.
    Some times we see the app hanging etc.

    So,I wanted to introduce messaging to this and decouple the client from the server.

    1. The servlet writes the report-request to a JMS queue
    2. There is a QueueReceiver which asynchronously reads the report request and sends a message back to another queue,
    which the servlet ( from step 1 )is reading. I am planning to use co-relation ids for identifying the response

    3. Now the servlet ( from step 1) will synchronously try to read with timeout ( if the report-request got processed quickly around 1 minute ). If it gets something in the queue with the co-relation id then it returns the report back. If id does not receive anything within a minute, then it throws back a message to the user saying that the request is being submitted in background.

    4. Mean while there is another MDB in background listening for messages from the same queue ( like Servlet in step 3). The idea is to have this MDB pickup response messages for which processing took longer than 1 minute.

    This way the client will have a better experience in that for short report-requests he will get synchronous response
    wheres as for longer requests he will be notified that the report is running in the background.

    Pl let me know what is the best way to implement this scenario. Can I use distributed destinations and have one queue forward to another after a forward-delay of 1 minute.
    Or can I use transactions to achieve this behaviour.

    Your time is greatly appreciated

    Thanks
    Kiran Rajapur
  2. If this is for a real time development - I would recommend using any reporting software such as Actuate. It can easily provide you the status of scheduled reports running..You can invoke Actuate API to get the details and format in your front-end.
  3. If this is for a real time development - I would recommend using any reporting software such as Actuate. It can easily provide you the status of scheduled reports running..You can invoke Actuate API to get the details and format in your front-end.

    Thanks,
    Sridhar
  4. We are using Crystal Reports Server.
    Not sure if Crystal Reports has the ability you are talking about.
  5. Same[ Go to top ]

    I am doing the same thing. But we just trigger the process of stating reporting by sending message to MDB . Once it gets the message , it triggers a batch file outside the server. The batch file actaully starts a new java process and this process actaully makes reports. When done , it reports back to MDB , and MDB sends the reply back with status. It all works.
    But , there is a overhead of starting a new JVM and triggering batch process from MDB. Initialization itself can take 20 seconds about, but I think if you use it for really big reports its negligible.
    We have implemensted this in websphere and it all seems to perform well.
    Let me know if you have questions.
    RC