How to use the ibmmq.Get function in ibmmq

To help you get started, we’ve selected a few ibmmq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ibm-messaging / mq-mqi-nodejs / tests / amqsgetar.js View on Github external
gmo.MatchOptions = MQC.MQMO_NONE;
  gmo.WaitInterval = waitInterval * 1000; // 3 seconds

  if (msgId != null) {
    console.log("Setting Match Option for MsgId");
    gmo.MatchOptions = MQC.MQMO_MATCH_MSG_ID;
    md.MsgId = hexToBytes(msgId);
  }

  // Set up the callback handler to be invoked when there
  // are any incoming messages. As this is a sample, I'm going
  // to tune down the poll interval from default 10 seconds to 0.5s.
  // Also tune the polling to only get one message per attempt to
  // to facilitate single shot async
  mq.setTuningParameters({ getLoopPollTimeMs: 500, maxConsecutiveGets: 1 });
  mq.Get(queueHandle, md, gmo, getCB);

}
github ibm-messaging / mq-mqi-nodejs / tests / amqsgetar.js View on Github external
setTimeout(() => {
        // Resume processing second message
        if (msgId2 != null) {
          console.log("Setting Match Option for MsgId");
          gmo.MatchOptions = MQC.MQMO_MATCH_MSG_ID;
          md.MsgId = hexToBytes(msgId2);
        }
        mq.Get(hObj, md, gmo, getCB);
      }, 2000 // Wait 2 seconds
      )
github ibm-messaging / mq-dev-patterns / Node.js / boilerplate.js View on Github external
gmo.WaitInterval = waitInterval * 1000; //

      if (msgId != null) {
        console.log("Setting Match Option for MsgId");
        gmo.MatchOptions = MQC.MQMO_MATCH_MSG_ID;
        md.MsgId = MQBoilerPlate.hexToBytes(msgId);
      }

      // Set up the callback handler to be invoked when there
      // are any incoming messages. As this is a sample, I'm going
      // to tune down the poll interval from default 10 seconds to 0.5s.
      mq.setTuningParameters({
        getLoopPollTimeMs: 500
      });

      mq.Get(queueObj, md, gmo, me.getCallback);
      resolve();
    });
  }
github ibm-messaging / mq-mqi-nodejs / samples / amqsgeta.js View on Github external
MQC.MQGMO_CONVERT |
                MQC.MQGMO_FAIL_IF_QUIESCING;
  gmo.MatchOptions = MQC.MQMO_NONE;
  gmo.WaitInterval = waitInterval * 1000; // 3 seconds

  if (msgId != null) {
     console.log("Setting Match Option for MsgId");
     gmo.MatchOptions = MQC.MQMO_MATCH_MSG_ID;
     md.MsgId = hexToBytes(msgId);
  }

  // Set up the callback handler to be invoked when there
  // are any incoming messages. As this is a sample, I'm going
  // to tune down the poll interval from default 10 seconds to 0.5s.
  mq.setTuningParameters({getLoopPollTimeMs: 500});
  mq.Get(queueHandle,md,gmo,getCB);

}
github ibm-messaging / mq-mqi-nodejs / samples / amqsbra.js View on Github external
gmo.Options = MQC.MQGMO_NO_SYNCPOINT |
                MQC.MQGMO_WAIT |
                MQC.MQGMO_CONVERT |
                MQC.MQGMO_FAIL_IF_QUIESCING;

  // To start with, set the option to browse the FIRST message on the queue
  gmo.Options |= MQC.MQGMO_BROWSE_FIRST;

  gmo.MatchOptions = MQC.MQMO_NONE;
  gmo.WaitInterval = waitInterval * 1000; // 3 seconds

  // Set up the callback handler to be invoked when there
  // are any incoming messages. As this is a sample, I'm going
  // to tune down the poll interval from default 10 seconds to 0.5s.
  mq.setTuningParameters({getLoopPollTimeMs: 500});
  mq.Get(queueHandle,md,gmo,getCB);

}