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

Kamelet jslt-action not handling byte[] input

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.18.2, 3.19.0
    • camel-k
    • None
    • The samples have been tested with the Camel K Operator 1.9.x on an OpenShift environment.

    • Unknown

    Description

      the [jslt-action] kamelet, based on the JSLT component is very handy for performing data transformations with JSON input.

      However, when configuring KameletBindings, for non-Camel users, it becomes tricky as some Kamelet sources deliver JSON in byte[]. If we bind for example a Telegram Source with the JSLT action before sending it to some backend, the process fails with the following message:

      org.apache.camel.ValidationException: Allowed body types are String or InputStream.. Exchange[]

       One way to work around the problem is to customise the JSLT-action to convert the body to String, or modify the Telegram source to deliver String JSON payloads.

      Attached is a sample project containing a modified JSLT-action and a sample KameletBinding connecting Telegram to the JSLT action. Note the modified action converts the body to String.

      Attachments

        1. stage1-telegram-jira.tar.gz
          4 kB
          Bruno Meseguer

        Activity

          People

            davsclaus Claus Ibsen
            bruno.meseguer Bruno Meseguer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: