Hi Gary !

I wanted to use "useLocalHost=false" on my transport connector. But since
this parameter is striped, a broker that runs in a different process, on the
same host can discover the broker that sent this broadcast frame, but can
not connect to it !!!

It's because the socket is binded on "address:port" (useLocalHost=false",
and the connection is tried on "127.0.0.1:port" (resolveHostname).

A broker that doesn't run on the same host can connect to it without
problem.

As you can see in my tcpdump frames, in 5.3.0, useLocalHost option, wasn't
striped and the connection between the 2 brokers on the same server worked.

Eric-AWL


JIRA j...@apache.org wrote:
> 
> 
>     [
> https://issues.apache.org/activemq/browse/AMQ-2776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=60988#action_60988
> ] 
> 
> Gary Tully commented on AMQ-2776:
> ---------------------------------
> 
> the parameters supplied to the TransportConnector are stripped of before
> being broadcast because many of the server side options are not applicable
> to the connection initiator (client side)
> If you want a client to connect using useLocalHost=true, then that option
> needs to be specified on the brokerURL (connection factory) or on the
> networkConnector broker url. The parameters are then applied to all
> discovered urls.
> 
>> Connection refused when using shortname in activemqurl
>> ------------------------------------------------------
>>
>>                 Key: AMQ-2776
>>                 URL: https://issues.apache.org/activemq/browse/AMQ-2776
>>             Project: ActiveMQ
>>          Issue Type: Bug
>>          Components: Connector
>>    Affects Versions: 5.3.2, 5.4.0
>>         Environment: Suse 10 Sp2
>>            Reporter: vioa lu
>>             Fix For: 5.4.0
>>
>>         Attachments: activemq-2776.patch
>>
>>
>> 1. On server suse10sp268, start activemq , then run activemq-admin.bat
>> browse --amqurl tcp://suse10sp268:61616 TEST.FOO , got excecption Caused
>> by: javax.jms.JMSException: Could not connect to broker URL:
>> tcp://suse10sp268:61616. Reason: java.net.ConnectException: Connection
>> refused: connect
>> at
>> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
>> at
>> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:286)
>> at
>> org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:185)
>> at
>> org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(ActiveMQConnectionSupport.java:79)
>> at
>> org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(ActiveMQConnectionSupport.java:61)
>> at
>> org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFactory.java:169)
>> ... 42 more
>> Caused by: java.net.ConnectException: Connection refused: connect
>> at java.net.PlainSocketImpl.socketConnect(Native Method)
>> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>> at java.net.Socket.connect(Socket.java:519)
>> at
>> org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:483)
>> at
>> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:446)
>> at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
>> at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58)
>> at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58)
>> at
>> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
>> at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58)
>> at
>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:58)
>> at
>> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:266)
>> This  happened also when got error starting activemq-ra module in
>> geronimo
>> https://issues.apache.org/jira/browse/GERONIMO-5371
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/-jira--Created%3A-%28AMQ-2776%29-Connection-refused-when-using-shortname-in-activemqurl-tp28870581p29296915.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Reply via email to