Author |
Message
|
scravr |
Posted: Thu Jun 24, 2010 7:04 am Post subject: QM MQConnectionFactory - getPort() |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
HI ALL,
Is it posible the getPort() returns the default 1414 even when there is no 1414 port?
This code alway rerun port 1414 even when port is 1417 ???
Also tried with client JNDI on port 1420; and still getting 1414 !!!
MQConnectionFactory mqcf = null;
InitialContext ic;
Hashtable<String, String> hashTable = new Hashtable<String, String>();
hashTable.put(PROVIDER_URL,"file:/C:/JNDI/");
hashTable.put(INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
hashTable.put(SECURITY_AUTHENTICATION, "none");
ic = new InitialContext(hashTable);
mqcf = (MQConnectionFactory)ic.lookup(ConnFactory);
QmPort = mqcf.getPort();
QmHost = mqcf.getHostName();
Any ideas what is wron in code ?
Thanks,
Mos |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jun 24, 2010 8:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
And you need the port & host name why?
(I ask because that's as much of the code as I understand & have no answer to your actual question, hence I try to find an alternative route to your requirement) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
scravr |
Posted: Thu Jun 24, 2010 10:05 am Post subject: |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
I need to Host & Port for the next part of code witch stops a flow:
...
...
BrokerConnectionParameters bcp = new MQBrokerConnectionParameters(QmHost, QmPort, QmName);
BrokerProxy b = BrokerProxy.getInstance(bcp);
ExecutionGroupProxy e = b.getExecutionGroupByName(egName);
MessageFlowProxy mf = e.getMessageFlowByName(flowName);
mf.stop();
b.disconnect();
...
... |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 24, 2010 10:20 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
scravr |
Posted: Thu Jun 24, 2010 11:42 am Post subject: |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
Same problem:
Broker has 1414.
The QM DOSE NOT have port 1414.
I deleted it and created 1417 !!!
<?xml version="1.0" encoding="UTF-8"?>
<configmgr crlNameList="" domainName="" host="111.22.33.444" listenerPort="1414" queueManager="name" securityExit="" securityExitJar="" sslCipherSuite="NONE" sslDistinguishedNames="" sslKeyStore="" sslTrustStore="" svrconn="SYSTEM.BKR.CONFIG"/> |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 24, 2010 11:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you use the Toolkit to create a .broker file that successfully connects to the remote broker, how can it contain the wrong information?
I'm guessing that what you are trying to do is store the information about what Broker to connect to in something external to your application. A .broker file is an excellent choice - but again, create it in the Toolkit and then move it to where your application will run.
If you're trying to do something other than that... you'll have to be a lot more specific. |
|
Back to top |
|
 |
scravr |
Posted: Thu Jun 24, 2010 12:02 pm Post subject: |
|
|
 Partisan
Joined: 03 Apr 2003 Posts: 391 Location: NY NY USA 10021
|
Broker was creatd with toolkit.
.broker file was not changed in anyway by anyone.
info about broker is not change/save anyother place.
it looks like when 1414 was deleted and 1417 was created, the QM dose not pass this change info into .broker file.
How dose broker get notified about non default ports, change of ports, etc. on QM ? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 24, 2010 12:30 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The only thing that will update the .broker file in the Toolkit is if you update it manually, afaik.
If you change the listener port, then I expect that the .broker file will be invalid and will not allow you to connect any more. But if it's a .broker file for a "local" broker rather than a "remote" broker, then that's likely why.
The 1414 in various things could be coming from the "default" port rather than the actual listener port.
A broker itself doesn't care about the listener port of it's queue manager, as it established server-binding connections rather than client connections. |
|
Back to top |
|
 |
|