Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18119

Regression in 3.4 in date formatting of Simple expression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.4.0
    • 3.14.4, 3.18.0
    • camel-core
    • None
    • Unknown
    • Regression

    Description

      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 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:

      1. revert to exchange.getIn().getHeader(key, Date.class) because there's a DateTimeConverter.toDate(Long value) converter if you have a Long
      2. 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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              antoine.dessaigne Antoine DESSAIGNE
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: