camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Preventing empty results from MyBatis producer being forwarded
Date Thu, 13 Sep 2012 08:56:52 GMT
See the filter EIP, then check for an empty list or something in the
filter predicate.

On Thu, Sep 13, 2012 at 10:43 AM,  <mikko.wuokko@accenture.com> wrote:
> Hi.
>
> I have a route similar to the polling example on MyBatis component page:
>
> from("timer://pollTheDatabase?delay=30000").to("mbatis:selectAllAccounts").to("activemq:queue:allAccounts");
>
> When I run Camel I see that also the empty resultsets are being sent to MQ. This causes
redundant messages and data transfer and I would like to avoid that. The MyBatis docs tell
about option "consumer.routeEmptyResultSet" which sadly works only for producers.
>
> Is there a way to prevent sending the empty results sets to the next step? I tried to
fondle a bit with the .choice(), but found no solution.
>
> Regards,
>
> Mikko
>
> ________________________________
> Subject to local law, communications with Accenture and its affiliates including telephone
calls and emails (including content), may be monitored by our systems for the purposes of
security and the assessment of internal compliance with Accenture policy.
> ______________________________________________________________________________________
>
> www.accenture.com



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message