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

camel-lumberjack should support longs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.20.0
    • None
    • None
    • Patch Available
    • Unknown

    Description

      Filebeat 5 introduced json parsing options that allow using resources more efficiently but the camel-lumberjack component unmarshalling behaves badly with long values so we can't take advantage of it.

      Right now the following log message :

      {"long":1491320561000}
      

      With the following route

      <?xml version="1.0" encoding="UTF-8"?>
      <routes xmlns="http://camel.apache.org/schema/spring" xmlns:u="http://www.systar.com/aluminium/camel-util">
          <route>
              <from uri="lumberjack:0.0.0.0:5044"/>
              <log message="just received : ${body}"/>
          </route>
      </routes>
      

      Will produce the following console log

      just received :.... long=1.491320561E12 .....
      

      instead of

      just received :.... long=1491320561000 .....
      

      Even if JSON is not supposed to handle longs, implementations such as Jackson do support it which is really handy. So switching from Gson to Jackson for JSON handling we'll be usefull.

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              antoine.dessaigne Antoine DESSAIGNE
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: