You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Alireza BANAEI <al...@atih.sante.fr> on 2012/12/05 16:38:05 UTC
Seda component problem
Hi,
We are going to use SEDA for some parallel task execution. We use Camel
2.10.2.
The problem with Seda is that it empties the queue even if there are
1000 messages in it. And if we decide to stop the router or the program,
we'll lose all messages, which is not acceptable. Here is out route :
from("activemq:*request*")
.startupOrder(2)
.to("seda:TRAITEMENTS_SAS");
from("seda:TRAITEMENTS_SAS?concurrentConsumers=4&size=4&blockWhenFull=true")
.startupOrder(1)
.shutdownRoute(ShutdownRoute.Defer)
.shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks)
.processRef("fromXmlProcessor")
.log("message:${body}")
.choice()
.when(header("commandType).isEqualTo("sas")
.processRef("sasProcessor")
.processRef("toXmlProcessor")
.to("activemq:*response*")
.otherwise()
.to("direct:Error")
.end();
It seems that Seda does not care about our setting and keeps fetching
all messages from the queue at once, before threading their processing
(4 at time).
Could anybody help us on this point.
Thanks in advance and best regards
Aliréza
--
Description: ATIH Description: BarreBleu
*Dr. Aliréza BANAEI*
*Responsable de pôle*
Systèmes de Recueil de l'Information Médicale - Service Architecture et
Production Informatique
*Agence technique de l'information sur l'hospitalisation (ATIH)*
13 rue Moreau Paris 75012
*Tél: 01 40 02 75 75* - 06 64 17 71 21
alireza.banaei@atih.sante.fr <mailto:#EMAIL#> - www.atih.sante.fr
<http://www.atih.sante.fr>
Re: Seda component problem
Posted by Willem jiang <wi...@gmail.com>.
Hi
The SEDA just give you a chance to handle the exchange to other thread, so you can keep feeding the message to the camel route without waiting for the processing.
If you want to make sure the message to be taken from when it is processing, you can use the direct endpoint to chain the routes together.
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Wednesday, December 5, 2012 at 11:38 PM, Alireza BANAEI wrote:
> Hi,
>
> We are going to use SEDA for some parallel task execution. We use Camel 2.10.2.
>
> The problem with Seda is that it empties the queue even if there are 1000 messages in it. And if we decide to stop the router or the program, we'll lose all messages, which is not acceptable. Here is out route :
>
> from("activemq:request")
> .startupOrder(2)
> .to("seda:TRAITEMENTS_SAS");
>
> from("seda:TRAITEMENTS_SAS?concurrentConsumers=4&size=4&blockWhenFull=true")
> .startupOrder(1)
> .shutdownRoute(ShutdownRoute.Defer)
> .shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks)
> .processRef("fromXmlProcessor")
> .log("message:${body}")
> .choice()
> .when(header("commandType).isEqualTo("sas")
> .processRef("sasProcessor")
> .processRef("toXmlProcessor")
> .to("activemq:response")
> .otherwise()
> .to("direct:Error")
> .end();
>
> It seems that Seda does not care about our setting and keeps fetching all messages from the queue at once, before threading their processing (4 at time).
>
> Could anybody help us on this point.
>
> Thanks in advance and best regards
>
> Aliréza
> --
>
> Dr. Aliréza BANAEI
> Responsable de pôle
> Systèmes de Recueil de l'Information Médicale - Service Architecture et Production Informatique
> Agence technique de l’information sur l’hospitalisation (ATIH)
> 13 rue Moreau Paris 75012
> Tél: 01 40 02 75 75 - 06 64 17 71 21
> alireza.banaei@atih.sante.fr (mailto:#EMAIL#) - www.atih.sante.fr (http://www.atih.sante.fr)
>
>
>
>
>
>