You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by toff <to...@lu.unisi.ch> on 2008/04/23 14:32:05 UTC
Cyclic network of brokers: configuration and duplicates
Dear activeMQ gurus,
although I have not yet found an answer, this question is related to posts:
(1)
http://www.nabble.com/Network-of-Brokers-configuration-limitation--td11639335s2354.html#a11639335
and
(2)
http://www.nabble.com/Network-of-Brokers-...-td2921710s2354.html#a3114441
I am testing the behavior of our in-house implementation of a content-based
routing solution (e.g., pub-sub: that is topics and not queues) against the
performances of an activeMQ network of brokers. My question is: what is the
best (in terms of performances and message duplicates) configuration I can
use for a cyclic network?
To start simple I am using the following topology:
S1--S3
| |
S2--S4
The configuration file for S1 is therefore:
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.org/config/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.org/config/1.0
http://activemq.apache.org/schema/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker xmlns="http://activemq.org/config/1.0" useJmx="false"
brokerName="node33" persistent="false">
<transportConnectors>
<transportConnector name="local" uri="tcp://localhost:17701"/>
</transportConnectors>
<networkConnectors>
<networkConnector name="S2" dynamicOnly="true" networkTTL="15"
uri="static://(tcp://node34:17702)"/>
<networkConnector name="S3" dynamicOnly="true" networkTTL="15"
uri="static://(tcp://node35:17703)"/>
</networkConnectors>
</broker>
<commandAgent xmlns="http://activemq.org/config/1.0"/>
</beans>
In contrast to post (1) and from what I gather from
http://activemq.apache.org/networks-of-brokers.html , I am specifying
multiple network connectors as I want S1 to be connected to both S1 and S2.
If I understand correctly, a static URI with multiple addresses (e.g.,
uri="static:(tcp://localhost:61616,tcp://remotehost:61616,tcp://..)")
results in a random connection to just one of the provided addresses.
Is this the right way to do it?
>From the client logs I would definitely say no, as each client receives
multiple (thousands!) copies of the same message.
Are cyclic topologies supported? Could someone please suggest a
configuration for them?
Or should I just use hierarchical topologies?
The latter is the conclusion I infer from post (2), but if there's somebody
knowledgeable about this out there I'd be really happy to have a final word
on this issue.
Thanks in advance,
Gio
--
View this message in context: http://www.nabble.com/Cyclic-network-of-brokers%3A-configuration-and-duplicates-tp16834569s2354p16834569.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Cyclic network of brokers: configuration and duplicates
Posted by toff <gi...@gmail.com>.
Found the solution:
ISSUE 1509
http://issues.apache.org/activemq/browse/AMQ-1509
Supposedly fixed in 5.1.0, although with 5.1.0 RC4 I can still reproduce it.
---------------
g
toff wrote:
>
> Thank you Joe,
>
> I just ran a test configuring servers (e.g. S1) with network connector:
>
> <networkConnector name="S1NC" dynamicOnly="true" networkTTL="15"
> uri="static://(tcp://node34:17702,tcp://node35:17703)"/>
>
> The results still show massive message duplication as clients receive the
> same message multiple times.
> I think the (correct) behavior described in
> http://www.nabble.com/Network-of-Brokers-configuration-limitation--td11639335s2354.html#a11639335
> is due to the default TTL (set to 1).
>
> My question is still whether cyclic topologies are supported and how to
> avoid message duplication. Is there something I am not getting?
>
> Thank you again for your time,
>
> Gio
>
>
>
>
> ttmdev wrote:
>>
>> A static connector, having multiple IP addresses, will force the broker
>> to connect to *all* the brokers whose IP addresses are listed in the
>> connector.
>>
>> It is the client failover connector that, by default, randomly chooses
>> one of the listed IP addresses/brokers (i.e., is more than one is
>> provided). For example,
>>
>> failover:(tcp://localhost:61616,tcp://remotehost:61616)
>>
>> Joe
>> Goto www.ttmsolutions.com for a free ActiveMQ user guide
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Cyclic-network-of-brokers%3A-configuration-and-duplicates-tp16834569s2354p16852442.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Cyclic network of brokers: configuration and duplicates
Posted by toff <to...@lu.unisi.ch>.
Thank you Joe,
I just ran a test configuring servers (e.g. S1) with network connector:
<networkConnector name="S1NC" dynamicOnly="true" networkTTL="15"
uri="static://(tcp://node34:17702,tcp://node35:17703)"/>
The results still show massive message duplication as clients receive the
same message multiple times.
I think the (correct) behavior described in
http://www.nabble.com/Network-of-Brokers-configuration-limitation--td11639335s2354.html#a11639335
is due to the default TTL (set to 1).
My question is still whether cyclic topologies are supported and how to
avoid message duplication. Is there something I am not getting?
Thank you again for your time,
Gio
ttmdev wrote:
>
> A static connector, having multiple IP addresses, will force the broker to
> connect to *all* the brokers whose IP addresses are listed in the
> connector.
>
> It is the client failover connector that, by default, randomly chooses one
> of the listed IP addresses/brokers (i.e., is more than one is provided).
> For example,
>
> failover:(tcp://localhost:61616,tcp://remotehost:61616)
>
> Joe
> Goto www.ttmsolutions.com for a free ActiveMQ user guide
>
>
--
View this message in context: http://www.nabble.com/Cyclic-network-of-brokers%3A-configuration-and-duplicates-tp16834569s2354p16834776.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Cyclic network of brokers: configuration and duplicates
Posted by ttmdev <jo...@ttmsolutions.com>.
A static connector, having multiple IP addresses, will force the broker to
connect to *all* the brokers whose IP addresses are listed in the connector.
It is the client failover connector that, by default, randomly chooses one
of the listed IP addresses/brokers (i.e., is more than one is provided). For
example,
failover:(tcp://localhost:61616,tcp://remotehost:61616)
Joe
Goto www.ttmsolutions.com for a free ActiveMQ user guide
toff wrote:
>
> Dear activeMQ gurus,
>
> although I have not yet found an answer, this question is related to
> posts:
>
> (1)
> http://www.nabble.com/Network-of-Brokers-configuration-limitation--td11639335s2354.html#a11639335
>
> and
>
> (2)
> http://www.nabble.com/Network-of-Brokers-...-td2921710s2354.html#a3114441
>
> I am testing the behavior of our in-house implementation of a
> content-based routing solution (e.g., pub-sub: that is topics and not
> queues) against the performances of an activeMQ network of brokers. My
> question is: what is the best (in terms of performances and message
> duplicates) configuration I can use for a cyclic network?
>
> To start simple I am using the following topology:
> S1--S3
> | |
> S2--S4
>
> The configuration file for S1 is therefore:
>
> <beans
> xmlns="http://www.springframework.org/schema/beans"
> xmlns:amq="http://activemq.org/config/1.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> http://activemq.org/config/1.0
> http://activemq.apache.org/schema/activemq-core.xsd
> http://activemq.apache.org/camel/schema/spring
> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
> <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
> <broker xmlns="http://activemq.org/config/1.0" useJmx="false"
> brokerName="node33" persistent="false">
> <transportConnectors>
> <transportConnector name="local" uri="tcp://localhost:17701"/>
> </transportConnectors>
> <networkConnectors>
> <networkConnector name="S2" dynamicOnly="true" networkTTL="15"
> uri="static://(tcp://node34:17702)"/>
> <networkConnector name="S3" dynamicOnly="true" networkTTL="15"
> uri="static://(tcp://node35:17703)"/>
> </networkConnectors>
> </broker>
> <commandAgent xmlns="http://activemq.org/config/1.0"/>
> </beans>
>
> In contrast to post (1) and from what I gather from
> http://activemq.apache.org/networks-of-brokers.html , I am specifying
> multiple network connectors as I want S1 to be connected to both S1 and
> S2. If I understand correctly, a static URI with multiple addresses (e.g.,
> uri="static:(tcp://localhost:61616,tcp://remotehost:61616,tcp://..)")
> results in a random connection to just one of the provided addresses.
>
> Is this the right way to do it?
> From the client logs I would definitely say no, as each client receives
> multiple (thousands!) copies of the same message.
>
> Are cyclic topologies supported? Could someone please suggest a
> configuration for them?
>
> Or should I just use hierarchical topologies?
>
> The latter is the conclusion I infer from post (2), but if there's
> somebody knowledgeable about this out there I'd be really happy to have a
> final word on this issue.
>
> Thanks in advance,
>
> Gio
>
>
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Cyclic-network-of-brokers%3A-configuration-and-duplicates-tp16834569s2354p16834692.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.