-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
integration-doc-2021-11-15
-
2
-
Example avro-serialize-action-binding throws error:
[1] 2021-11-03 09:28:56,460 ERROR [org.apa.cam.pro.err.DefaultErrorHandler] (Camel (camel-1) thread #0 - timer://tick) Failed delivery for (MessageId: 3189F24F9AC9C13-0000000000000026 on ExchangeId: 3189F24F9AC9C13-0000000000000026). Exhausted after delivery attempt: 1 caught: com.fasterxml.jackson.databind.JsonMappingException: class java.lang.String cannot be cast to class org.apache.avro.generic.IndexedRecord
The "timer-source" kamelet produces String message which can't be cast to avro format expected by first step action kamelet "avro-serialize-action".
Based on info from nicolaferraro, I suggest to edit the example:
apiVersion: camel.apache.org/v1alpha1 kind: KameletBinding metadata: name: avro-serialize-action-binding spec: source: ref: kind: Kamelet apiVersion: camel.apache.org/v1alpha1 name: timer-source properties: message: '{"first":"Ada","last":"Lovelace"}' steps: - ref: kind: Kamelet apiVersion: camel.apache.org/v1alpha1 name: json-deserialize-action - ref: kind: Kamelet apiVersion: camel.apache.org/v1alpha1 name: avro-serialize-action properties: schema: "{\"type\": \"record\", \"namespace\": \"com.example\", \"name\": \"FullName\", \"fields\": [{\"name\": \"first\", \"type\": \"string\"},{\"name\": \"last\", \"type\": \"string\"}]}" ...
Which runs correctly