The following APIs are used to interact with WebSphere MQ Everyplace:
A queue manager name must:
A queue name must
#include <hmq.h> MQEHSESS MQeInitialize( MQECHAR * SessionName, MQEINT32 * pCompCode, MQEINT32 * pReason)
The SessionName must be:
If the returned *pCompCode equals MQECC_ERROR, *pReason may have any of the following values:
#include <hmq.h> MQEHSESS hSess; MQEINT32 compcode; MQEINT32 reason; hSess = MQeInitialize("MyAppsName", &compcode, &reason); if (hSess!=MQEHANDLE_NULL) { MQeTerminate(hSess, &compcode, &reason, ); }
#include<hmq.h> MQEVOID MQeTerminate( MQEHSESS hSess, MQEINT32 * pCompCode, MQEINT32 * pReason)
#include <hmq.h> MQEHSESS hSess; MQEINT32 compcode; MQEINT32 reason; hSess = MQeInitialize("MyAppsName", &compcode, &reason); if (hSess!=NULL) { MQeTerminate(hSess, &compcode, &reason); }
#include <hmq.h> MQEINT32 MQeGetVersion ( MQEINT32 * pCompCode, MQEINT32 * pReason);
#include <hmq.h> MQEINT32 compcode; MQEINT32 reason; MQEINT32 version; version = MQeGetVersion(&compcode, &reason);
#include <hmq.h> MQEVOID MQeConfigCreateQMgr ( MQECHAR * pQMgrName, MQEINT32 * pCompCode, MQEINT32 * pReason);
#include <hmq.h> MQEHSESS hSess; MQEINT32 compcode, reason; MQEINT16 len; MQECHAR name[128]; hSess = MQeInitialize( "aSession", &compcode, &reason); len = MQeQMgrGetName( hSess, name, 128, &compcode, &reason); name[len] = '\0'; MQeConfigDeleteQMgr( name, &compcode, &reason); MQeConfigCreateQMgr( "MyOwnQMgr", &compcode, &reason);
#include <hmq.h> MQEVOID MQeConfigDeleteQMgr ( MQECHAR * pQMgrName, MQEINT32 * pCompCode, MQEINT32 * pReason);
#include <hmq.h> MQEHSESS hSess; MQEINT32 compcode, reason; MQEINT16 len; MQECHAR name[128]; hSess = MQeInitialize( "aSession", &compcode, &reason, ); len = MQeQMgrGetName( hSess, name, 128, &compcode, &reason); name[len] = '\0'; MQeConfigDeleteQMgr( name, &compcode, &reason, ); MQeConfigCreateQMgr( "MyOwnQMgr", &compcode, &reason, );
#include <hmq.h> MQEVOID MQeTraceCmd ( MQEHSESS hSess, MQEINT32 Cmd, MQEINT32 Parm, MQEINT32 * pCompCode, MQEINT32 * pReason);
#include <hmq.h> MQEHSESS hSess; MQEINT32 compcode, reason; hSess = MQeInitialize("MyAppsName", &compcode, &reason); /* Start the trace */ MQeTraceCmd ( hSess, MQE_TRACE_CMD_START, 0, &compcode, &reason ); MQeTraceCmd ( hSess, MQE_TRACE_CMD_SET_MASK, MQE_TRACE_OPTION_SYS_ERROR | MQE_TRACE_OPTION_APP_MSG, &compcode, &reason); MQeTrace( hSess, MQTS(" Starting MQe...")); MQeTrace( hSess, MQTS("IThis is a information trace msg.")); /* Stop the trace */ MQeTraceCmd ( hSess, MQE_TRACE_CMD_STOP, 0, &compcode, &reason ); /* Terminate the MQe session */ MQeTerminate( hSess, &compcode, &reason);
#include <hmq.h> MQEVOID MQeTrace ( MQEHSESS hSess, MQETCHAR * pTStr);
#include <hmq.h> MQHSESS hSess; MQEINT32 compcode; MQEINT32 reason; hSess = MQeInitialize("MyAppsName", &compcode, &reason ); /* Start the trace */ MQeTraceCmd ( hSess, MQE_TRACE_CMD_START, 0, &compcode, &reason); MQeTraceCmd ( hSess, MQE_TRACE_CMD_SET_MASK, MQE_TRACE_OPTION_SYS_ERROR | MQE_TRACE_OPTION_APP_MSG, &compcode, &reason ); MQeTrace( hSess, MQTS(" Starting MQe...")); MQeTrace( hSess, MQTS("IThis is a information trace msg.")); /* Stop the trace */ MQeTraceCmd ( hSess, MQE_TRACE_CMD_STOP, 0, &compcode, &reason ); /* Terminate the MQe session */ MQeTerminate( hSess, &compcode, &reason);