c# - Connecting to Websphere MQ queue manager works in application A but not in application B -
i have 2 console applications, a , b. application a created test purposes , works expected. application b not work although copy-paste of a's code:
system.console.write("user name: "); string username = system.console.readline(); system.console.write("password: "); string password = consolereadpassword(); system.console.writeline(); //user , password required because privileged user //(member of mqm group) mqenvironment.userid = username; mqenvironment.password = password; //for application b line throws exception code 2538 var queuemanager = new mqqueuemanager("test.queue.manager", "client.conn.channel", "localhost(1414)");
error code 2538 means "host not available" weird because application a has no problems connecting same host.
this how mq server looks in mq explorer:
channel auth records: default channel authentication record prevents mq admins connecting queue managers. modified (added ~
prefix) not block anyone.
the mq server , applications running on same machine imho network problems excluded.
the queue manager error log not report errors general error log looks this:
08/02/2016 15:15:23 - process(13720.10) user([username]) program(b.exe) amq9202: remote host 'localhost(1414)' not available, retry later.
explanation: attempt allocate conversation using tcp/ip host 'localhost(1414)' channel (exception) not successful. error may transitory 1 , may possible allocate tcp/ip conversation later.
for both application use same version of amqmdnet.dll
: 8.0.0.4
both programs , b have same target framework: 4.5
while testing didn't tried run both applications in same time , checked in mq explorer if channel free (inactive).
i tried change name of resulting assemblies no effect.
does know cause application b unable connect?
when using hostname localhost
networking still involved, happens inside 1 machine. if application running in same machine queue manager having application connect using connection name localhost(1414)
work not necessary make connection (i.e. using tcp/ip) instead make local bindings connection.
on other hand, if using tcp/ip because application b running on different machine queue manager running, using localhost(1414)
not work because localhost
on 1 machine not connect localhost
on machine. should change specified in application's connection name localhost(1414)
use ip address (or hostname) of queue manager's machine (followed before port number).
Comments
Post a Comment