If I add a splitter in the route, the statistics because crazy

    public static void main(String args[]) throws Exception {

        StringBuilder messages = new StringBuilder();

        CamelContext context = new DefaultCamelContext();
        ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://localhost:61616");
        context.addComponent("activemq",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        context.addRoutes(new RouteBuilder() {

            public void configure() {
                from("direct:test")
                .split(body().tokenize(","))
                .to("log:org.apache.camel.example?level=INFO")
                .to("activemq:queue:test1");
            }
        });

        ProducerTemplate template = context.createProducerTemplate();
        context.start();

        for (int i = 0; i < 10000; i++) {
            messages.append("Test Message: " + i + ",");
        }

        template.sendBody("direct:test", messages.toString());

        Thread.sleep(300000);
        context.stop();
    }

Result :

Route : no exchanges - TotalProcessTime =0
Processor Splitter : no exchanges - TotalProcessTime =0
Processor Log : no exchanges - TotalProcessTime =0
Processor ActiveMQ : 4018 exchanges - TotalProcessTime = 56746

Regards,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel - Karaf - ServiceMix Committer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Blog : http://cmoulliard.blogspot.com |  Twitter :
http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: cmoulliard


On Mon, Aug 23, 2010 at 3:41 PM, Charles Moulliard <[email protected]>wrote:

> Same behavior observed with SEDA. 20 exchanges received by processor log,
> activemq
>
>
>
> On Mon, Aug 23, 2010 at 3:00 PM, Charles Moulliard 
> <[email protected]>wrote:
>
>> I will try with seda.
>>
>> Version used is camel-2.5-SNAPSHOT
>>
>>
>> On Mon, Aug 23, 2010 at 2:47 PM, Claus Ibsen <[email protected]>wrote:
>>
>>> Hi
>>>
>>> Could you try sending to a seda endpoint instead of direct.
>>>
>>> And what version of Camel are you using?
>>>
>>>
>>> On Mon, Aug 23, 2010 at 2:04 PM, Charles Moulliard <[email protected]>
>>> wrote:
>>> > Hi,
>>> >
>>> > I have created a very simple camel route to check statistics of camel
>>> >
>>> >
>>> from("direct:test").to("log:org.apache.camel.example?level=INFO").to("activemq:queue:test.queue");
>>> >
>>> > 10 messages are sent to the direct endpoint and 10 messages are
>>> published in
>>> > the queue of activemq
>>> >
>>> > What is strange ?
>>> >
>>> > 1) Number of exchanges completed by the processor "LOG" or "ACTIVEMQ"
>>> is
>>> > equal to 20 and not 10. Should it be equal to 10 ?
>>> >
>>> > ExchangesCompleted : 20
>>> > ExchangesTotal : 20
>>> >
>>> > 2) Time measured on the route is not the sum of each processor
>>> >                                 activemq processor - log processor -
>>> route
>>> > LastProcessingTime : 18 - 0 - 19
>>> > MaxProcessingTime : 380 - 14 - 406
>>> > MeanProcessingTime : 53 - 1 - 57
>>> > MinProcessingTime : 16 - 0 - 17
>>> > TotalProcessingTime : 1078 - 27 - 573 ???
>>> >
>>> > Regards,
>>> >
>>> >
>>> > Charles Moulliard
>>> >
>>> > Senior Enterprise Architect (J2EE, .NET, SOA)
>>> > Apache Camel - Karaf - ServiceMix Committer
>>> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> > Blog : http://cmoulliard.blogspot.com |  Twitter :
>>> > http://twitter.com/cmoulliard
>>> > Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype:
>>> cmoulliard
>>> >
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>
>>
>

Reply via email to