>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.
#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
FUNCTION Read
LPARAMETERS tcID
IF NOT EMPTY(tcID)
LOCAL oGetMsg, oGetOptions
oGetMsg = this.MQSession.AccessMessage()
oGetOptions = this.MQSession.AccessGetMessageOptions()
oGetMsg.MessageId = tcID
this.ResponseQ.Get(oGetMsg,oGetOptions)
this.QM.Commit()
ENDIF
ENDFUNC
ENDDEFINE