Author |
Message
|
ajayvizag |
Posted: Thu Nov 26, 2009 3:33 am Post subject: Usage of Namelist |
|
|
Apprentice
Joined: 20 Feb 2009 Posts: 31
|
Hi All,
I would like to know how can a use or access a namelist in my MQClient which is a java program. I am done with creation of Namelist using the MQExplorer. I would like to know how to access that in my program. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Thu Nov 26, 2009 3:51 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
access it to do what ? what are you trying to implement? _________________ Regards, Butcher |
|
Back to top |
|
 |
ajayvizag |
Posted: Thu Nov 26, 2009 4:02 am Post subject: |
|
|
Apprentice
Joined: 20 Feb 2009 Posts: 31
|
I have a requirement to put a message in muliple queues. So i thought of creating a namelist and accessing the queue names inside it and place the message in all the queue mentioned in it. |
|
Back to top |
|
 |
zonko |
Posted: Thu Nov 26, 2009 9:42 am Post subject: |
|
|
Voyager
Joined: 04 Nov 2009 Posts: 78
|
Go ahead then. The details of how to do this are in the APR, MQOPEN, MQOD, MQOR, MQPUT, MQPMO, MQRR, MQPMR.
Have a look at the sample app amqsptl0.c to see how it all fits together. |
|
Back to top |
|
 |
ajayvizag |
Posted: Fri Nov 27, 2009 2:49 am Post subject: |
|
|
Apprentice
Joined: 20 Feb 2009 Posts: 31
|
Hi,
I have done the below things but didnt know how to open the namelist.
so i am stuck here
MQQueueManager mqQMgr=new MQQueueManager("XYZ");
int openoptions =MQC.MQOO_INQUIRE|MQC.MQOO_FAIL_IF_QUIESCING|MQC.MQOO_OUTPUT;
MQOD mqod = new MQOD();
mqod.ObjectName="TEST";
mqod.ObjectType=MQC.MQ_NAMELIST_NAME_LENGTH;
Stuck here i didnt get any info as to how to open the namelist and then access the queue names inside it..
Please help. |
|
Back to top |
|
 |
Mr Butcher |
Posted: Fri Nov 27, 2009 3:47 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
Quote: |
mqod.ObjectType=MQC.MQ_NAMELIST_NAME_LENGTH; |
well, setting the object type to the length of a namelist name is definitely wrong. to me it looks like you have no experience in mqseries programming at all, and you try to write a program based on that knowledge. go have some more reading in the APR, and in "using java", and check the samples. Start with a more simple program, e.g. connect to qmgr and disconnect. then add a queue open put close. then add the inquire of the namelist to get the list of queues. _________________ Regards, Butcher |
|
Back to top |
|
 |
ajayvizag |
Posted: Fri Nov 27, 2009 3:55 am Post subject: |
|
|
Apprentice
Joined: 20 Feb 2009 Posts: 31
|
Thanks for the suggestion. But i would like to say that if the above code sends a message that i am not aware of writing java code then i am sorry to say that you got it wrong. I would really appreciate if u would help me in addressing the problem. |
|
Back to top |
|
 |
zonko |
Posted: Fri Nov 27, 2009 4:21 am Post subject: |
|
|
Voyager
Joined: 04 Nov 2009 Posts: 78
|
I do not know anything about Java programming, but I can at least read a manual.
See this section:
Quote: |
An MQOD instance is used to specify an object by name. The following types of object are valid:
Queue
Process definition
Queue manager
|
So, you cannot open a namelist in Java. |
|
Back to top |
|
 |
shashivarungupta |
Posted: Fri Nov 27, 2009 6:21 am Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
ajayvizag wrote: |
I have a requirement to put a message in muliple queues. So i thought of creating a namelist and accessing the queue names inside it and place the message in all the queue mentioned in it. |
Is the Namelist your ultimate requirement to solve the problems ?
If you got multiple instances of the queues in the same cluster then it would have solved the problem. ( thats workload and performance , if you have configured it properly ). _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Nov 27, 2009 7:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
shashivarungupta wrote: |
ajayvizag wrote: |
I have a requirement to put a message in muliple queues. So i thought of creating a namelist and accessing the queue names inside it and place the message in all the queue mentioned in it. |
Is the Namelist your ultimate requirement to solve the problems ?
If you got multiple instances of the queues in the same cluster then it would have solved the problem. ( thats workload and performance , if you have configured it properly ). |
What does cluster load balancing have to do with this requirement?
Pub/Sub would be the other way to satisfy it.
Using the Namelist to build a distribution list is a common pattern. Look it up. I am sure there are some examples on the samples or on the net.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
shashivarungupta |
Posted: Fri Nov 27, 2009 8:28 am Post subject: |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
It was just the question to him...that if there is the solution of the problem can be solved with in the one cluster then why there is the need for the cluster namelist (unless he explains a good reason for that ). I don't have any objections though. Go ahead.
 _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
exerk |
Posted: Fri Nov 27, 2009 9:20 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
shashivarungupta wrote: |
...if there is the solution of the problem can be solved with in the one cluster then why there is the need for the cluster namelist... |
There you go again, either reading a different post to the rest of us, or seeing more than is there. Nowhere has the original poster stated that a cluster namelist was created, and his problem is putting to multiple queues, NOT multiple instances of a queue!  _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Nov 27, 2009 9:35 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
shashivarungupta,
Why are you discussing "cluster namelists" when the original post was about "namelists". There are 2 types of namelists in MQ: namelists (non-cluster) and cluster namelists.
Please stay on topic as it just confuses everyone when you start writing about random thoughts. Don't guess, ask the poster direct questions like "are you using X or Y?".
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
ajayvizag |
Posted: Sun Nov 29, 2009 9:39 pm Post subject: |
|
|
Apprentice
Joined: 20 Feb 2009 Posts: 31
|
Thank you all for ur valuabl suggestions. As some of u have rightly written that my requirement is to copy the same message into multiple queues. I have been digging in the manuals and it stated that namelist can be used in case of only few objects as said by one of you on top. Can anyone suggest me as to how to go with this problem. I am surrently writing down all the queue name in the configuration file and loading them in a hash table and getting them later to put messages to all of them one after the other but my intention was to have a design that will not impact the application(MQClient) i.e if i want to chage the queue names to which i have to publish i just need to modify at the MQLevel and do nothing to my code. Any body who has any idea pls help out |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Nov 29, 2009 11:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ajayvizag wrote: |
Thank you all for ur valuabl suggestions. As some of u have rightly written that my requirement is to copy the same message into multiple queues. I have been digging in the manuals and it stated that namelist can be used in case of only few objects as said by one of you on top. Can anyone suggest me as to how to go with this problem. I am surrently writing down all the queue name in the configuration file and loading them in a hash table and getting them later to put messages to all of them one after the other but my intention was to have a design that will not impact the application(MQClient) i.e if i want to chage the queue names to which i have to publish i just need to modify at the MQLevel and do nothing to my code. Any body who has any idea pls help out |
Like stated above, lookup an example of the distribution list in the manuals and the samples. If you want complete isolation between sender and receiver you should use the pub/sub pattern. (read the pub/sub manual)
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|