ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » QM MQConnectionFactory - getPort()

Post new topic  Reply to topic
 QM MQConnectionFactory - getPort() « View previous topic :: View next topic » 
Author Message
scravr
PostPosted: Thu Jun 24, 2010 7:04 am    Post subject: QM MQConnectionFactory - getPort() Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
Vitor
PostPosted: Thu Jun 24, 2010 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message
scravr
PostPosted: Thu Jun 24, 2010 10:05 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
mqjeff
PostPosted: Thu Jun 24, 2010 10:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why are you trying to use a JMS bindings for this?

Why not use a .broker file?

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.cmp.doc/com/ibm/broker/config/proxy/MQPropertyFileBrokerConnectionParameters.html
Back to top
View user's profile Send private message
scravr
PostPosted: Thu Jun 24, 2010 11:42 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
mqjeff
PostPosted: Thu Jun 24, 2010 11:54 am    Post subject: Reply with quote

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
View user's profile Send private message
scravr
PostPosted: Thu Jun 24, 2010 12:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail MSN Messenger
mqjeff
PostPosted: Thu Jun 24, 2010 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » QM MQConnectionFactory - getPort()
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.