|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Problem With Getting Channel Names |
« View previous topic :: View next topic » |
Author |
Message
|
debugme |
Posted: Thu Jan 15, 2004 1:24 am Post subject: Problem With Getting Channel Names |
|
|
 Apprentice
Joined: 14 Jan 2004 Posts: 27
|
Hello People
I know from previous code that I have 15 channels. But when I try running this code, I only get an item count of 1.
Any ideas why ?
Code: |
mqAddString(requestsBag, MQCACH_CHANNEL_NAME, MQBL_NULL_TERMINATED, "*", &completionCode, &reasonCode);
mqExecute(connection, MQCMD_INQUIRE_CHANNEL_NAMES, MQHB_NONE, requestsBag, responseBag, MQHO_NONE, MQHO_NONE,
&completionCode, &reasonCode);
mqCountItems(responseBag, MQHA_BAG_HANDLE, &itemCountInBag, &completionCode, &reasonCode);
printf("Found %d items in bag\t", itemCountInBag); |
puzzled, Asad. |
|
Back to top |
|
 |
JasonE |
Posted: Thu Jan 15, 2004 4:38 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
You get bag a bag containing a bag - Look at the amqsailq sample, modified its something like (ignore the trim to the qname length, its just a very quick hack):
mqCountItems(responseBag, MQHA_BAG_HANDLE, &numberOfBags, &compCode, &reason);
CheckCallResult("Count number of bag handles", compCode, reason);
for ( i=0; i<numberOfBags; i++)
{
int numchls = 0;
int j;
/***********************************************************************/
/* Get the next system bag handle out of the mqExecute response bag. */
/* This bag contains the queue attributes */
/***********************************************************************/
mqInquireBag(responseBag, MQHA_BAG_HANDLE, i, &qAttrsBag, &compCode, &reason);
CheckCallResult("Get the result bag handle", compCode, reason);
mqCountItems(qAttrsBag, MQCACH_CHANNEL_NAMES, &numchls, &compCode, &reason);
CheckCallResult("Count number of bag handles", compCode, reason);
/***********************************************************************/
/* Get the queue name out of the queue attributes bag */
/***********************************************************************/
for (j=0; j<numchls; j++) {
mqInquireString(qAttrsBag, MQCACH_CHANNEL_NAMES, j, MQ_Q_NAME_LENGTH, qName,
&qNameLength, NULL, &compCode, &reason);
mqTrim(MQ_Q_NAME_LENGTH, qName, qName, &compCode, &reason);
printf("%4ld %-48s\n", qDepth, qName);
}
} |
|
Back to top |
|
 |
debugme |
Posted: Wed Jan 21, 2004 1:47 am Post subject: Thanks for your help |
|
|
 Apprentice
Joined: 14 Jan 2004 Posts: 27
|
Sorry about the delay in response. Your remarks
were really helpful. Thanks again for all your help.
regards, Asad. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|