camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Commented: (CAMEL-2631) Add time millis converter which can convert from String to long
Date Wed, 21 Apr 2010 06:51:16 GMT


Claus Ibsen commented on CAMEL-2631:

1) Do not use {{new String}} but just {{" xxx"}}

Do not log INFO but do that as TRACE since the type converters can be invoked a lot.
And use ifTraceEnabled.

I think the return type should be {{Long}} and if the String input does *not* match any patterns,
then you should return {{Void.TYPE}} to indicate you cannot convert this.
Then Camel will let other type converters try, which for example can be a String -> Long
which can convert "444" to 444 as long value.

Add unit test for bullet #3. Eg to have Camel convert at regular number to a Long.
And then afterwards have Camel convert "5m2s" to Long to see that it uses your new type converter
And then try a regular "444" to 444 afterwards to ensure it still works

And could you add an unit test with the timer component that has a {{period}} option in the
URI using your new syntax, eg {{period=2s}} to indicate 2 seconds.

> Add time millis converter which can convert from String to long
> ---------------------------------------------------------------
>                 Key: CAMEL-2631
>                 URL:
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Ashwin Karpe
>            Priority: Minor
>         Attachments: time-pattern-converter-patch2.diff
> Its currently a bit annoying to set a delay by millis and if you need, like 1 hour 30
min period. What is this in millis?
> We should add a TypeConverter for that which has a String notation such as:
> {code}
> 1h30m
> 3h45m25s
> 10m
> 15m20s
> 30s
> {code}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message