You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by hervbarr <he...@gmail.com> on 2010/11/25 10:35:37 UTC

Camel route and message order

Hi,
I'm trying to keep the message order on camel route but in some cases it's
not working.

My test method is :
I use soap ui to send message sequentially with an increasing indice (the
soap ui client is waiting the reply to send the next response).

I have try with a simple jetty handler which take 1 second to process the
message and i forced jetty to use only one thread.

final Server server = new Server(8081);
        final ThreadPool threadPool = new QueuedThreadPool(2);
        server.setThreadPool(threadPool);

the soap ui client can't send more than one message per second (i use the
continuous loop to be as fast at jetty can), waiting the answer, and the
order is kept.

If i try with a camel route
from("cxf:bean:myEndpoint").process(myProcess);
where myProcess take also 1 second to manage the message 

With the following camel context to have the same jetty behavior :
<httpj:engine-factory bus="cxf">
    	<httpj:engine port="0">
    		<httpj:threadingParameters minThreads="1" maxThreads="2" />
    	</httpj:engine>
	</httpj:engine-factory>
	
    <cxf:cxfEndpoint id="myEndpoint" address="http://localhost:8081/test" 
        serviceClass="org.example.testServiceProvider"
        xmlns:test="http://org.example.order"
        endpointName="test:testPort" serviceName="test:testService"
        wsdlURL="/META-INF/service.wsdl" />
    
    <bean id="myRouteBuilder" class="org.example.MyRouteBuilder" />
        
    <camel:camelContext id="testService">
        <camel:routeBuilder ref="myRouteBuilder" />
    </camel:camelContext>

I notice that the behavior with the route is quiet different.
SOAP UI can send quickly messages but some times it can block such as
waiting like the previous test.

And i have the following result :
OK - indice 1 - refIndice 0
OK - indice 2 - refIndice 1
OK - indice 3 - refIndice 2
OK - indice 4 - refIndice 3
OK - indice 5 - refIndice 4
OK - indice 6 - refIndice 5
OK - indice 7 - refIndice 6
OK - indice 8 - refIndice 7
OK - indice 9 - refIndice 8
...
OK - indice 49 - refIndice 48
OK - indice 50 - refIndice 49
OK - indice 51 - refIndice 50
ERROR - indice 308 - refIndice 51 <- At this place i have sent the 329th
message and i stop the message sending
OK - indice 309 - refIndice 308
OK - indice 310 - refIndice 309
OK - indice 311 - refIndice 310
OK - indice 312 - refIndice 311
OK - indice 313 - refIndice 312
OK - indice 314 - refIndice 313
OK - indice 315 - refIndice 314
OK - indice 316 - refIndice 315
OK - indice 317 - refIndice 316
OK - indice 318 - refIndice 317
OK - indice 319 - refIndice 318
OK - indice 320 - refIndice 319
OK - indice 321 - refIndice 320
OK - indice 322 - refIndice 321
OK - indice 323 - refIndice 322
OK - indice 324 - refIndice 323
OK - indice 325 - refIndice 324
OK - indice 326 - refIndice 325
OK - indice 327 - refIndice 326
OK - indice 328 - refIndice 327
ERROR - indice 52 - refIndice 328 
OK - indice 53 - refIndice 52
...
OK - indice 299 - refIndice 298
OK - indice 300 - refIndice 299
OK - indice 301 - refIndice 300
OK - indice 302 - refIndice 301
OK - indice 303 - refIndice 302
OK - indice 304 - refIndice 303
OK - indice 305 - refIndice 304
OK - indice 306 - refIndice 305
OK - indice 307 - refIndice 306
ERROR - indice 329 - refIndice 307

I attach the maven project and the soap ui project with the test case to be
able to reproduce this.
http://camel.465427.n5.nabble.com/file/n3279758/orderTestIssue.zip
orderTestIssue.zip 

Is there another configuration to do to avoid this problem ?

Thank you for replies.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-route-and-message-order-tp3279758p3279758.html
Sent from the Camel - Users mailing list archive at Nabble.com.