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

camel-jq - Make it easier to grab elements in a template like fashion

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.3.0
    • camel-jq
    • None
    • Unknown

    Description

      If you have a json document where you need to grab a few elemenets, and then output this in another json or csv, or plain text, it would be nice to be able to grab them easly in a template script,

      For example the beer-source to get brand and name, you can do

              from("kamelet:beer-source")
                  .setHeader("name")
                      .jq(".name")
                  .setHeader("brand")
                      .jq(".brand")
                  .log("${header.brand} - ${header.name}");
      

      But would be nice to do something ala:

      .setBody().template("jq", "Brand of beer: .jq.brand and the name is .jq.name")

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              davsclaus Claus Ibsen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: