Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to subscribe to topics with wild card #90

Open
Manjunathabc opened this issue Jun 22, 2020 · 3 comments
Open

Not able to subscribe to topics with wild card #90

Manjunathabc opened this issue Jun 22, 2020 · 3 comments

Comments

@Manjunathabc
Copy link

Please include the following information in your ticket.
Not able to subscribe to topics with wild card

  • mq-mqi-nodejs version(s) that are affected by this issue.
    ibmmq@0.9.14 node -v v10.21.0 and v12.18.0 npm -v 6.2.0

i used sample program amqssub.js to subscribe to the topics using topic-wild-card. But its throwing below error..

 node mqEventTopic.js 'dev/base/topic/+' newmgr
Sample AMQSSUB.JS start
TOPIC STRING dev/base/topic/+
Q MGR newmgr
connection name = newmgr-***:31982
MQCONN to newmgr successful 
terminate called after throwing an instance of 'Napi::Error'
  what():  Cannot read property 'toString' of null
Aborted (core dumped)```

@ibmmqmet
Copy link
Collaborator

When I run the amqssub.js program with the same topic string parameter it works fine. Have you made any other changes to the sample beyond printing extra lines? I can see a couple of places where additional sanity checks might be made to deal with bad/unexpected parameters or certain failures, but normal running seems ok.

@Manjunathabc
Copy link
Author

Yes, I modified a bit.. used fn mq.Connx instead of fn mq.Conn and i passed qMgr, cno, objects to fn mq.Conn and Passing topic string and Q manager as part of command line..


  console.log("TOPIC STRING " + topicString);
  console.log("Q MGR " + qMgr);
  const cno = new mq.MQCNO()
  const csp = new mq.MQCSP()
  csp.UserId ='xxxx'
  csp.Password ='xxxxxx'
  cno.SecurityParms = csp
  cno.Options |= MQC.MQCNO_CLIENT_BINDING
  const cd = new mq.MQCD()
  cd.ConnectionName ='xxxx.xx.xxxx:31982'
  cd.ChannelName ="CLOUD.APP.SVRCONN" 
  cno.ClientConn = cd
 mq.Connx(qMgr, cno,function(err,hConn) {
   if (err) {
     console.log("MQCONN ended with reason code " + err.mqrc);
   } else {
     console.log("MQCONN to %s successful ", qMgr);
     var sd = new mq.MQSD();
     sd.ObjectString = topicString;
     sd.Options =   MQC.MQSO_CREATE
                  | MQC.MQSO_NON_DURABLE
                  | MQC.MQSO_FAIL_IF_QUIESCING
                  | MQC.MQSO_MANAGED;

     mq.Sub(hConn,null,sd,function(err,hObjPubQ,hObjSubscription) {
       if (err) {
         console.log("MQSUB ended with reason " + err.mqrc);
       } else {
         console.log("MQSUB to topic %s successful", topicString);
         // And loop getting messages until done.
         getMessages(hObjPubQ);
       }
       cleanup(hConn,hObjPubQ, hObjSubscription);
     });
   }
});

@Manjunathabc
Copy link
Author

@ibmmqmet Still i am facing same issue. can you please take a looks asap..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants