You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/01/20 15:17:00 UTC

[jira] [Work logged] (ARTEMIS-2156) Message Duplication when using exclusive divert and clustering

     [ https://issues.apache.org/jira/browse/ARTEMIS-2156?focusedWorklogId=187522&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-187522 ]

ASF GitHub Bot logged work on ARTEMIS-2156:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Jan/19 15:16
            Start Date: 20/Jan/19 15:16
    Worklog Time Spent: 10m 
      Work Description: ldebello commented on pull request #2510: [ARTEMIS-2156] Message Duplication when using exclusive divert and clustering
URL: https://github.com/apache/activemq-artemis/pull/2510
 
 
   I am sending this PR to fix the issue https://issues.apache.org/jira/browse/ARTEMIS-2156.
   
   I have created a simple test to reproduce the issue and find the root cause of this issue is because exclusiveBindings get duplicates, the same if was applied for bindings but was missing for exclusiveBindings.
   
   In order to validate I didn't broke anything I ran `mvn -Ptests test`, please let me know if that is ok or I need to do something else.
   
   If the fix is ok, is there any chance to include it for 2.6.5?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 187522)
            Time Spent: 10m
    Remaining Estimate: 0h

> Message Duplication when using exclusive divert and clustering
> --------------------------------------------------------------
>
>                 Key: ARTEMIS-2156
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2156
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 1.5.5, 2.6.3
>            Reporter: Luis Miguel De Bello
>            Priority: Major
>         Attachments: ArtemisClient1.5.5.gif, ArtemisClient2.6.2.gif, Consumer.java, ConsumerClient2-6-0.java, Duplicate Object.png, Producer.java, ProducerClient2-6-0.java, broker1.xml, broker1Server2-6-3.xml, broker2.xml, broker2Server2-6-3.xml
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> We bumped into the following issue, we start getting duplicate message after doing some analysis we saw the "exclusiveBindings" in "org.apache.activemq.artemis.core.postoffice.impl.BindingsImpl" got the same binding twice.
> The if statement in "addBinding"
> {code:java}
> if (binding.isExclusive()) {
>    exclusiveBindings.add(binding);
> } else {
>    SimpleString routingName = binding.getRoutingName();
>    List<Binding> bindings = routingNameBindingMap.get(routingName);
>    if (bindings == null) {
>       bindings = new CopyOnWriteArrayList<>();
>       List<Binding> oldBindings = routingNameBindingMap.putIfAbsent(routingName, bindings);
>       if (oldBindings != null) {
>          bindings = oldBindings;
>       }
>    }
>    if (!bindings.contains(binding)) {
>       bindings.add(binding);
>    }
> }{code}
> Does not do any check in case the binding already exists, this kind of test is done for non exclusive binding.
> I was not able to create an automatic test in the base code because the issue seems related to the client version.
> Scenario:
> - Cluster of two instances (UDP) Artemis Server 1.5.5
> - Clean Up /data/bindings/\*, ../data/journal/\*, ../data/paging/\*
> - Exclusive Divert from jms.queue.\*.Provider.\*.Agent.\*.Status to jms.queue.Notifications
> - Java program using artemis client
> - Start Consumer in Instance 1 (jms.queue.Notifications)
> - Send Message to Instance 1
> - Send Message to Instance 2
> - Send Message to Instance 1
> Expectations:
> - We expect to get 3 message
> Results:
> We got 3 messages when the client uses version 1.5.5
> We got 5 messages when the client uses version 2.6.2
>  
> I enclose two gif one for client "org.apache.activemq:artemis-jms-client:1.5.5" where it works ok and another for "org.apache.activemq:artemis-jms-client:2.6.2" where you can appreciate the issue. 
> Also I enclose one screenshot where you can see the same object is added twice.
> I will also include the broker.xml file to configure the udp cluster + the code use for the producer and consumer.
> Note: The only difference when using client 1.5.5 is the queue name definition I needed to remove the jms.queue prefix.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)