java - MQ-7 connectivity issue -


hi below code used check connectivity

string qmanager="";  int openoptions =  cmqc.mqoo_fail_if_quiescing + cmqc.mqoo_input_shared + cmqc.mqoo_inquire+cmqc.mqoo_browse;  try{         hashtable props = new hashtable();          props.put(cmqc.host_name_property, "ip");          props.put(cmqc.port_property, port_num);         props.put(cmqc.channel_property, "system.default.local.queue");          mqqueuemanager qmgr = new mqqueuemanager("qm", props);          mqqueue destqueue = qmgr.accessqueue("q_name",   openoptions);         system.out.println("connected");          destqueue.close();         qmgr.disconnect(); }catch(mqexception mqe){     system.out.println(mqe.reasoncode); } }     } 

when run program exception

mqje001: mqexception occurred: completion code 2, reason 2009 mqje016: mq queue manager closed channel during connect 2009 closure reason = 2009 mqje001: completion code 2, reason 2009 

kindly me

there 2 things suspect here:

  1. props.put(cmqc.host_name_property, "ip"); <-- hostname short?
  2. props.put(cmqc.channel_property, "system.default.local.queue"); <-- why local queue name set channel property

there samples in "tools" folder of mq installation, can you.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -