回覆列表
  • 1 # zhaokeyi5945

    {

    //前面是準備管理器和佇列

    MQQueueManager qMgr = new MQQueueManager(qManager);

    int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT | MQConstants.MQOO_INQUIRE;

    MQQueue queue = qMgr.accessQueue(qName, openOptions);

    MQMessage rcvMessage = new MQMessage();

    MQGetMessageOptions gmo = new MQGetMessageOptions();

    gmo.options = gmo.options MQConstants.MQGMO_WAIT MQConstants.MQGMO_SYNCPOINT;

    //讀取五秒超時,這裡目的是要有個讀取阻塞,和Socket程式設計類似。

    gmo.waitInterval = 5000;

    queue.get(rcvMessage, gmo);

    //後面就是操作訊息的部分【略】

    }catch(Exception e){{

    //前面是準備管理器和佇列

    MQQueueManager qMgr = new MQQueueManager(qManager);

    int openOptions = MQConstants.MQOO_INPUT_AS_Q_DEF | MQConstants.MQOO_OUTPUT | MQConstants.MQOO_INQUIRE;

    MQQueue queue = qMgr.accessQueue(qName, openOptions);

    MQMessage rcvMessage = new MQMessage();

    MQGetMessageOptions gmo = new MQGetMessageOptions();

    gmo.options = gmo.options MQConstants.MQGMO_WAIT MQConstants.MQGMO_SYNCPOINT;

    //讀取五秒超時,這裡目的是要有個讀取阻塞,和Socket程式設計類似。

    gmo.waitInterval = 5000;

    queue.get(rcvMessage, gmo);

    //後面就是操作訊息的部分【略】

    }catch(Exception e){

  • 中秋節和大豐收的關聯?
  • 龜苓膏是什麼?