luigidemasi edited a comment on issue #1107:
URL: 
https://github.com/apache/camel-kafka-connector/issues/1107#issuecomment-801487018


   @jonaswagner, @oscerd is right: in a source task, a converter is used to 
convert incoming data to a byte array using fromConnectData method from 
[Converter](https://github.com/apache/kafka/blob/9adfac280392da0837cfd8d582bc540951e94087/connect/api/src/main/java/org/apache/kafka/connect/storage/Converter.java#L46)
 interface but you already have byte array in your body, that's the reason for 
the error.
   
   So you can use `org.apache.kafka.connect.converters.ByteArrayConverter` to 
have a raw byte array in your topic, or not using a converter at all and get a 
JSON with schema and in the payload the base64 representation of the byte array:
   
   ```json
   {
      "schema":{
         "type":"bytes",
         "optional":false
      },
      
"payload":"/9j/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/AAAAF5jcHJ0AAABXAAAAAt3dHB0AAABaAAAABRia3B0AAABfAAAABRyWFlaAAABkAAAABRnWFlaAAABpAAAABRiWFlaAAABuAAAABRyVFJDAAABzAAAAEBnVFJDAAABzAAAAEBiVFJDAAABzAAAAEBkZXNjAAAAAAAAAANjMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAEZCAABYWVogAAAAAAAA9tYAAQAAAADTLVhZWiAAAAAAAAADFgAAAzMAAAKkWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPY3Vyd....."
   }
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to