//新建本地隊列
PCFMessageAgent agent = new PCFMessageAgent("QM_janus");
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_CREATE_Q);
request.AddParameter(MQC.MQCA_Q_NAME, "test_queue");
request.AddParameter(MQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL);
//request.AddParameter(MQC.MQIA_USAGE, MQC.MQUS_TRANSMISSION);
PCFMessage[] response = agent.Send(request);
//刪除隊列
PCFMessageAgent agent = new PCFMessageAgent("QM_janus");
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_DELETE_Q);
request.AddParameter(MQC.MQCA_Q_NAME, "test_queue");
PCFMessage[] response = agent.Send(request);
//從隊列中讀取消息
MQQueueManager qMgr = new MQQueueManager("QM_janus");
MQQueue queue = qMgr.AccessQueue("postcard", MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.Options = MQC.MQGMO_WAIT;
gmo.WaitInterval = 1000;
gmo.MatchOptions = MQC.MQMO_NONE;
MQMessage message = new MQMessage();
queue.Get(message);
//向隊列寫消息
MQQueueManager qMgr = new MQQueueManager("QM_janus");
MQQueue queue = qMgr.AccessQueue("postcard", MQC.MQOO_OUTPUT);
MQMessage message = new MQMessage();
message.WriteString("message body");
queue.Put(message);
//枚舉所有隊列
PCFMessageAgent agent = new PCFMessageAgent("QM_janus");
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_NAMES);
request.AddParameter(MQC.MQCA_Q_NAME, "*");
PCFMessage[] response = agent.Send(request);
string[] names = response[0].GetStringListParameterValue(CMQCFC.MQCACF_Q_NAMES);