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 » How to create dynamic queue using JMS APIs

Post new topic  Reply to topic
 How to create dynamic queue using JMS APIs « View previous topic :: View next topic » 
Author Message
jkothamb
PostPosted: Mon Jun 14, 2004 8:44 am    Post subject: How to create dynamic queue using JMS APIs Reply with quote

Newbie

Joined: 14 Jun 2004
Posts: 4

Hi Folks,

I am a newbie to MQ. I was wondering if there is way to create dynamic queue. I have read about model queue and how it can be leveraged via createTemporaryQueue call on a QueueSession. However, I not able to make it work using this generated dynamic queue in an ASF model i.e. Application Server Facilities, where it will be used for receiving replyTo messages on a ConnectionConsumer. It seems that the ServerSession gets a start call on receipt of a message which in turn calls the run method on the session, but onMessage never gets called that was registered with that session. I would appreciate any help on this matter.

Thank you,
Juzer.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jun 14, 2004 8:58 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Have you told the queue connection to start?
Using Java wrote:
A ConnectionConsumer is said to be active if it is not closed and its parent QueueConnection is started.

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jkothamb
PostPosted: Mon Jun 14, 2004 11:58 am    Post subject: Reply with quote

Newbie

Joined: 14 Jun 2004
Posts: 4

Yes, the connection is started. In fact, messages gets pulled from the dynamic queue since the ServerSession start method is called which in turn calls the run method on that session. Thanks for your help.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jun 14, 2004 12:29 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Does your code explicitly call the start method of the Queue Connection?

If so, please post your code, or at least as much of the relevant portions that you can.

If not, please change your code so it explicitly calls the start method of the Queue Connection.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jkothamb
PostPosted: Mon Jun 14, 2004 2:43 pm    Post subject: Reply with quote

Newbie

Joined: 14 Jun 2004
Posts: 4

Yes, verified, it does make an explicit call to start the QueueConnection. Let me pose another question which may help in resolving this problem. Does MQ allow creation of a ConnectionConsumer on a dynamic queue derived from a model queue. I have enclosed relevant code for your perusal.

Thanks.

// Code snippet
// creates a connectiom based on the source descriptor connection information
QueueConnection queueConn = mConnFactory.getQueueConnection(sourceDescriptor.mConnInfo);

// Create a ServerSession Factory
IJMSServerSessionFactory ssFactory = new QueueServerSessionFactory(queueConn, newSrcDesc,
new MessageHandlerFactory(mAdapter),
newSrcDesc.mBatchSize);

prefix = IJMSConstants.DEFAULT_SSS_PREFIX;

// generate dynamic queue
QueueSession session = queueConn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue queue = session.createTemporaryQueue();

// create server session pool
JMSServerSessionPool ssPool = new JMSServerSessionPool(ssFactory, prefix, IJMSConstants.DEFAULT_CAPACITY);

// create connection consumer
queueConn.createConnectionConsumer(queue, sourceDescriptor.mMsgSelector, ssPool, IJMSConstants.DEFAULT_MAX_MESSAGES);

// start the connection
queueConn.start();
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jun 14, 2004 3:36 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The difficulty seems to be in associating the temporary queue with the pooled sessions.

I'm able to get a temporary queue created... but it doesn't end up having the Open Input Count that I would expect, nor does it appear that any of my sessions are able to extract the test message.

So, I think it should be possible, but I can't help more than that - not without some serious playing around, and I'm just not up for that.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » How to create dynamic queue using JMS APIs
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.