Author |
Message
|
yaravind |
Posted: Thu Jan 30, 2003 8:04 am Post subject: Pls validate the given design (waiting for msg's on the Que) |
|
|
Apprentice
Joined: 17 Jun 2002 Posts: 25
|
I am planning to implement the following design and I appreciate u guys help on this
1) Opne a Connection to the QM and the Queue in init() method of
HttpServlet
2) use the connections for polling for messages on the Queue
using "WAIT" with an intrval of 5 minutes
3) close the connection to Queue and QM in the destroy() method of HttpServlet
Thanks in advance |
|
Back to top |
|
 |
yaakovd |
Posted: Thu Jan 30, 2003 8:44 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
Is it should be a servlet?
You can write Java program based on javax.jms.MessageListener.
You can read the message and forward it to servlet if you need... _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
yaravind |
Posted: Thu Jan 30, 2003 11:14 am Post subject: no support for JMS only IBM Base Java API |
|
|
Apprentice
Joined: 17 Jun 2002 Posts: 25
|
I have to only use IBM Base Java API, As of now our infrastructure doesnt provide support for JMS |
|
Back to top |
|
 |
ebegoli |
Posted: Fri Jan 31, 2003 9:45 am Post subject: Desing Issues |
|
|
Newbie
Joined: 30 Jan 2003 Posts: 2
|
There are some things that I do not like about this design.
You are tieing the lifecycle of the listener, with the lifecyce of the servlet.
What happens if your server or servlet container crashes and destroy() does not get executed. How do you plan to control the lifecycle of the listener.
I think that using servlets as a trigger is certainly fine, but I think that you should be looking at some higher level of sophistication regarding the
control - use either event model where your listener coud respond to application events, or use RMI so that you can access listener from outside.
Finally, I think that you should use JMS. It is simply the cleanest API approach to the problem you have. |
|
Back to top |
|
 |
yaakovd |
Posted: Fri Jan 31, 2003 10:24 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
Agree!
Servlet is very good for simple operations like sending MQ message, but (for me) it is not good enough as listener. _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
yaravind |
Posted: Fri Jan 31, 2003 10:27 am Post subject: |
|
|
Apprentice
Joined: 17 Jun 2002 Posts: 25
|
Thanks for your suggestions but our infrastructure has no support for JMS.
I appreciate if u provide other alternatives. |
|
Back to top |
|
 |
yaakovd |
Posted: Fri Jan 31, 2003 11:37 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
I'm still suggesting to use regular java program with "main" .
Create thread - listener with infinite loop, pooling on Q every 5 seconds and wait 5 minutes after 3 times recignized Q empty.
Sample code for connection, brousing and reading message from Q you can find on http://www.capitalware.biz/pc_win_code_java.html
or search in internet for '+Java+sample_code+MQSeries'. _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
nimconsult |
Posted: Mon Feb 03, 2003 12:03 am Post subject: |
|
|
 Master
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
|
|
Back to top |
|
 |
|