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 » MQDistributionLists

Post new topic  Reply to topic
 MQDistributionLists « View previous topic :: View next topic » 
Author Message
vandana
PostPosted: Wed Dec 05, 2001 8:15 pm    Post subject: Reply with quote

Acolyte

Joined: 01 Dec 2001
Posts: 74


How do i associate a DistributionListItem
with a queue using the MQSet Method??

What is the advantage of using DIstributionLists??
Back to top
View user's profile Send private message
middlewareonline
PostPosted: Fri Dec 07, 2001 8:27 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jul 2001
Posts: 73

Distribution List is associated using MQOPEN(). Using distribution list you can send same message to multiple queues in one PUT call. If you had to this w/o distribution list you would open each queue, do a put, and close.

Rajesh


_________________
---------------------------------------------
IBM & SUN (J2EE) Certified Consultants,
http://www.MiddlewareOnline.com
A "SARVAM" Online Portal
http://www.SARVAM.com
---------------------------------------------
Back to top
View user's profile Send private message Visit poster's website
vandana
PostPosted: Fri Dec 07, 2001 9:39 pm    Post subject: Reply with quote

Acolyte

Joined: 01 Dec 2001
Posts: 74


I'm working on nt 4.0 using java.
How is the association done in this case?
Back to top
View user's profile Send private message
abmanesh
PostPosted: Mon Dec 10, 2001 8:28 am    Post subject: Reply with quote

Apprentice

Joined: 06 Nov 2001
Posts: 39

Hi,
Here is a code snippet for working with distribution lists using MQSeries Java API.

String qManager = "SIDPCB328.QMGR1" ;
String hostName = "SIDPCB328";
String channel = "SIDPCB328.CLIENT" ;
String userId = "xxx" ;
int openOptions = MQC.MQOO_OUTPUT;

MQEnvironment.hostname = hostName ;
MQEnvironment.channel = channel ;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);

MQQueueManager qMgr = new MQQueueManager(qManager) ; // Obtain QueueManager

// Create an array of MQDistributionListItem objects. Size of the array is determined by the
// number of destination queues.

MQDistributionListItem[] items = new MQDistributionListItem[3];


// Create the individual items of the distribution list

MQDistributionListItem item1 = new MQDistributionListItem();
MQDistributionListItem item2 = new MQDistributionListItem();
MQDistributionListItem item3 = new MQDistributionListItem();

// Set the properties of the Individual Items.

item1.queueManagerName = "SIDPCB328.QMGR1";
item1.queueName = "QUEUE1";

item2.queueManagerName = "SIDPCB328.QMGR1" ;
item2.queueName = "QUEUE2" ;

item3.queueManagerName = "SIDPCB328.QMGR1" ;
item3.queueName = "QUEUE3" ;

// Populate the items array with the individaual items

items[0] = item1;
items[1] = item2;
items[2] = item3;

// Create a DistributionList object with the items.
MQDistributionList testDistribution = new MQDistributionList(qMgr, items,openOptions, userId);

MQMessage outMsg = new MQMessage();

MQPutMessageOptions pmo = new MQPutMessageOptions();

outMsg.writeString("This is a test message from Distribution List Application"); // Create a test message

testDistribution.put(outMsg, pmo); // Send message to the distribution list.

qMgr.commit();
testDistribution.close();

qMgr.disconnect();
Back to top
View user's profile Send private message Send e-mail
vandana
PostPosted: Mon Dec 10, 2001 10:18 pm    Post subject: Reply with quote

Acolyte

Joined: 01 Dec 2001
Posts: 74


thanks abmanesh !!!!.

the code was of great help.

Is it that we can put messges into
the queues of a single QueueManager?

In what scenario would one use a distributionList?


Back to top
View user's profile Send private message
vandana
PostPosted: Tue Dec 11, 2001 12:14 am    Post subject: Reply with quote

Acolyte

Joined: 01 Dec 2001
Posts: 74


abmanesh what i sthe significance
of userid here?
where do we create it?
Back to top
View user's profile Send private message
abmanesh
PostPosted: Tue Dec 11, 2001 3:34 pm    Post subject: Reply with quote

Apprentice

Joined: 06 Nov 2001
Posts: 39

Hi,
A distribution list can consist of queues on more than one queue manager. You specify the Queue Name and the Queue Manager Name of each item when you create the individual item.

The MQDistributionList class has only one constructor and it requires an alternate user id. This user id is used to validate the read/write previleges on the list of queues in the distribution list. There is no userid/password authentication on the userid you specify. The specified user id should have the required previleges within MQ.

About the use, it is similar to a cc list you would use in an e-mail when you want to send same message to multiple recipient. Or kind of faking a Publish model where you are publishing the same information to multiple subscribers without the complexity of a broker.

Back to top
View user's profile Send private message Send e-mail
vandana
PostPosted: Tue Dec 11, 2001 9:36 pm    Post subject: Reply with quote

Acolyte

Joined: 01 Dec 2001
Posts: 74

hi abmanesh,
but an application can connect to only one queuemanager at a time.
And the distribution list takes the name
of this queuemanager as a parameter.
how could we associate a single distribution
list with queue's of diffrerent queuemanagers?

thanks
vandana
Back to top
View user's profile Send private message
abmanesh
PostPosted: Wed Dec 12, 2001 4:29 pm    Post subject: Reply with quote

Apprentice

Joined: 06 Nov 2001
Posts: 39

There is not much detailed documentation on Distribution lists. How we have used it is to have remote queue definitions of the queues (that are not local to the queue manager you are connecting to) on the local queue manager.
The documentation of the sample program amqsptl0 , leads you down a path that you could associate queus on different queue managers directly.
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Wed Dec 12, 2001 5:07 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Doing that defeats one of the objects of Distribution Lists. If you have multiple destination queues on the same remote Queue Manager, then when you use a Distribution List, MQ only sends one message down the channel and puts copies on each Queue at the destination end. Using your technique, you would send multiple copies of the message down the channel.

Also, MQ is smart enough to know if the Queue Manager at the receiving end of a channel supports Distribution Lists and if it doesn't, then the sending MCA will send multiple messages, one to each destination queue.

Cheers,

_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
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 » MQDistributionLists
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.