|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Can you do this in VB.Net |
« View previous topic :: View next topic » |
Author |
Message
|
klamerus |
Posted: Sat Jul 30, 2005 4:11 am Post subject: Can you do this in VB.Net |
|
|
 Disciple
Joined: 05 Jul 2004 Posts: 199 Location: Detroit, MI
|
Can you do the following (which is in C) in VB.Net? In particular the part on the stats?
int
main(
int argc,
char * argv[ ] )
{
MQHCONN hConn;
MQCHAR qmName[ MQ_Q_MGR_NAME_LENGTH + 1 ] = "";
MQLONG compCode, reason;
MQHBAG adminBag = MQHB_UNUSABLE_HBAG;
MQHBAG responseBag = MQHB_UNUSABLE_HBAG;
MQHBAG qAttrsBag;
MQLONG mqEnqCount, mqDeqCount;
MQLONG numberOfBags, i;
printf( "Display enqueues and dequeues of local queues\n\n" );
if ( argc > 1 )
strncpy( qmName, argv[ 1 ], ( size_t ) MQ_Q_MGR_NAME_LENGTH );
MQCONN( qmName, &hConn, &compCode, &reason );
CheckCallResult( "MQCONN()", compCode, reason );
if ( compCode == MQCC_FAILED )
exit( ( int ) reason );
mqCreateBag( MQCBO_ADMIN_BAG, &adminBag, &compCode, &reason );
CheckCallResult( "mqCreateBag(adminBag)", compCode, reason );
mqCreateBag( MQCBO_ADMIN_BAG, &responseBag, &compCode, &reason );
CheckCallResult( "mqCreateBag(responseBag)", compCode, reason );
mqAddString( adminBag, MQCA_Q_NAME, MQBL_NULL_TERMINATED, "Test1", &compCode, &reason );
CheckCallResult( "mqAddString(Test1)", compCode, reason );
mqExecute( hConn, MQCMD_RESET_Q_STATS, MQHB_NONE, adminBag, responseBag, MQHO_NONE, MQHO_NONE, &compCode, &reason );
CheckCallResult( "mqExecute(MQCMD_RESET_Q_STATS)", compCode, reason );
if ( compCode != MQCC_OK )
exit( ( int ) reason );
mqCountItems( responseBag, MQHA_BAG_HANDLE, &numberOfBags, &compCode, &reason );
CheckCallResult( "mqCountItems(numberOfBags)", compCode, reason );
printf( "There are %d bags in the result collection\n", numberOfBags );
for ( i = 0; i < numberOfBags; i++ )
{
mqInquireBag( responseBag, MQHA_BAG_HANDLE, i, &qAttrsBag, &compCode, &reason );
CheckCallResult( "mqInquireBag(responseBag)", compCode, reason );
mqInquireInteger( qAttrsBag, MQIA_MSG_ENQ_COUNT, MQIND_NONE, &mqEnqCount, &compCode, &reason );
CheckCallResult( "mqInquireInteger(mqEnqCount)", compCode, reason );
printf( "There are %d enqueues on Test1\n", mqEnqCount );
mqInquireInteger( qAttrsBag, MQIA_MSG_DEQ_COUNT, MQIND_NONE, &mqDeqCount, &compCode, &reason );
CheckCallResult( "mqInquireInteger(mqDeqCount)", compCode, reason );
printf( "There are %d dequeues on Test1\n", mqDeqCount );
}
if ( adminBag != MQHB_UNUSABLE_HBAG )
{
mqDeleteBag( &adminBag, &compCode, &reason );
CheckCallResult( "mqDeleteBag(adminBag)", compCode, reason );
}
if ( responseBag != MQHB_UNUSABLE_HBAG )
{
mqDeleteBag( &responseBag, &compCode, &reason );
CheckCallResult( "mqDeleteBag(responseBag)", compCode, reason );
}
MQDISC( &hConn, &compCode, &reason );
CheckCallResult( "MQDISC()", compCode, reason );
return( 0 );
} |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jul 30, 2005 10:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried it ?
What was the result ? |
|
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
|
|
|
|