Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MQv6 MQCMD_INQUIRE_Q_NAMES - Getting 2309 - example please :-)

Status
Not open for further replies.

StevePBrooks

Programmer
Joined
Jan 23, 2008
Messages
1
Location
CA
We're converting from MQ5 to MQ6, I'm converting our various programs that issue PCF commands to use the MQV6 APIs. All of our code that query queue attributes (MQCMD_INQUIRE_Q) convert and work fine with the new MQAI APIs, but I have some routines that need to get a list of all the queues that match a partial Q name and am getting 2309 when I'm using the MQCMD_INQUIRE_Q_NAMES in the MQExecute. Googling I can't find any examples, and trying different approaches seem to all result in 2309s. Here's the code that I'm using below:

mqCreateBag(MQCBO_ADMIN_BAG, &adminBag, &compCode, &reason);
mqCreateBag(MQCBO_ADMIN_BAG, &responseBag, &compCode, &reason);
mqAddString(adminBag, MQCA_Q_NAME, MQBL_NULL_TERMINATED, "QR.PROCESS_STATUS*", &compCode, &reason);
mqAddInteger(adminBag, MQIA_Q_TYPE, MQQT_REMOTE, &compCode, &reason);

mqExecute(hConn, MQCMD_INQUIRE_Q_NAMES,MQHB_NONE,adminBag,responseBag,MQHO_NONE,MQHO_NONE,&compCode,&reason);

if ( compCode == MQCC_OK ) {
mqCountItems(responseBag, MQHA_BAG_HANDLE, &numberOfBags, &compCode, &reason);

for ( i=0; i<numberOfBags; i++)
{
mqInquireItemInfo(responseBag, MQSEL_ANY_SELECTOR, i,&selector,&itemType,&compCode,&reason);
// THIS InquireItemInfo gives ITEMTYPE: MQITEM_INTEGER and selector: -8 ??

// trying the call below results in a 2309:
mqInquireString(responseBag, MQCA_Q_NAME, 0, MQ_Q_NAME_LENGTH, qName,
&qNameLength, NULL, &compCode, &reason);

// trying to get an attributes bag and Q_NAME also results in a 2309:
mqInquireBag(responseBag, MQHA_BAG_HANDLE, i, &qAttrsBag, &compCode, &reason);
mqInquireString(qAttrsBag, MQCA_Q_NAME, 0, MQ_Q_NAME_LENGTH, qName,&qNameLength, NULL, &compCode, &reason);

What code should I be using to get the list of remote queue names that start with QR.PROCESS_STATUS ?

Thanks VERY MUCH !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top