ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Pls validate the given design (waiting for msg's on the Que)

Post new topic  Reply to topic
 Pls validate the given design (waiting for msg's on the Que) « View previous topic :: View next topic » 
Author Message
yaravind
PostPosted: Thu Jan 30, 2003 8:04 am    Post subject: Pls validate the given design (waiting for msg's on the Que) Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
yaakovd
PostPosted: Thu Jan 30, 2003 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
yaravind
PostPosted: Thu Jan 30, 2003 11:14 am    Post subject: no support for JMS only IBM Base Java API Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
ebegoli
PostPosted: Fri Jan 31, 2003 9:45 am    Post subject: Desing Issues Reply with quote

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
View user's profile Send private message
yaakovd
PostPosted: Fri Jan 31, 2003 10:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
yaravind
PostPosted: Fri Jan 31, 2003 10:27 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
yaakovd
PostPosted: Fri Jan 31, 2003 11:37 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
nimconsult
PostPosted: Mon Feb 03, 2003 12:03 am    Post subject: Reply with quote

Master

Joined: 22 May 2002
Posts: 268
Location: NIMCONSULT - Belgium

A Java "main", using MQ classes for Java (not JMS), listening to a queue and calling you back for every message retrieved?

You are looking for JASMQ:
http://www.mqseries.net/pafiledb203/pafiledb.php?action=viewfile&fid=57

Easy to use, documented, tested on Windows and Unix platforms, efficient, with many samples.


Nicolas
_________________
Nicolas Maréchal
Senior Architect - Partner

NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Pls validate the given design (waiting for msg's on the Que)
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.