This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch kafka-apicurio-json in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit cc36e3658612ecc6d41b4725c8a7f61c82a66ad8 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Wed May 15 10:57:00 2024 +0200 Added Kafka Apicurio Registry Kamelet supporting Json Schema Signed-off-by: Andrea Cosentino <anco...@gmail.com> --- ...icurio-registry-not-secured-source.kamelet.yaml | 10 +--- ...red-apicurio-registry-json-source.kamelet.yaml} | 61 ++++++++++++++++++---- ...icurio-registry-not-secured-source.kamelet.yaml | 10 +--- ...ured-apicurio-registry-json-source.kamelet.yaml | 61 ++++++++++++++++++---- 4 files changed, 106 insertions(+), 36 deletions(-) diff --git a/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml b/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml index c8e1be1b..bd53773d 100644 --- a/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml +++ b/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml @@ -92,7 +92,7 @@ spec: title: Value Deserializer description: Deserializer class for value that implements the Deserializer interface. type: string - default: "io.apicurio.registry.serde.avro.AvroKafkaDeserializer" + default: "io.apicurio.registry.serde.jsonschema.JsonSchemaKafkaDeserializer" apicurioRegistryUrl: title: Apicurio Registry URL description: The Apicurio Schema Registry URL @@ -100,11 +100,6 @@ spec: x-descriptors: - urn:keda:metadata:bootstrapServers - urn:keda:required - avroDatumProvider: - title: Avro Datum Provider - description: How to read data with Avro - type: string - default: "io.apicurio.registry.serde.avro.ReflectAvroDatumProvider" topicIsPattern: title: Topic Is Pattern description: Whether the topic is a pattern (regular expression). This can be used to subscribe to dynamic number of topics matching the pattern. @@ -115,7 +110,7 @@ spec: - "camel:kafka" - "camel:core" - "camel:kamelet" - - "mvn:io.quarkus:quarkus-apicurio-registry-avro:3.6.3" + - "mvn:io.quarkus:io.quarkus:quarkus-apicurio-registry-json-schema:3.6.3" template: beans: - name: kafkaHeaderDeserializer @@ -134,7 +129,6 @@ spec: valueDeserializer: "{{valueDeserializer}}" topicIsPattern: "{{topicIsPattern}}" additionalProperties.apicurio.registry.url: "{{apicurioRegistryUrl}}" - additionalProperties.apicurio.registry.avro-datum-provider: "{{avroDatumProvider}}" steps: - process: ref: "{{kafkaHeaderDeserializer}}" diff --git a/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml b/kamelets/kafka-not-secured-apicurio-registry-json-source.kamelet.yaml similarity index 75% copy from kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml copy to kamelets/kafka-not-secured-apicurio-registry-json-source.kamelet.yaml index c8e1be1b..473cb4d4 100644 --- a/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml +++ b/kamelets/kafka-not-secured-apicurio-registry-json-source.kamelet.yaml @@ -17,7 +17,7 @@ apiVersion: camel.apache.org/v1 kind: Kamelet metadata: - name: kafka-apicurio-registry-not-secured-source + name: kafka-not-secured-apicurio-registry-json-source annotations: camel.apache.org/kamelet.support.level: "Preview" camel.apache.org/catalog.version: "4.7.0-SNAPSHOT" @@ -30,13 +30,19 @@ metadata: camel.apache.org/kamelet.type: "source" spec: definition: - title: "Kafka Not Secured with Apicurio Registry Source" + title: "Kafka not secured with Apicurio Registry secured with Keycloak Source for JSON schema support" description: |- - Receive data from Kafka topics on an insecure broker combined with Apicurio Registry. + Receive data from Kafka topics on an insecure broker combined with Apicurio Registry secured with Keycloak. required: - topic - bootstrapServers - apicurioRegistryUrl + - apicurioAuthServiceUrl + - apicurioAuthRealm + - apicurioAuthClientId + - apicurioAuthClientSecret + - apicurioAuthUsername + - apicurioAuthPassword type: object properties: topic: @@ -92,7 +98,7 @@ spec: title: Value Deserializer description: Deserializer class for value that implements the Deserializer interface. type: string - default: "io.apicurio.registry.serde.avro.AvroKafkaDeserializer" + default: "io.apicurio.registry.serde.jsonschema.JsonSchemaKafkaDeserializer" apicurioRegistryUrl: title: Apicurio Registry URL description: The Apicurio Schema Registry URL @@ -100,11 +106,41 @@ spec: x-descriptors: - urn:keda:metadata:bootstrapServers - urn:keda:required - avroDatumProvider: - title: Avro Datum Provider - description: How to read data with Avro + apicurioAuthServiceUrl: + title: Apicurio Registry Auth Service URL + description: The URL for Keycloak instance securing the Apicurio Registry type: string - default: "io.apicurio.registry.serde.avro.ReflectAvroDatumProvider" + example: "http://my-keycloak.com:8080/" + apicurioAuthRealm: + title: Apicurio Registry Auth Realm + description: The Realm in Keycloak instance securing the Apicurio Registry + type: string + apicurioAuthClientId: + title: Apicurio Registry Auth Client ID + description: The Client ID in Keycloak instance securing the Apicurio Registry + type: string + apicurioAuthClientSecret: + title: Apicurio Registry Auth Client Secret + description: The Client Secret in Keycloak instance securing the Apicurio Registry + type: string + format: password + x-descriptors: + - urn:camel:group:credentials + - urn:keda:authentication:password + - urn:keda:required + apicurioAuthUsername: + title: Apicurio Registry Auth Username + description: The Username in Keycloak instance securing the Apicurio Registry + type: string + apicurioAuthPassword: + title: Apicurio Registry Auth Password + description: The Password in Keycloak instance securing the Apicurio Registry + type: string + format: password + x-descriptors: + - urn:camel:group:credentials + - urn:keda:authentication:password + - urn:keda:required topicIsPattern: title: Topic Is Pattern description: Whether the topic is a pattern (regular expression). This can be used to subscribe to dynamic number of topics matching the pattern. @@ -115,7 +151,7 @@ spec: - "camel:kafka" - "camel:core" - "camel:kamelet" - - "mvn:io.quarkus:quarkus-apicurio-registry-avro:3.6.3" + - "mvn:io.apicurio:apicurio-registry-serdes-jsonschema-serde:2.5.11.Final" template: beans: - name: kafkaHeaderDeserializer @@ -134,7 +170,12 @@ spec: valueDeserializer: "{{valueDeserializer}}" topicIsPattern: "{{topicIsPattern}}" additionalProperties.apicurio.registry.url: "{{apicurioRegistryUrl}}" - additionalProperties.apicurio.registry.avro-datum-provider: "{{avroDatumProvider}}" + additionalProperties.apicurio.auth.service.url: "{{apicurioAuthServiceUrl}}" + additionalProperties.apicurio.auth.realm: "{{apicurioAuthRealm}}" + additionalProperties.apicurio.auth.client.id: "{{apicurioAuthClientId}}" + additionalProperties.apicurio.auth.client.secret: "{{apicurioAuthClientSecret}}" + additionalProperties.apicurio.auth.username: "{{apicurioAuthUsername}}" + additionalProperties.apicurio.auth.password: "{{apicurioAuthPassword}}" steps: - process: ref: "{{kafkaHeaderDeserializer}}" diff --git a/library/camel-kamelets/src/main/resources/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml index c8e1be1b..bd53773d 100644 --- a/library/camel-kamelets/src/main/resources/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml @@ -92,7 +92,7 @@ spec: title: Value Deserializer description: Deserializer class for value that implements the Deserializer interface. type: string - default: "io.apicurio.registry.serde.avro.AvroKafkaDeserializer" + default: "io.apicurio.registry.serde.jsonschema.JsonSchemaKafkaDeserializer" apicurioRegistryUrl: title: Apicurio Registry URL description: The Apicurio Schema Registry URL @@ -100,11 +100,6 @@ spec: x-descriptors: - urn:keda:metadata:bootstrapServers - urn:keda:required - avroDatumProvider: - title: Avro Datum Provider - description: How to read data with Avro - type: string - default: "io.apicurio.registry.serde.avro.ReflectAvroDatumProvider" topicIsPattern: title: Topic Is Pattern description: Whether the topic is a pattern (regular expression). This can be used to subscribe to dynamic number of topics matching the pattern. @@ -115,7 +110,7 @@ spec: - "camel:kafka" - "camel:core" - "camel:kamelet" - - "mvn:io.quarkus:quarkus-apicurio-registry-avro:3.6.3" + - "mvn:io.quarkus:io.quarkus:quarkus-apicurio-registry-json-schema:3.6.3" template: beans: - name: kafkaHeaderDeserializer @@ -134,7 +129,6 @@ spec: valueDeserializer: "{{valueDeserializer}}" topicIsPattern: "{{topicIsPattern}}" additionalProperties.apicurio.registry.url: "{{apicurioRegistryUrl}}" - additionalProperties.apicurio.registry.avro-datum-provider: "{{avroDatumProvider}}" steps: - process: ref: "{{kafkaHeaderDeserializer}}" diff --git a/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/kafka-not-secured-apicurio-registry-json-source.kamelet.yaml similarity index 75% copy from kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml copy to library/camel-kamelets/src/main/resources/kamelets/kafka-not-secured-apicurio-registry-json-source.kamelet.yaml index c8e1be1b..473cb4d4 100644 --- a/kamelets/kafka-apicurio-registry-not-secured-source.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/kafka-not-secured-apicurio-registry-json-source.kamelet.yaml @@ -17,7 +17,7 @@ apiVersion: camel.apache.org/v1 kind: Kamelet metadata: - name: kafka-apicurio-registry-not-secured-source + name: kafka-not-secured-apicurio-registry-json-source annotations: camel.apache.org/kamelet.support.level: "Preview" camel.apache.org/catalog.version: "4.7.0-SNAPSHOT" @@ -30,13 +30,19 @@ metadata: camel.apache.org/kamelet.type: "source" spec: definition: - title: "Kafka Not Secured with Apicurio Registry Source" + title: "Kafka not secured with Apicurio Registry secured with Keycloak Source for JSON schema support" description: |- - Receive data from Kafka topics on an insecure broker combined with Apicurio Registry. + Receive data from Kafka topics on an insecure broker combined with Apicurio Registry secured with Keycloak. required: - topic - bootstrapServers - apicurioRegistryUrl + - apicurioAuthServiceUrl + - apicurioAuthRealm + - apicurioAuthClientId + - apicurioAuthClientSecret + - apicurioAuthUsername + - apicurioAuthPassword type: object properties: topic: @@ -92,7 +98,7 @@ spec: title: Value Deserializer description: Deserializer class for value that implements the Deserializer interface. type: string - default: "io.apicurio.registry.serde.avro.AvroKafkaDeserializer" + default: "io.apicurio.registry.serde.jsonschema.JsonSchemaKafkaDeserializer" apicurioRegistryUrl: title: Apicurio Registry URL description: The Apicurio Schema Registry URL @@ -100,11 +106,41 @@ spec: x-descriptors: - urn:keda:metadata:bootstrapServers - urn:keda:required - avroDatumProvider: - title: Avro Datum Provider - description: How to read data with Avro + apicurioAuthServiceUrl: + title: Apicurio Registry Auth Service URL + description: The URL for Keycloak instance securing the Apicurio Registry type: string - default: "io.apicurio.registry.serde.avro.ReflectAvroDatumProvider" + example: "http://my-keycloak.com:8080/" + apicurioAuthRealm: + title: Apicurio Registry Auth Realm + description: The Realm in Keycloak instance securing the Apicurio Registry + type: string + apicurioAuthClientId: + title: Apicurio Registry Auth Client ID + description: The Client ID in Keycloak instance securing the Apicurio Registry + type: string + apicurioAuthClientSecret: + title: Apicurio Registry Auth Client Secret + description: The Client Secret in Keycloak instance securing the Apicurio Registry + type: string + format: password + x-descriptors: + - urn:camel:group:credentials + - urn:keda:authentication:password + - urn:keda:required + apicurioAuthUsername: + title: Apicurio Registry Auth Username + description: The Username in Keycloak instance securing the Apicurio Registry + type: string + apicurioAuthPassword: + title: Apicurio Registry Auth Password + description: The Password in Keycloak instance securing the Apicurio Registry + type: string + format: password + x-descriptors: + - urn:camel:group:credentials + - urn:keda:authentication:password + - urn:keda:required topicIsPattern: title: Topic Is Pattern description: Whether the topic is a pattern (regular expression). This can be used to subscribe to dynamic number of topics matching the pattern. @@ -115,7 +151,7 @@ spec: - "camel:kafka" - "camel:core" - "camel:kamelet" - - "mvn:io.quarkus:quarkus-apicurio-registry-avro:3.6.3" + - "mvn:io.apicurio:apicurio-registry-serdes-jsonschema-serde:2.5.11.Final" template: beans: - name: kafkaHeaderDeserializer @@ -134,7 +170,12 @@ spec: valueDeserializer: "{{valueDeserializer}}" topicIsPattern: "{{topicIsPattern}}" additionalProperties.apicurio.registry.url: "{{apicurioRegistryUrl}}" - additionalProperties.apicurio.registry.avro-datum-provider: "{{avroDatumProvider}}" + additionalProperties.apicurio.auth.service.url: "{{apicurioAuthServiceUrl}}" + additionalProperties.apicurio.auth.realm: "{{apicurioAuthRealm}}" + additionalProperties.apicurio.auth.client.id: "{{apicurioAuthClientId}}" + additionalProperties.apicurio.auth.client.secret: "{{apicurioAuthClientSecret}}" + additionalProperties.apicurio.auth.username: "{{apicurioAuthUsername}}" + additionalProperties.apicurio.auth.password: "{{apicurioAuthPassword}}" steps: - process: ref: "{{kafkaHeaderDeserializer}}"