Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IBM MQ-SERIES Linking
Message
From
19/12/2006 17:14:25
 
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01178880
Message ID:
01179033
Views:
19
>Has anyone had any experience linking to queues on IBM MQ-series?
>I was hoping to use VFP to call some sort of MQ-Series API, to retrieve data from queues.
* from cmcq.h
#define MQOO_INPUT_AS_Q_DEF           0x00000001
#define MQOO_INPUT_SHARED             0x00000002
#define MQOO_INPUT_EXCLUSIVE          0x00000004
#define MQOO_BROWSE                   0x00000008
#define MQOO_OUTPUT                   0x00000010
#define MQOO_INQUIRE                  0x00000020

DEFINE CLASS mq AS Custom
MQSession = NULL
QM = NULL
ResponseQ = NULL
DIMENSION BrowseInfo[1,5]

FUNCTION Init
WITH this
  .MQSession = CREATEOBJECT("mqax200.mqsession")

  .QM = .MQSession.AccessQueueManager("YourQueueManagerName")
  .ResponseQ = .QM.AccessQueue("YourQueueName",MQOO_INQUIRE+MQOO_INPUT_AS_Q_DEF)
ENDWITH
ENDFUNC


**************
* Read/Destroy
**************
FUNCTION Read
LPARAMETERS tcID
IF NOT EMPTY(tcID)
  LOCAL oGetMsg, oGetOptions
  oGetMsg = this.MQSession.AccessMessage()
  oGetOptions = this.MQSession.AccessGetMessageOptions()

  *
  * Set the ID to retrieve
  *
  oGetMsg.MessageId = tcID
  *
  * Get the message
  *
  this.ResponseQ.Get(oGetMsg,oGetOptions)
  this.QM.Commit()
  
ENDIF
ENDFUNC
ENDDEFINE
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform