You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by j0llyr0g3r <ti...@wincor-nixdorf.com> on 2008/01/14 18:38:55 UTC
Howto send messages to multiple brokers?
Hi folks,
consider the following simple situation:
consumer ----- broker A broker C -------------
consumer
\ /
\ /
\ /
broker B
|
|
producer
-> So i want to start a producer which sends messages to broker B.
-> Those messages should be sent to broker A and C.
-> The consumers on broker A and C should receive these messages.
Configuration for B is quite simple:
<transportConnectors>
<transportConnector name="local_in__client"
uri="tcp://localhost:61616"/>
</transportConnectors>
<networkConnectors>
<networkConnector name="remote_out"
uri="static://(tcp://broker_A:61626,tcp://broker_C:61626)" networkTTL="5" />
</networkConnectors>
Broker_A looks simple with only two transport connectors:
<transportConnectors>
<transportConnector name="remote_in__broker"
uri="tcp://localhost:61626"/>
<transportConnector name="local_in__client"
uri="tcp://localhost:61616"/>
</transportConnectors>
Broker_C looks looks exactly the same:
<transportConnectors>
<transportConnector name="remote_in__broker"
uri="tcp://localhost:61626"/>
<transportConnector name="local_in__client"
uri="tcp://localhost:61616"/>
</transportConnectors>
But when i now start all three brokers, broker_B gives me the following
errors:
INFO BrokerService - ActiveMQ JMS Message Broker
(localhost, ID:esf-proto-2-1087-1201112791726-0:0) started
ERROR Service - Async error occurred:
javax.jms.InvalidClientIDException: Broker: localhost - Client:
NC_localhost_inboundlocalhost already connected from vm://localhost#0
javax.jms.InvalidClientIDException: Broker: localhost - Client:
NC_localhost_inboundlocalhost already connected from vm://localhost#0
at
org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:205)
at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:81)
at
org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:71)
at
org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:81)
at
org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91)
at
org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:693)
at
org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:125)
at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:319)
at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:216)
at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:100)
at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:67)
at
org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:232)
at
org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner.java:98)
at
org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.java:36)
INFO DemandForwardingBridge - Network connection between
vm://localhost#2 and tcp://smcexp/172.18.96.190:61626 shutdown due to a
local error: javax.jms.InvalidClientIDException: Broker: localhost - Client:
NC_localhost_inboundlocalhost already connected from vm://localhost#0
When i try just one direction for example like this:
consumer ----- broker A
\
\
\
broker B
|
|
producer
via changing the configuration of broker_B from:
<networkConnectors>
<networkConnector name="remote_out"
uri="static://(tcp://broker_A:61626,tcp://broker_C:61626)" networkTTL="5" />
</networkConnectors>
to
<networkConnectors>
<networkConnector name="remote_out"
uri="static://(tcp://broker_A:61626)" networkTTL="5" />
</networkConnectors>
everything works fine!
So i guess the error comes from the configuration of Broker_B, caused by the
line:
<networkConnectors>
<networkConnector name="remote_out"
uri="static://(tcp://broker_A:61626,tcp://broker_C:61626)" networkTTL="5" />
</networkConnectors>
But i don't see anything wrong with it?
What am i doing wrong?
--
View this message in context: http://www.nabble.com/Howto-send-messages-to-multiple-brokers--tp14806636s2354p14806636.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Howto send messages to multiple brokers?
Posted by j0llyr0g3r <ti...@wincor-nixdorf.com>.
Ok,
found the solution:
EVERY broker has to have a different name.
Maybe the error message could be a little bit more clear on that.....
j0llyr0g3r wrote:
>
> Hi folks,
>
> consider the following simple situation:
>
>
> consumer ----- broker A broker C -------------
> consumer
> \ /
> \ /
> \ /
> broker B
> |
> |
> producer
>
>
> -> So i want to start a producer which sends messages to broker B.
> -> Those messages should be sent to broker A and C.
> -> The consumers on broker A and C should receive these messages.
>
> Configuration for B is quite simple:
>
> <transportConnectors>
> <transportConnector name="local_in__client"
> uri="tcp://localhost:61616"/>
> </transportConnectors>
>
> <networkConnectors>
> <networkConnector name="remote_out"
> uri="static://(tcp://broker_A:61626,tcp://broker_C:61626)" networkTTL="5"
> />
> </networkConnectors>
>
>
> Broker_A looks simple with only two transport connectors:
>
> <transportConnectors>
> <transportConnector name="remote_in__broker"
> uri="tcp://localhost:61626"/>
> <transportConnector name="local_in__client"
> uri="tcp://localhost:61616"/>
> </transportConnectors>
>
> Broker_C looks looks exactly the same:
>
> <transportConnectors>
> <transportConnector name="remote_in__broker"
> uri="tcp://localhost:61626"/>
> <transportConnector name="local_in__client"
> uri="tcp://localhost:61616"/>
> </transportConnectors>
>
> But when i now start all three brokers, broker_B gives me the following
> errors:
>
> INFO BrokerService - ActiveMQ JMS Message Broker
> (localhost, ID:esf-proto-2-1087-1201112791726-0:0) started
> ERROR Service - Async error occurred:
> javax.jms.InvalidClientIDException: Broker: localhost - Client:
> NC_localhost_inboundlocalhost already connected from vm://localhost#0
> javax.jms.InvalidClientIDException: Broker: localhost - Client:
> NC_localhost_inboundlocalhost already connected from vm://localhost#0
> at
> org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:205)
> at
> org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:81)
> at
> org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:71)
> at
> org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:81)
> at
> org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:91)
> at
> org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:693)
> at
> org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:125)
> at
> org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:319)
> at
> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:216)
> at
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:100)
> at
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:67)
> at
> org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:232)
> at
> org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner.java:98)
> at
> org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.java:36)
> INFO DemandForwardingBridge - Network connection between
> vm://localhost#2 and tcp://smcexp/172.18.96.190:61626 shutdown due to a
> local error: javax.jms.InvalidClientIDException: Broker: localhost -
> Client: NC_localhost_inboundlocalhost already connected from
> vm://localhost#0
>
> When i try just one direction for example like this:
>
> consumer ----- broker A
> \
> \
> \
> broker B
> |
> |
> producer
>
> via changing the configuration of broker_B from:
>
> <networkConnectors>
> <networkConnector name="remote_out"
> uri="static://(tcp://broker_A:61626,tcp://broker_C:61626)" networkTTL="5"
> />
> </networkConnectors>
>
> to
>
> <networkConnectors>
> <networkConnector name="remote_out"
> uri="static://(tcp://broker_A:61626)" networkTTL="5" />
> </networkConnectors>
>
> everything works fine!
>
> So i guess the error comes from the configuration of Broker_B, caused by
> the line:
>
> <networkConnectors>
> <networkConnector name="remote_out"
> uri="static://(tcp://broker_A:61626,tcp://broker_C:61626)" networkTTL="5"
> />
> </networkConnectors>
>
> But i don't see anything wrong with it?
>
> What am i doing wrong?
>
>
>
>
--
View this message in context: http://www.nabble.com/Howto-send-messages-to-multiple-brokers--tp14806636s2354p14807585.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.