Bruno Meseguer created CAMEL-18368:
--------------------------------------

             Summary: Kamelet jslt-action not handling byte[] input
                 Key: CAMEL-18368
                 URL: https://issues.apache.org/jira/browse/CAMEL-18368
             Project: Camel
          Issue Type: Improvement
          Components: camel-k
         Environment: The samples have been tested with the Camel K Operator 
1.9.x on an OpenShift environment.
            Reporter: Bruno Meseguer
         Attachments: stage1-telegram-jira.tar.gz

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:
{code:java}
org.apache.camel.ValidationException: Allowed body types are String or 
InputStream.. Exchange[]{code}
 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to