Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS and Message-Driven Beans; Job Percent Complete  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am interested in creating asynchronous messages in order to create large reports that a user requests, but for which the user is unwilling to wait. In other words, small reports will be generated on-the-fly and returned to the user's browser, but large reports will be processed in the background and selected for viewing via the browser once the processing has been completed. My question is this: how does one monitor such asynchronous processing? In other words, if I want the application to tell the user how much of the report has been processed so far (i.e. 10%, 50%, 90%, etc), so that the user has a rough idea of how much longer they have to wait to view the report, how does one do this via JMS and Message-Driven Beans? Any feedback is appreciated. Thanks.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Addendum to my first post: it is realized that percent complete for a job is only possible if the total size of the job is known - of a higher importance is whether the client can be notified when a job starts, is in process, and ends. A detailed answer to this post is not expected, but a point in the right direction is appreciated. Thanks.
 
Brian Tinnel
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One idea that comes to my mind is to create a topic, and have your client create a background thread that subscribes to the topic. Then your report generator can publish a message to the topic with an Id to identify the client and a status message. when the client gets the message, it can check the Id to see if it should process the message. This would allow multiple clients to be getting status using a single topic.
 
venkatesh rajmendram
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am in similar situation as Erik, I was planning to use JMS point to point or MQ and have Message driven bean process and update database where user can go and check the status and if completed result...I was wondering how was your experience, and anybody else can add their experience that would be great input for my decisions...

Thanks
Venkatesh
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My current system has an applet that opens a ServerSocket and registers itself with the server at login. To send "push" content to the browser the server opens a client socket and sends info. The applet calls out to a JavaScript function on our permanent frame window in the browser. This is a nice generic mechanism to fire any JavaScript method by a name provided in the message.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!