christophd opened a new pull request, #1162: URL: https://github.com/apache/camel-kamelets/pull/1162
- Introduce data type converters - Add data type processor to auto convert exchange message from/to given data type - Let user choose which data type to use (via Kamelet property) - Add data type registry and annotation based loader to find data type implementations by component scheme and name Relates to CAMEL-18698 and https://github.com/apache/camel-k/issues/1980 This PR introduces input/output data types on Kamelets. Each Kamelet is able to use a specific data type processor and a registry to resolve data types and its conversion logic. ```yaml apiVersion: camel.apache.org/v1alpha1 kind: Kamelet metadata: name: aws-s3-source labels: camel.apache.org/kamelet.type: "source" spec: template: beans: - name: dataTypeRegistry type: "#class:org.apache.camel.kamelets.utils.format.DefaultDataTypeRegistry" - name: dataTypeProcessor type: "#class:org.apache.camel.kamelets.utils.format.DataTypeProcessor" property: - key: format value: '{{outputFormat}}' [...] steps: - process: ref: "{{dataTypeProcessor}}" - to: "kamelet:sink" ``` The user chooses the data type in the Kamelet binding by its format name and sets the property `outputFormat` on the binding source. ```yaml apiVersion: camel.apache.org/v1alpha1 kind: KameletBinding metadata: name: aws-s3-uri-binding spec: source: ref: kind: Kamelet apiVersion: camel.apache.org/v1alpha1 name: aws-s3-source properties: bucketNameOrArn: myBucket accessKey: ... secretKey: ... region: … outputFormat: json sink: uri: log:info ``` The `json` data type is provided by the aws-s3 component and adds automatic message body conversion logic. The data type and its conversion logic is defined via annotations and a registry automatically performs a lookup based on the component scheme and the data format name. As an example the PR introduces some standard data type converters as well as output data types for the `aws-s3-source` and input data types for the `aws-ddb-sink` Kamelet. -- 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. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org