Roger Lacroix
2013-08-19 22:44:10 UTC
All,
I have been beating my head against the wall all afternoon and I just
can't figure out what I have done wrong.
In Java, to get the individual channel statuses via PCF you would do:
request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, chlNameMask);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
CMQC.MQOT_CURRENT_CHANNEL);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
new int []
{
CMQCFC.MQCACH_CHANNEL_NAME,
CMQCFC.MQIACH_CHANNEL_STATUS,
} );
Here is my C code that gets an RC of 3016:
pPCFHeader = (MQCFH *)AdminMsg;
pPCFString = (MQCFST *)(AdminMsg + MQCFH_STRUC_LENGTH);
pPCFInteger = (MQCFIN *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED + MQ_CHANNEL_NAME_LENGTH);
pPCFIntegerList = (MQCFIL *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH) +
MQCFIN_STRUC_LENGTH;
/* Setup request header */
pPCFHeader->Type = MQCFT_COMMAND;
pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
pPCFHeader->Version = MQCFH_VERSION_1;
pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
pPCFHeader->MsgSeqNumber = MQCFC_LAST;
pPCFHeader->Control = MQCFC_LAST;
pPCFHeader->ParameterCount = 3;
AdminMsgLen = pPCFHeader->StrucLength;
/* Setup parameter block */
pPCFString->Type = MQCFT_STRING;
pPCFString->StrucLength = MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH;
pPCFString->Parameter = MQCACH_CHANNEL_NAME;
pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
pPCFString->StringLength = MQ_CHANNEL_NAME_LENGTH;
memset( pPCFString->String, ' ', MQ_CHANNEL_NAME_LENGTH );
memcpy( pPCFString->String, pCMQ->ChannelMask, strlen(pCMQ->ChannelName) );
AdminMsgLen += pPCFString->StrucLength;
/* Setup parameter block */
pPCFInteger->Type = MQCFT_INTEGER;
pPCFInteger->StrucLength = MQCFIN_STRUC_LENGTH;
pPCFInteger->Parameter = MQIACH_CHANNEL_INSTANCE_TYPE;
pPCFInteger->Value = MQOT_CURRENT_CHANNEL;
AdminMsgLen += pPCFInteger->StrucLength;
/* Setup parameter block */
pPCFIntegerList->Type = MQCFT_INTEGER_LIST;
pPCFIntegerList->StrucLength = MQCFIL_STRUC_LENGTH_FIXED + (2 *
sizeof(MQLONG));
pPCFIntegerList->Parameter = MQIACH_CHANNEL_INSTANCE_ATTRS;
pPCFIntegerList->Count = 2;
pPCFIntegerList->Values[0] = MQCACH_CHANNEL_NAME;
pPCFIntegerList->Values[1] = MQIACH_CHANNEL_STATUS;
AdminMsgLen += pPCFIntegerList->StrucLength;
If I set the ParameterCount to 2 and remove the pPCFIntegerList code
then the PCF command works. It returns the summary of the channels
but I want the individual channel statuses. i.e. The individual
channel statuses of when you have multiple instances of the same
channel running.
Does anyone see anything wrong with my C code?
Regards,
Roger Lacroix
Capitalware Inc.
To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html
I have been beating my head against the wall all afternoon and I just
can't figure out what I have done wrong.
In Java, to get the individual channel statuses via PCF you would do:
request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, chlNameMask);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE,
CMQC.MQOT_CURRENT_CHANNEL);
request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS,
new int []
{
CMQCFC.MQCACH_CHANNEL_NAME,
CMQCFC.MQIACH_CHANNEL_STATUS,
} );
Here is my C code that gets an RC of 3016:
pPCFHeader = (MQCFH *)AdminMsg;
pPCFString = (MQCFST *)(AdminMsg + MQCFH_STRUC_LENGTH);
pPCFInteger = (MQCFIN *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED + MQ_CHANNEL_NAME_LENGTH);
pPCFIntegerList = (MQCFIL *)( AdminMsg +
MQCFH_STRUC_LENGTH +
MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH) +
MQCFIN_STRUC_LENGTH;
/* Setup request header */
pPCFHeader->Type = MQCFT_COMMAND;
pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
pPCFHeader->Version = MQCFH_VERSION_1;
pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
pPCFHeader->MsgSeqNumber = MQCFC_LAST;
pPCFHeader->Control = MQCFC_LAST;
pPCFHeader->ParameterCount = 3;
AdminMsgLen = pPCFHeader->StrucLength;
/* Setup parameter block */
pPCFString->Type = MQCFT_STRING;
pPCFString->StrucLength = MQCFST_STRUC_LENGTH_FIXED +
MQ_CHANNEL_NAME_LENGTH;
pPCFString->Parameter = MQCACH_CHANNEL_NAME;
pPCFString->CodedCharSetId = MQCCSI_DEFAULT;
pPCFString->StringLength = MQ_CHANNEL_NAME_LENGTH;
memset( pPCFString->String, ' ', MQ_CHANNEL_NAME_LENGTH );
memcpy( pPCFString->String, pCMQ->ChannelMask, strlen(pCMQ->ChannelName) );
AdminMsgLen += pPCFString->StrucLength;
/* Setup parameter block */
pPCFInteger->Type = MQCFT_INTEGER;
pPCFInteger->StrucLength = MQCFIN_STRUC_LENGTH;
pPCFInteger->Parameter = MQIACH_CHANNEL_INSTANCE_TYPE;
pPCFInteger->Value = MQOT_CURRENT_CHANNEL;
AdminMsgLen += pPCFInteger->StrucLength;
/* Setup parameter block */
pPCFIntegerList->Type = MQCFT_INTEGER_LIST;
pPCFIntegerList->StrucLength = MQCFIL_STRUC_LENGTH_FIXED + (2 *
sizeof(MQLONG));
pPCFIntegerList->Parameter = MQIACH_CHANNEL_INSTANCE_ATTRS;
pPCFIntegerList->Count = 2;
pPCFIntegerList->Values[0] = MQCACH_CHANNEL_NAME;
pPCFIntegerList->Values[1] = MQIACH_CHANNEL_STATUS;
AdminMsgLen += pPCFIntegerList->StrucLength;
If I set the ParameterCount to 2 and remove the pPCFIntegerList code
then the PCF command works. It returns the summary of the channels
but I want the individual channel statuses. i.e. The individual
channel statuses of when you have multiple instances of the same
channel running.
Does anyone see anything wrong with my C code?
Regards,
Roger Lacroix
Capitalware Inc.
To unsubscribe, write to LISTSERV-0lvw86wZMd9k/bWDasg6f+***@public.gmane.org and,
in the message body (not the subject), write: SIGNOFF MQSERIES
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://listserv.meduniwien.ac.at/archives/mqser-l.html