You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Antoine DESSAIGNE (Jira)" <ji...@apache.org> on 2022/05/17 11:57:00 UTC

[jira] [Created] (CAMEL-18119) Regression in 3.4 in date formatting of Simple expression

Antoine DESSAIGNE created CAMEL-18119:
-----------------------------------------

             Summary: Regression in 3.4 in date formatting of Simple expression
                 Key: CAMEL-18119
                 URL: https://issues.apache.org/jira/browse/CAMEL-18119
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 3.4.0
            Reporter: Antoine DESSAIGNE


Hello,

We use Joda time and we have custom Joda<>Java converters. For instance, you can convert Joda's {{ReadableInstant}} into Java's {{Date}}.

Since [this commit|https://github.com/apache/camel/commit/46f4c43315219dba429c0612bbff5b05ef2ec0ac] from CAMEL-15114, Simple expressions can no longer convert header object to a {{Date}} object, they can only handle {{Date}} and {{Long}} types.

I can provide a pull request but I see 2 ways of solving it and I don't know which one you prefer:
# revert to {{exchange.getIn().getHeader(key, Date.class)}} because there's a {{DateTimeConverter.toDate(Long value)}} converter if you have a {{Long}}
# keep the check on {{Date}} and {{Long}} types and then try to convert to {{Date}} and then fail if it cannot be converted

Thank you



--
This message was sent by Atlassian Jira
(v8.20.7#820007)