activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trevor Pounds (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-2135) network of brokers distributes messages to brokers with 0 consumers with dynamicOnly=true set
Date Mon, 09 Mar 2009 17:53:39 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-2135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50370#action_50370
] 

Trevor Pounds commented on AMQ-2135:
------------------------------------

I would like to mention that I have seen something similar with the following configuration:

[producer] -> [broker 1] -> [broker 2] -> consumer

I noticed that I get a small number of messages delivered to broker 2 when the active consumer
is closed.  I suspect this has something to do with the preftech limit on the URI which results
in one last batch of messages to be dispatched to the broker even though the consumer has
been closed. I'm not sure if this is a race condition or not but the scenario mentioned above
can be reproduced by producing 1000 messages or so and randomly stopping the consumer on broker
2.

> network of brokers distributes messages to brokers with 0 consumers with dynamicOnly=true
set
> ---------------------------------------------------------------------------------------------
>
>                 Key: AMQ-2135
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2135
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.2.0
>         Environment: linux (centos 4.6) using ActiveMQ 5.2.0 binary distribution
>            Reporter: Don Hoffman
>         Attachments: AMQ-2135-UnitTest.patch, testamq1.log, testamq2.log, testamq3.log
>
>
> using only the example code, the 5.2.0 release can be made to distribute messages to
brokers with no consumers, which remain at those brokers and are never consumed, unless a
consumer later connects specifically to those brokers.
> this bug is not reproducible in 5.1.0.
> to reproduce:
> run 3 brokers.  connect a consumer to brokers 1 and 2.  connect a producer to broker
1.  not all messages produced will be received by the 2 consumers.  note that the specific
brokers connected to matters for the 3-broker case.  for example, on my machine, if the producer
connects to broker 2 instead of broker 1, all messages are received.  you may need to try
various combinations of consumer/producer connections to reproduce the problem, but this specific
setup breaks reliably for me.
> this problem becomes more pronounced and easier to reproduce as the number of brokers
increases.
> specific configuration used to reproduce:
> 3 broker config xml files:
> testamq1.xml
> <beans
>   xmlns="http://www.springframework.org/schema/beans"
>   xmlns:amq="http://activemq.apache.org/schema/core"
>   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.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
>   http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>   <broker brokerName="b1" xmlns="http://activemq.apache.org/schema/core" useJmx="false"
advisorySupport="true">
>     <persistenceAdapter>
>       <amqPersistenceAdapter directory="activemq-data1" maxFileLength="32mb"/>
>     </persistenceAdapter>
>     <transportConnectors>
>       <transportConnector uri="tcp://localhost:61616"/>
>     </transportConnectors>
>     <networkConnectors>
>       <networkConnector uri="static://(tcp://localhost:61617,tcp://localhost:61618)"
dynamicOnly="true" networkTTL="5"/>
>     </networkConnectors>
>   </broker>
> </beans>
> testamq2.xml
> <beans
>   xmlns="http://www.springframework.org/schema/beans"
>   xmlns:amq="http://activemq.apache.org/schema/core"
>   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.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
>   http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>   <broker brokerName="b2" xmlns="http://activemq.apache.org/schema/core" useJmx="false"
advisorySupport="true">
>     <persistenceAdapter>
>       <amqPersistenceAdapter directory="activemq-data2" maxFileLength="32mb"/>
>     </persistenceAdapter>
>     <transportConnectors>
>       <transportConnector uri="tcp://localhost:61617"/>
>     </transportConnectors>
>     <networkConnectors>
>       <networkConnector uri="static://(tcp://localhost:61616,tcp://localhost:61618)"
dynamicOnly="true" networkTTL="5"/>
>     </networkConnectors>
>   </broker>
> </beans>
> testamq3.xml
> <beans
>   xmlns="http://www.springframework.org/schema/beans"
>   xmlns:amq="http://activemq.apache.org/schema/core"
>   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.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
>   http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>   <broker brokerName="b3" xmlns="http://activemq.apache.org/schema/core" useJmx="false"
advisorySupport="true">
>     <persistenceAdapter>
>       <amqPersistenceAdapter directory="activemq-data3" maxFileLength="32mb"/>
>     </persistenceAdapter>
>     <transportConnectors>
>       <transportConnector uri="tcp://localhost:61618"/>
>     </transportConnectors>
>     <networkConnectors>
>       <networkConnector uri="static://(tcp://localhost:61616,tcp://localhost:61617)"
dynamicOnly="true" networkTTL="5"/>
>     </networkConnectors>
>   </broker>
> </beans>
> run 3 brokers:
> bin/activemq xbean:testamq1.xml
> bin/activemq xbean:testamq2.xml
> bin/activemq xbean:testamq3.xml
> run 2 consumers (from examples directory):
> ant consumer -Durl="failover:(tcp://localhost:61616)" -Dsubject="test.queue" -Dmax=100
-DsleepTime=3
> ant consumer -Durl="failover:(tcp://localhost:61617)" -Dsubject="test.queue" -Dmax=100
-DsleepTime=3
> run 1 producer (from examples directory) with 10 messages:
> ant producer -Durl="failover:(tcp://localhost:61616)" -Dsubject="test.queue" -Dmax=10
> consumers will not receive all messages.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message