Hi

Nice work keep it going.

A cron like predicate would be nice.

And for compound predicates you can do that in Camel in Java DSL using
the predicate builder.
http://www.davsclaus.com/2009/02/apache-camel-and-using-compound.html

Though when working with date/times. You need to consider the time zone as well.



On Sun, Nov 10, 2013 at 5:16 PM, Lorenzo Bolzani <[email protected]> wrote:
> 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 <[email protected]>:
>> 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 <[email protected]> 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
>>
>>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to