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 » General IBM MQ Support » Single queue, multiple readers

Post new topic  Reply to topic
 Single queue, multiple readers « View previous topic :: View next topic » 
Author Message
Rclements
PostPosted: Thu Oct 03, 2002 9:52 am    Post subject: Single queue, multiple readers Reply with quote

Novice

Joined: 20 Jun 2002
Posts: 18

I have a single queue. and I want to launch a number of java programs which each read a message from the queue, do some stuff and repeat.

When I try this, only the first two java reader programs seem able to get messages form the queue. The other java reader programs seem incapable of getting message from the queue.

I am assuming that this a configuration issue with MQ, or the Java APIs

any suggestions?

ricardo
Back to top
View user's profile Send private message Send e-mail
dgolding
PostPosted: Thu Oct 03, 2002 8:36 pm    Post subject: Reply with quote

Yatiri

Joined: 16 May 2001
Posts: 668
Location: Switzerland

First of all, when you say "unable", what do you mean? What error code are you getting from the MQGET (or it's Java equivalent)?

At a guess, the first process has got the the queue opened as MQOO_INPUT_EXCLUSIVE - try MQOO_INPUT_SHARED. These are the options when opening a queue, EXCLUSIVE means only this process is able to GET messages from the queue.

Another way is to open the queue as MQOO_INPUT_QDEF, and change the queue attribute to SHARE (which appears to be the default)

HTH
Back to top
View user's profile Send private message Visit poster's website
Rclements
PostPosted: Mon Oct 07, 2002 7:14 pm    Post subject: Single queue, Multiple Readers Reply with quote

Novice

Joined: 20 Jun 2002
Posts: 18

If you read the second paragraph you will note that TWO reader programs are sucessfully reading the queue, so it follows that ..EXCLUSIVE is not being used.

When I say that other java programs seem incapable, here is what I mead

The testing sequence is as follows:

1. Load Queue A with 900 msg (each of about 10 chars in length)
2. Start three reader programs using a blocking read on queue B
3. Start a program which reads a msg from Queue A and writes it to Queue B and repeats this process until Queue A is empty.

The results are :
Reader program 1 reads about 420 msgs (varies each time I run it)
Reader program 2 reads about 480 (all the other msgs)
Reader program 3 reads 0 msgs
Reader program n also reads 0 msgs

I had assumed that each reader program would process some messages instead only the first 2 programs did, and all others that were started read 0 msgs.

??
ricardo
Back to top
View user's profile Send private message Send e-mail
nimconsult
PostPosted: Mon Oct 07, 2002 11:00 pm    Post subject: Reply with quote

Master

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

Maybe it goes so fast that the queue is empty once the third application is started.

On my computer (W2K, MQ5.2, MA88 Java classes for MQ) 900 messages can be processed in about one second.

I have tried with 100.000 messages and I can see an acceptable distribution over three processes (within 15% difference). The messages were processed in 116 seconds.

The client and server applications I have used are part of the sample applications provided with JASMQ, the Java Application Server for Websphere MQ. You can get a free version (after registration) on www.nimconsult.be, in the section JASMQ. The JASMQ software will be announced in the coming days on this forum.
_________________
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 » General IBM MQ Support » Single queue, multiple readers
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.