activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzhang <jzh...@wellington.com>
Subject Re: Can I can run two brokers as network using multicast on the same host?
Date Mon, 09 Aug 2010 21:21:39 GMT

I think the "&" should be like "&amp;" in xml:

"multicast://default?group=mygroup&amp;useLocalHost=false"

I will test it out and post the results. Thanks for the good catch.

-J





Gary Tully wrote:
> 
> discoveryUri="multicast://default?group=mygroup?useLocalHost=false" looks
> odd,
> the query string needs to use & to separate arguments,
> it should be:
>  "multicast://default?group=mygroup&useLocalHost=false
> 
> On 9 August 2010 19:17, jzhang <jzhang@wellington.com> wrote:
>>
>> Thanks for the reply. I have added this property to the xml:
>>
>> transportConnectors>
>>           <transportConnector name="openwire"
>> uri="tcp://myhost.mycompany.com:61617"
>> discoveryUri="multicast://default?group=mygroup?useLocalHost=false"/>
>>        </transportConnectors>
>>
>> I have three brokers A, B and C (B and C are on the same Linux VM). I
>> started A first, and then B and then C. From log I can see A and B, A and
>> C
>> can 'see' each other. But there is no connection between B and C:
>>
>> - A log:
>> 2010-08-09 13:52:55,561 | INFO  | Network connection between
>> vm://NB-BKR-A#0
>> and tcp://lab-2/134.42.73.122:61617(NB-BKR-B) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-A#0
>> ..
>> 2010-08-09 13:53:17,161 | INFO  | Network connection between
>> vm://NB-BKR-A#2
>> and tcp://lab-2/134.42.73.122:61618(NB-BKR-C) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-A#2
>>
>> - B log:
>> 2010-08-09 13:52:55,938 | INFO  | Network connection between
>> vm://NB-BKR-B#0
>> and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-B#0
>>
>> - C log:
>> 2010-08-09 13:53:17,810 | INFO  | Network connection between
>> vm://NB-BKR-C#0
>> and tcp://lab-1/134.42.73.100:61617(NB-BKR-A) has been established. |
>> org.apache.activemq.network.DemandForwardingBridge | StartLocalBridge:
>> localBroker=vm://NB-BKR-C#0
>>
>> Is this expected?
>>
>> -J
>>
>>
>> Gary Tully wrote:
>>>
>>> this sounds like https://issues.apache.org/activemq/browse/AMQ-2771
>>> note the comments at the end about useLocalHost=false
>>>
>>> On 5 August 2010 22:23, jzhang <jzhang@wellington.com> wrote:
>>>>
>>>> I am trying to set up a simple network of brokers within the same host
>>>> (Linux
>>>> VM) using multicast. It seems that I can only use 'localhost' as host
>>>> name
>>>> in tcp uri. If I use IP address or DNS name, the log shows 'connection
>>>> refused' warning message. Here are some details:
>>>>
>>>> My configurations:
>>>>
>>>> - for broker NB-BKR-B:
>>>> ...
>>>>  <networkConnectors>
>>>>            <networkConnector name="labnb1"
>>>> uri="multicast://default?group=test-lab-1" />
>>>>  </networkConnectors>
>>>>
>>>> ...
>>>>   <transportConnectors>
>>>>            <transportConnector name="openwire"
>>>> uri="tcp://myhost.mycompany.com:61617"
>>>> discoveryUri="multicast://default?group=test-lab-1"/>
>>>>        </transportConnectors>
>>>> ...
>>>>
>>>> - for broker NB-BKR-C:
>>>> ...
>>>>  <networkConnectors>
>>>>            <networkConnector name="labnb1"
>>>> uri="multicast://default?group=test-lab-1" />
>>>>  </networkConnectors>
>>>>
>>>> ...
>>>>   <transportConnectors>
>>>>            <transportConnector name="openwire"
>>>> uri="tcp://myhost.mycompany.com:61618"
>>>> discoveryUri="multicast://default?group=test-lab-1"/>
>>>>        </transportConnectors>
>>>> ...
>>>>
>>>> Now when started both brokers, log shows (NB-BKR-C;s log):
>>>>
>>>> 2010-08-05 17:06:29,054 | WARN  | Could not start network bridge
>>>> between:
>>>> vm://NB-BKR-C and: tcp://lab-2:61617 due to: java.net.ConnectException:
>>>> Connection refused |
>>>> org.apache.activemq.network.DiscoveryNetworkConnector |
>>>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>>>> 2010-08-05 17:06:29,055 | DEBUG | Start failure exception:
>>>> java.net.ConnectException: Connection refused |
>>>> org.apache.activemq.network.DiscoveryNetworkConnector |
>>>> Notifier-MulticastDiscoveryAgent-listener:DiscoveryNetworkConnector:labnb1:BrokerService[NB-BKR-C]
>>>> java.net.ConnectException: Connection refused
>>>>        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:436)
>>>>        at
>>>> org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:402)
>>>>        at
>>>> org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)
>>>>        at
>>>> org.apache.activemq.network.DemandForwardingBridgeSupport.start(DemandForwardingBridgeSupport.java:227)
>>>>        at
>>>> org.apache.activemq.network.DiscoveryNetworkConnector.onServiceAdd(DiscoveryNetworkConnector.java:130)
>>>>        at
>>>> org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent$2.run(MulticastDiscoveryAgent.java:506)
>>>>        at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
>>>>        at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
>>>>        at java.lang.Thread.run(Thread.java:595)
>>>>
>>>> Broker NB-BKR-B has the similar warning. I have not test message
>>>> forward
>>>> yet. Just feel uncomfortable seeing these stacktraces. But when I
>>>> change
>>>> 'myhost.mycompany.com' to localhost' under 'tcp' uri, the log does not
>>>> have
>>>> those warning and stacktrace. Also if these two brokers are hosted on
>>>> two
>>>> different VMs and uses host name or IP, it works fine.
>>>>
>>>> What might be the problem here?
>>>>
>>>> -J
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29356394.html
>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> http://blog.garytully.com
>>>
>>> Open Source Integration
>>> http://fusesource.com
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29390699.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: http://old.nabble.com/Can-I-can-run-two-brokers-as-network-using-multicast-on-the-same-host--tp29356394p29392251.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message