You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Dejan Bosanac (JIRA)" <ji...@apache.org> on 2009/02/19 10:15:59 UTC

[jira] Resolved: (AMQ-1509) Duplicate topic messages received with network of brokers and selectors

     [ https://issues.apache.org/activemq/browse/AMQ-1509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac resolved AMQ-1509.
--------------------------------

    Resolution: Fixed

We did some refactoring in this area for another issue, but this generally should be working.

Here's the test case that tries to reproduce the problem (org.apache.activemq.usecases.ThreeBrokerQueueNetworkTest)

{code}
    public void testABandBCbrokerNetworkWithSelectors() throws Exception {
        // Setup broker networks
        bridgeBrokers("BrokerA", "BrokerB", dynamicOnly, 2, true);
        bridgeBrokers("BrokerB", "BrokerC", dynamicOnly, 2, true);

        startAllBrokers();

        // Setup destination
        Destination dest = createDestination("TEST.FOO", true);

        // Setup consumers
        MessageConsumer clientA = createConsumer("BrokerC", dest, "dummy = 33");
        MessageConsumer clientB = createConsumer("BrokerC", dest, "dummy > 30");
        MessageConsumer clientC = createConsumer("BrokerC", dest, "dummy = 34");

        // let consumers propogate around the network
        Thread.sleep(2000);
        // Send messages
        // Send messages for broker A
        HashMap<String, Object> props = new HashMap<String, Object>();
        props.put("dummy", 33);
        sendMessages("BrokerA", dest, MESSAGE_COUNT, props);
        props.put("dummy", 34);
        sendMessages("BrokerA", dest, MESSAGE_COUNT * 2, props);

        // Get message count
        MessageIdList msgsA = getConsumerMessages("BrokerC", clientA);
        MessageIdList msgsB = getConsumerMessages("BrokerC", clientB);
        MessageIdList msgsC = getConsumerMessages("BrokerC", clientC);

        msgsA.waitForMessagesToArrive(MESSAGE_COUNT);
        msgsB.waitForMessagesToArrive(MESSAGE_COUNT * 3);
        msgsC.waitForMessagesToArrive(MESSAGE_COUNT * 2) ;

        assertEquals(MESSAGE_COUNT, msgsA.getMessageCount());
        assertEquals(MESSAGE_COUNT * 3, msgsB.getMessageCount());
        assertEquals(MESSAGE_COUNT *2, msgsC.getMessageCount());
    }{code}

If you find it still not working, please submit the test case similar to the one above

> Duplicate topic messages received with network of brokers and selectors
> -----------------------------------------------------------------------
>
>                 Key: AMQ-1509
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1509
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Transport
>    Affects Versions: 4.1.1
>            Reporter: Howard Orner
>            Assignee: Rob Davies
>             Fix For: 5.3.0
>
>         Attachments: ActiveMQActor.java
>
>
> If you create a network of two brokers, A and B, one publisher publishing to A, and n (where n is > 1) receivers with selectors, each receiver recieves n messages for every 1 message sent.  The key here is to have a selector.   It would appear that the conduitSubscriptions flag does not work when using selectors.  The conduit does not properly reconcile consumers if they have selectors.  A suggested soltuion would be that ather than process each selector independantly, each selector should be or'ed together and if any selector results in true then a single message should be sent to the other broker.
> In doing research, it would appear that this problem was introduced with bug fix AMQ-810.  Another user reported it via email back to the assignee of AMQ-810 and a short dialog transpired.  See http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg05198.html.  

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