Plz refer below for clarification.
I guess I'm not clear on what your asking. So let me post a couple thoughts, and maybe you can clear this up for me:
You have a servlet doing a lot of work, it takes too long. You're considering moving that to a MDB so the client doesn't have to wait for the result The client will poll the server to see if the work is done? Another servlet will see if the MDB posted a message indicating that it was done? Or the client just starts the work and doesn't care whether it finishes?
----
Yes u r right that currently servlet is doing lot of work so it takes long.When the teacher is scanning answer sheets, each sheet takes arould 15-20 sec for getting scanned which is not acceptable. so some portion related to database has been put in ScanningMDB. So now when the teacher will scan, he will get the message, 'scan successful' and he'll be able to scan a new sheet. On the server side ScanningMDB will be doing the database work. So this way teacher's work will be over soon. So during scanning, scanningservlet will call methods written in ScanningMDB and proceed ahead. Yes, scanningservlet doesn't have to bother whether the work finishes or not.
What do you mean by deploying at runtime?
-------
Deployment at runtime means deployment at startup of the ems server. i think using the term 'Deployment at runtime ' is wrong. ScanningMDB should be deployed as any other
EJB when the server starts.
You mean, when the work comes
in, you want to create a new queue for this specific task and deploy a new MDB to handle just that bit of work, and then have the MDB and queue go away when the work is done?
----
no i dont mean this.
Wouldn't it be easier to just have an
always-on queue and MDB and post a message with some sort of task identifier?
--------
yes i've added the entry for queue in config-tokenized.xml and that solves thepurpose, i get an always on queue which will handle the messages.
i hope now things r clear.
Regards,
srinivas