|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Inquring channel status through PCF commands |
« View previous topic :: View next topic » |
Author |
Message
|
ksubodh |
Posted: Tue Feb 05, 2002 3:06 am Post subject: |
|
|
Novice
Joined: 15 Jan 2002 Posts: 10 Location: Bangalore ,IBM India.
|
Hi All;
I am trying to build a PCF command to get the status of the channel.
The code is in c lang.
Here is the code for ur kind ref:
//Geting the Length for PCF to be build
AdminMsgLen =MQCFH_STRUC_LENGTH
+ MQCFST_STRUC_LENGTH_FIXED
+ CHANNEL_NAME_LENGTH ;
// Creating Command (PCF) message
pAdminMsg = (MQBYTE *)malloc( AdminMsgLen );
pPCFHeader = (MQCFH *)pAdminMsg;
pPCFHeader->Type = MQCFT_COMMAND;
pPCFHeader->StrucLength = MQCFH_STRUC_LENGTH;
pPCFHeader->Version = MQCFH_VERSION_1; //this ver. I am using//
pPCFHeader->Command = MQCMD_INQUIRE_CHANNEL_STATUS;
pPCFHeader->MsgSeqNumber = MQCFC_LAST;
pPCFHeader->Control = MQCFC_LAST;
pPCFHeader->ParameterCount = 0;
pPCFString = (MQCFST *)(pAdminMsg + MQCFH_STRUC_LENGTH );
// Setup parameter block
pPCFString->Type = MQCFT_STRING;
PCFString->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, '\0', MQ_CHANNEL_NAME_LENGTH);
memcpy( pPCFString->String, "ABC.TO.XYZ", sizeof("ABC.TO.XYZ"));
// Setting MQMD Header
memset(md.ReplyToQMgr, '\0', MQ_Q_MGR_NAME_LENGTH );
md.MsgType = MQMT_SYSTEM_FIRST;
memcpy(md.ReplyToQ, replyQ, MQ_Q_NAME_LENGTH );
memcpy(md.Format, MQFMT_ADMIN, 8 );
// Setting Put Message Options
pmo.Options = MQPMO_NO_SYNCPOINT;
// Putting Command message on Command Queue
MQPUT( hConn,
hAdminQ,
&md,
&pmo,
AdminMsgLen,
pAdminMsg,
&CompCode,
&Reason
);
if (CompCode == MQCC_OK)
{
printf("nPut Sucessful");
}
else
{
printf("n Put UNSucessful CompCode , Reason = %d , %d ", CompCode , Reason);
return;
}
free( pAdminMsg );
//
Now my problem starts here. I want to know what is the structure type of the response message and also the length of the mesage I have to allocate the buffer to get it.
Is the code below for getting the response is OK.
But with this code I am not able to read the message from the queue although the PCF command has sucessfully executed and the mesage is lying inside the Q.
//
AdminMsgLen = MQCFH_STRUC_LENGTH
+ (MQCFST_STRUC_LENGTH_FIXED )
+ MQ_CHANNEL_NAME_LENGTH ;
pAdminMsg = (MQBYTE *)malloc( AdminMsgLen );
Thanks for any kind suggestion in advance.
|
|
Back to top |
|
 |
RebeccaC |
Posted: Wed Feb 13, 2002 3:39 pm Post subject: |
|
|
Newbie
Joined: 11 Feb 2002 Posts: 2
|
Firstly, when you say you are not able to read the message from the queue, what is actually going wrong. Is the MQGET failing? If so what is the reason code.
As for the structure size, if you are requesting all parameters to be returned (as it appears you are, as I think this is the default) the struct size is:
#define StatusMsgLen_L ( MQCFH_STRUC_LENGTH
+ (MQCFST_STRUC_LENGTH_FIXED * 10)
+ (MQCFIN_STRUC_LENGTH * 20)
+ MQ_CHANNEL_NAME_LENGTH
+ MQ_Q_NAME_LENGTH
+ MQ_CONN_NAME_LENGTH
+ MQ_LUWID_LENGTH
+ MQ_LUWID_LENGTH
+ MQ_CHANNEL_TIME_LENGTH
+ MQ_CHANNEL_DATE_LENGTH
+ MQ_CHANNEL_TIME_LENGTH
+ MQ_CHANNEL_DATE_LENGTH
+ MQ_MCA_JOB_NAME_LENGTH )
There is good information about this PCF here:
http://www-4.ibm.com/software/ts/mqseries/library/manualsa/csqzai/csqzai32.htm
I hope this helped,
Rebecca |
|
Back to top |
|
 |
isreal |
Posted: Fri Feb 15, 2002 10:01 am Post subject: |
|
|
Novice
Joined: 18 Sep 2001 Posts: 22
|
Perhaps a look at the `Administration Interface and Programming Guide Reference' would help you out alot. The MQAI API makes what you want to do *a lot* easier. Basically, you build an "admin bag" and send it to the server, a "response bag" will be returned that contains the information you need. You can then pull what info you need from the response bag. Check out the `Programmable System Management' (p294 for channel status stuff) book for more info.
Graeme. |
|
Back to top |
|
 |
ping master |
Posted: Mon Mar 31, 2003 1:19 pm Post subject: |
|
|
 Centurion
Joined: 20 Sep 2002 Posts: 116 Location: USA
|
if you did want to use the MQAI to get a channel status, the only required param is Channel Name MQCACH_CHANNEL_NAME.
So you would add that item to the admin bag only? how about the response bag, anyone have any knowledge of this? thanks alot |
|
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
|
|
|
|