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 » Dynamic Queue Creation

Post new topic  Reply to topic
 Dynamic Queue Creation « View previous topic :: View next topic » 
Author Message
mdinicol
PostPosted: Wed Nov 24, 2004 6:44 am    Post subject: Dynamic Queue Creation Reply with quote

Newbie

Joined: 24 Nov 2004
Posts: 2

I'm new to MQSeries Java so please bear with me. I am trying to programmatically create a handful of queues in MQ depending up real time data I'm ingesting. I have been using the MQ Simulator for Java Developers in WSAD and also the "Embedded Messaging" and I'm obtaining the same results with both.

Here is my code:
MQQueueManager queueManager = new MQQueueManager("WAS_localhost_server1");
MQQueue myQueue = queueManager.accessQueue("DynamicQueue1", MQC.MQOO_OUTPUT, "DynamicQueue1", null, null);

The queueManager is connected but when I try to execute the "accessQueue" method I get this exception:

com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2196

I don't understand the "model queue" type which the api refers to with this method. I have tried several types of open options but nothing seems to work. I'm not using any security so this should help. I don't know if I need to get the JMSAdmin tool working but that is a whole other issue of things not working. Any help would be appreciated.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Nov 24, 2004 10:14 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

Your problem has nothing to do with the JMSAdmin tool because you are not using JMS!!!

Time to RTM.

Think of a model queue as a template. By default, when you create a queue manager, a default model queue is created called: 'SYSTEM.DEFAULT.LOCAL.QUEUE'

Therefore, your code should look like:
Code:
String inputQName   = "SYSTEM.DEFAULT.MODEL.QUEUE";
String DynamicQName = "ABC.*";
String replyQName   = null;
int openInputOptions= MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED;

MQQueueManager _qMgr = new MQQueueManager(qMgrName);

MQQueue _inQ = _qMgr.accessQueue( inputQName,
                                  openInputOptions,
                                  null,           // default q manager
                                  DynamicQName,   // dynamic q name
                                  null );         // no alternate user id

replyQName = _inQ.name; // save this!!!


Please download and read the WMQ Using Java manual.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
mdinicol
PostPosted: Wed Nov 24, 2004 11:45 am    Post subject: Reply with quote

Newbie

Joined: 24 Nov 2004
Posts: 2

Roger,

Thanks so much for replying. I have read and browsed 3 red books and couldn't find the information your gave me. Everything is working now. I will also read the WMQ Using Java you suggested.

Thanks for your help !!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Nov 24, 2004 4:14 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

And as you are obviously in a Web Application Server (WAS) I would suggest you move to JMS and not base Java.

If you are using Websphere WAS 5.x the JMS configuration should take place in the Admin console (does not use JMSAdmin). Check for the right provider : Websphere MQ JMS. You need to specify the model queue / and default name pattern for temporary queues on the qcf / tcf

You will need a full MQ Server to be linked to WAS. The internal MQ is severely restricted and will not allow communication to outside qmgrs.

Enjoy
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Dynamic Queue Creation
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.