Author |
Message
|
masteringmq |
Posted: Mon Nov 03, 2008 12:37 am Post subject: Namelist |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
DEFINE NL(COUNTRY) NAMES(QM1,QM2)
I imagine the above will send messages to QM1 and QM2. Now I define the namelist on my gateway. In my gateway there is alias queue pointing to QM1 and QM2. How do I put a message on the namelist and have it route the message to QM1 and QM2?. Is there any sample MQ script?  |
|
Back to top |
|
 |
David.Partridge |
Posted: Mon Nov 03, 2008 12:46 am Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
You can't put messages to a namelist.
All you can do with a namelist is to issue an MQINQ call to find out what its contents are.
If you are using MQ on pretty much any platform than z/OS you can use a distribution list to put the same message to multiple queues. If you need to put the same message to multiple queues, on z/OS, and you don't wish to hard code the queue names in the application (or its own config file), then you can use a namelist to store the names of the queues to which you are to put the messages.
Take a look at the source code amqsptl0.c to see how to use a distribution list. _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
masteringmq |
Posted: Mon Nov 03, 2008 1:57 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
Any sample in Java. I use Java.
amqsptl0.c - Comes along with MQ installation?. |
|
Back to top |
|
 |
masteringmq |
Posted: Thu Nov 13, 2008 1:32 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
I imagine I can create a distribution list at the application level. I can use vectors for example. Please advice. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 13, 2008 2:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
masteringmq wrote: |
I imagine I can create a distribution list at the application level. I can use vectors for example. Please advice. |
I imagine you can as well. Vectors would be one way. There's certainly no reason why you can't open multiple queues in an application and put messages to each, subject to resource constraints obviously.
If you're putting to a lot of queues, you might want to consider a pub/sub model. It may be easier & more scaleable. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
masteringmq |
Posted: Thu Nov 13, 2008 3:26 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
I imagine using every concept available will be good for my learning curve. |
|
Back to top |
|
 |
masteringmq |
Posted: Thu Nov 13, 2008 6:21 pm Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
Application Example:
MQDistributionListItem[] dil = new MQDistributionListItem[2];
MQDistributionListItem li1 = new MQDistributionListItem();
li1.queueName = "PONY.1";
dil[0] = li1;
MQDistributionListItem li2 = new MQDistributionListItem();
li2.queueName = "PONY.2";
dil[1] = li2; |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Nov 13, 2008 9:17 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
masteringmq wrote: |
Application Example:
MQDistributionListItem[] dil = new MQDistributionListItem[2];
MQDistributionListItem li1 = new MQDistributionListItem();
li1.queueName = "PONY.1";
dil[0] = li1;
MQDistributionListItem li2 = new MQDistributionListItem();
li2.queueName = "PONY.2";
dil[1] = li2; |
Check out the java samples.... I'm sure there is a distribution list example somewhere. If not search the net, you'll find one..
Are you just creating the DL or are you retrieving a name list to build your DL?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|