You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Edwin <ed...@gmail.com> on 2012/11/16 19:07:59 UTC

Seeing slow performance when placing messages onto JMS topic

Hi Folks,

I have a route that sends messages to a JMS topic and the performance is not
what I would have expected. My route looks like this:

from(someEndpoint).to(inboundTopicURI+"?deliveryPersistent=false")

I thought by setting the deliveryPersistent to false would greatly improve
the performance of the route however it has only marginally improved.

With deliveryPersist set to true - The mean processing time for an exchange
was approx 50ms
With deliveryPersist set to false - mean processing time is approx 30ms

Would appreciate any insights into why performance is still quite slow

Thanks,
Edwin



--
View this message in context: http://camel.465427.n5.nabble.com/Seeing-slow-performance-when-placing-messages-onto-JMS-topic-tp5722882.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Seeing slow performance when placing messages onto JMS topic

Posted by Christian Müller <ch...@gmail.com>.
Sorry for the delayed response. My inbox is a bit full...

I set up the following test with Camel 2.10.2:

public class CamelActiveMQTopicPerformanceTest extends CamelTestSupport {

    private int counter = 1000;
    private BrokerService broker;

    @Before
    public void setUp() throws Exception {
        broker = new BrokerService();
        broker.setPersistent(true);
        broker.setUseJmx(false);
        broker.addConnector("tcp://localhost:61616");
        broker.start();

        super.setUp();
    }

    @After
    public void tearDown() throws Exception {
        super.tearDown();

        broker.stop();
    }

    @Test
    public void test() throws InterruptedException {
        template.setDefaultEndpointUri("direct:start");

        long start = System.currentTimeMillis();
        for (int i = 0; i < counter; i++) {
            template.sendBody("test " + i);
        }
        long end = System.currentTimeMillis();

        System.out.println("sending " + counter + " messages tooks "+ (end
- start) + " ms");
    }



    @Override
    protected JndiRegistry createRegistry() throws Exception {
        JndiRegistry registry = super.createRegistry();
        registry.bind("activemq",
ActiveMQComponent.activeMQComponent("tcp://localhost:61616"));
        return registry;
    }



    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                from("direct:start")
                    .to("activemq:topic:test?deliveryPersistent=false");
            }
        };
    }
}

And got the log output: sending 1000 messages tooks 5968 ms
Which means less than 6ms per message. How did you measure the performance?
What number did you expect?

Best,
Christian

On Fri, Nov 16, 2012 at 7:07 PM, Edwin <ed...@gmail.com> wrote:

> ?deliveryPersistent=false
>