camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lorenzo Bolzani <l.bolz...@gmail.com>
Subject Re: When - an Apache Camel Component for time slots management
Date Sun, 10 Nov 2013 16:16:10 GMT
Hi Christoph,
thanks for your feedback.

If I understand correctly you are suggesting to implement this on top
of standard message filtering[1] and I think it's a good idea.

So I could write a custom Predicate[2] and build a route like this:

from("direct:start").
        filter().MY_PREDICATE("MON-FRI").
        to("mock:result");


I do not think I can handle patterns like this:

MON,WED,FRI 12-22; !WED 16-20; SAT 8-12

without a custom Predicate. For simple patterns a regexp could work,
for complex one a custom bean or a groovy fragment could be fine but
far less immediate. I think I'm going to add this option.


Bye

Lorenzo


[1] http://camel.apache.org/message-filter.html
[2] http://camel.apache.org/predicate.html

2013/11/10 Christoph Emmersberger <cemmersb@gmail.com>:
> Hi Lorenzo,
>
> very interesting approach that you’ve been posing out there. I just wonder,
> if there is really a component necessary to integrate the date / time
> function, or if it might be better to implement an approach via the simple
> DSL.
>
> To me it seems that you are filtering exchange messages and the simple DSL
> would allow you access to the so called ‘date:command:pattern’. Therefore
> I’m not quite sure, if the implementation of a component is some overhead
> compared to the DSL approach, i.e. since the access of current time as well
> as exchange header information is already available (see also:
> http://camel.apache.org/simple.html)
>
> Kind regards,
>
> Christoph
>
>
> On 10 Nov 2013, at 15:14, Lorenzo Bolzani <l.bolzani@gmail.com> wrote:
>
> Hi,
> I just created this very simple component to allow/suspend a service at
> certain times.
>
>
> https://bitbucket.org/nottrz/when
>
>
> Any feedback is welcome.
>
>
>
> Bye
>
> Lorenzo
>
>

Mime
View raw message