This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new 764832d7b chore: the Kafka Kamelets can log in to the schema registry 
(#3279) (#3286)
764832d7b is described below

commit 764832d7babb66ff438dce43df94c39eceb24863
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Nov 20 22:16:03 2026 +0100

    chore: the Kafka Kamelets can log in to the schema registry (#3279) (#3286)
    
    * chore: default data types on the Messaging and Kafka Kamelets where the 
body is fixed (#3117)
    
    - pulsar-sink, mqtt5-sink: in default binary (application-octet-stream).
      The body is turned into byte[] and Content-Type set to
      application/octet-stream before sending; both send the same bytes as
      before (the producers convert to byte[] themselves and send no headers),
      but the message after the sink is byte[] instead of String.
    - value-to-key-action, message-timestamp-router-action: out default json
      (application-json). The body is byte[] instead of a stream
      (InputStreamCache); Content-Type stays application/json.
    - kafka-batch-source: the description says each List entry is a Camel
      Exchange, read with getMessage().getBody(), not a message.
    - Descriptions updated; the pulsar-sink, value-to-key-action and
      message-timestamp-router-action Citrus tests expect [B and the new
      Content-Type, and pulsar-sink checks its text through an X-Body header.
    
    No default on the sources: a source Kamelet's out default runs only after
    the whole consuming route, not before it, and fails the exchange there
    when the route ends with a Map or a number. No default on the JMS,
    spring-rabbitmq, nats, smpp and kafka sinks, kafka-source,
    kafka-batch-source, smpp-source and the header-only Kafka actions.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * chore: kafka-batch-source can read records through a schema registry 
(#3279)
    
    kafka-batch-source gets the schema registry options of kafka-source:
    schemaRegistryVendor, schemaRegistryUrl, schemaRegistryRegion,
    schemaRegistryName and schemaFormat. As kafka-source does for one record, it
    gives each value of the batch as JSON text: a JSON Schema value is 
marshalled,
    an Avro value is turned into its JSON text. It now depends on 
camel:jackson3.
    
    New Citrus tests write two records through the schema registry of Redpanda
    with kafka-sink, with schemaFormat json and avro, and read them as one 
batch.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * chore: the Kafka Kamelets can log in to the schema registry (#3279)
    
    kafka-source, kafka-sink and kafka-batch-source pass the schema registry 
login
    options of camel-kafka (CAMEL-27256): schemaRegistryUsername and
    schemaRegistryPassword for basic auth (the API key and secret of Confluent
    Cloud), and schemaRegistryOauthTokenEndpoint, schemaRegistryOauthClientId,
    schemaRegistryOauthClientSecret and schemaRegistryOauthScope for OAuth2 
client
    credentials. The secrets are marked as such and passed in RAW().
    
    The descriptions say how each vendor logs in, and that Kafka only calls an
    OAuth2 token endpoint listed in the JVM system property
    org.apache.kafka.sasl.oauthbearer.allowed.urls, which also applies to the
    existing saslAuthType OAUTH. A new Citrus test checks the basic auth login
    that the registry receives.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    
    * chore: the Kafka partial pages describe the schema registry login
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Claude-Session: https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
    
    ---------
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../ROOT/partials/kafka-sink-description.adoc      |  5 +-
 .../ROOT/partials/kafka-source-description.adoc    |  5 +-
 kamelets/kafka-batch-source.kamelet.yaml           | 45 +++++++++++++++-
 kamelets/kafka-sink.kamelet.yaml                   | 45 +++++++++++++++-
 kamelets/kafka-source.kamelet.yaml                 | 45 +++++++++++++++-
 .../main/resources/META-INF/kamelets-index.json    |  6 +--
 .../kamelets/kafka-batch-source.kamelet.yaml       | 45 +++++++++++++++-
 .../resources/kamelets/kafka-sink.kamelet.yaml     | 45 +++++++++++++++-
 .../resources/kamelets/kafka-source.kamelet.yaml   | 45 +++++++++++++++-
 ...afka-schema-registry-login-route.citrus.it.yaml | 63 ++++++++++++++++++++++
 .../kafka/kafka-schema-registry-login-route.yaml   | 51 ++++++++++++++++++
 11 files changed, 383 insertions(+), 17 deletions(-)

diff --git a/docs/modules/ROOT/partials/kafka-sink-description.adoc 
b/docs/modules/ROOT/partials/kafka-sink-description.adoc
index 984b918d6..125a677cb 100644
--- a/docs/modules/ROOT/partials/kafka-sink-description.adoc
+++ b/docs/modules/ROOT/partials/kafka-sink-description.adoc
@@ -37,7 +37,10 @@ schema it makes, and does not check the message against a 
schema that is already
 The serde jars of the vendor are not part of the Kamelet. Camel JBang 
downloads them by itself; the Confluent jars are
 in the Confluent Maven repository, not in Maven Central, so run with 
`--repos=confluent`. In a Maven project, add the
 jar of the vendor and format, such as `io.confluent:kafka-avro-serializer`, 
and for Confluent the repository
-`https://packages.confluent.io/maven/`. A `confluent` or `apicurio` registry 
that requires a login is not supported yet.
+`https://packages.confluent.io/maven/`. To log in to a `confluent` or 
`apicurio` registry, set `schemaRegistryUsername`
+and `schemaRegistryPassword` (basic auth), or 
`schemaRegistryOauthTokenEndpoint`, `schemaRegistryOauthClientId`,
+`schemaRegistryOauthClientSecret` and, if needed, `schemaRegistryOauthScope` 
(OAuth2). `azure` and `aws-glue` log in with
+the credentials of the environment.
 
 [source,yaml,subs='+attributes,macros']
 ----
diff --git a/docs/modules/ROOT/partials/kafka-source-description.adoc 
b/docs/modules/ROOT/partials/kafka-source-description.adoc
index 39c8729ce..17b9cca7b 100644
--- a/docs/modules/ROOT/partials/kafka-source-description.adoc
+++ b/docs/modules/ROOT/partials/kafka-source-description.adoc
@@ -83,7 +83,10 @@ turns it into JSON text, so the next step gets text as 
without a registry: an Av
 The serde jars of the vendor are not part of the Kamelet. Camel JBang 
downloads them by itself; the Confluent jars are
 in the Confluent Maven repository, not in Maven Central, so run with 
`--repos=confluent`. In a Maven project, add the
 jar of the vendor and format, such as `io.confluent:kafka-avro-serializer`, 
and for Confluent the repository
-`https://packages.confluent.io/maven/`. A `confluent` or `apicurio` registry 
that requires a login is not supported yet.
+`https://packages.confluent.io/maven/`. To log in to a `confluent` or 
`apicurio` registry, set `schemaRegistryUsername`
+and `schemaRegistryPassword` (basic auth), or 
`schemaRegistryOauthTokenEndpoint`, `schemaRegistryOauthClientId`,
+`schemaRegistryOauthClientSecret` and, if needed, `schemaRegistryOauthScope` 
(OAuth2). `azure` and `aws-glue` log in with
+the credentials of the environment.
 
 [source,yaml,subs='+attributes,macros']
 ----
diff --git a/kamelets/kafka-batch-source.kamelet.yaml 
b/kamelets/kafka-batch-source.kamelet.yaml
index 4b741979c..3bfa3c06b 100644
--- a/kamelets/kafka-batch-source.kamelet.yaml
+++ b/kamelets/kafka-batch-source.kamelet.yaml
@@ -38,7 +38,7 @@ spec:
 
       Output: the body is a List with one entry per record, up to `batchSize`. 
Each entry is a Camel `Exchange` for one record, not a message: a step reads 
the value of the record, as text, with `getMessage().getBody()` on the entry, 
such as `${body[0].getMessage().getBody()}`. With `schemaRegistryVendor`, each 
value is read with its schema from the registry and is JSON text, such as 
`{"id": 7, "item": "camel"}` for an Avro record; a record without a value (a 
tombstone) gives an entry wi [...]
 
-      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS. To save the position in Kafka only once a 
batch was handled, set `allowManualCommit` to true and `autoCommitEnable` to 
false, and end the flow with `kafka-batch-manual-commit-action`. A new consumer 
group starts at the newest records, unless `autoOffsetReset` is `earliest`. 
Without `consumerGroup`, every start uses a new group, so the records sent 
while the integration was stopped [...]
+      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS. To save the position in Kafka only once a 
batch was handled, set `allowManualCommit` to true and `autoCommitEnable` to 
false, and end the flow with `kafka-batch-manual-commit-action`. A new consumer 
group starts at the newest records, unless `autoOffsetReset` is `earliest`. 
Without `consumerGroup`, every start uses a new group, so the records sent 
while the integration was stopped [...]
     required:
       - topic
       - bootstrapServers
@@ -86,7 +86,7 @@ spec:
           - urn:camel:group:credentials
       oauthTokenEndpointUri:
         title: OAuth Token URL
-        description: "The URL of the OAuth 2.0 provider where the Kamelet gets 
its access token. Required when `saslAuthType` is `OAUTH`."
+        description: "The URL of the OAuth 2.0 provider where the Kamelet gets 
its access token. Required when `saslAuthType` is `OAUTH`. The URL must also be 
listed in the JVM system property 
`org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the integration fails to 
start."
         type: string
         example: "https://auth.example.com/oauth2/token";
       oauthScope:
@@ -206,6 +206,41 @@ spec:
         type: string
         enum: ["avro", "json"]
         default: avro
+      schemaRegistryUsername:
+        title: Schema Registry Username
+        description: "The username to log in to a `confluent` or `apicurio` 
schema registry, with `schemaRegistryPassword`. For Confluent Cloud, the API 
key of the Schema Registry."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryPassword:
+        title: Schema Registry Password
+        description: "The password of `schemaRegistryUsername`. For Confluent 
Cloud, the API secret of the Schema Registry."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthTokenEndpoint:
+        title: Schema Registry OAuth Token Endpoint
+        description: "The token endpoint of the OAuth2 server, to log in to a 
`confluent` or `apicurio` schema registry with client credentials, such as the 
token endpoint of a Keycloak realm. The URL must also be listed in the JVM 
system property `org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the 
integration fails to start."
+        type: string
+        example: 
"http://keycloak:8080/realms/registry/protocol/openid-connect/token";
+      schemaRegistryOauthClientId:
+        title: Schema Registry OAuth Client ID
+        description: "The OAuth2 client id, to log in to a `confluent` or 
`apicurio` schema registry with client credentials."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthClientSecret:
+        title: Schema Registry OAuth Client Secret
+        description: "The OAuth2 client secret of 
`schemaRegistryOauthClientId`."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthScope:
+        title: Schema Registry OAuth Scope
+        description: "The OAuth2 scope to ask for when logging in to the 
schema registry with client credentials (optional)."
+        type: string
   dataTypes:
     out:
       headers:
@@ -261,6 +296,12 @@ spec:
         schemaFormat: "{{schemaFormat}}"
         schemaRegistryURL: "{{?schemaRegistryUrl}}"
         schemaRegistryVendor: "{{?schemaRegistryVendor}}"
+        schemaRegistryUsername: "{{?schemaRegistryUsername}}"
+        schemaRegistryPassword: "RAW({{?schemaRegistryPassword}})"
+        schemaRegistryOauthTokenEndpoint: 
"{{?schemaRegistryOauthTokenEndpoint}}"
+        schemaRegistryOauthClientId: "{{?schemaRegistryOauthClientId}}"
+        schemaRegistryOauthClientSecret: 
"RAW({{?schemaRegistryOauthClientSecret}})"
+        schemaRegistryOauthScope: "{{?schemaRegistryOauthScope}}"
         sslKeyPassword: "RAW({{?sslKeyPassword}})"
         sslKeystoreLocation: "{{?sslKeystoreLocation}}"
         sslKeystorePassword: "RAW({{?sslKeystorePassword}})"
diff --git a/kamelets/kafka-sink.kamelet.yaml b/kamelets/kafka-sink.kamelet.yaml
index 7b0860cf0..b28ffe49f 100644
--- a/kamelets/kafka-sink.kamelet.yaml
+++ b/kamelets/kafka-sink.kamelet.yaml
@@ -40,7 +40,7 @@ spec:
 
       Output: the message is unchanged.
 
-      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS, as a local Kafka expects. A managed Kafka 
service needs one of the other types. With `schemaRegistryVendor`, the 
integration needs the serde jars of the vendor, which Camel JBang downloads by 
itself; for `confluent` add the Confluent Maven repository, as in `camel run 
--repos=confluent`. With `aws-glue` and `azure`, the serde logs in with the 
credentials of the environment the int [...]
+      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS, as a local Kafka expects. A managed Kafka 
service needs one of the other types. With `schemaRegistryVendor`, the 
integration needs the serde jars of the vendor, which Camel JBang downloads by 
itself; for `confluent` add the Confluent Maven repository, as in `camel run 
--repos=confluent`. With `aws-glue` and `azure`, the serde logs in with the 
credentials of the environment the int [...]
     required:
       - topic
       - bootstrapServers
@@ -88,7 +88,7 @@ spec:
           - urn:camel:group:credentials
       oauthTokenEndpointUri:
         title: OAuth Token Endpoint
-        description: OAuth token endpoint URI. Required when saslAuthType is 
OAUTH.
+        description: "OAuth token endpoint URI. Required when saslAuthType is 
OAUTH. The URL must also be listed in the JVM system property 
`org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the integration fails to 
start."
         type: string
       oauthScope:
         title: OAuth Scope
@@ -151,6 +151,41 @@ spec:
         type: string
         enum: ["avro", "json"]
         default: avro
+      schemaRegistryUsername:
+        title: Schema Registry Username
+        description: "The username to log in to a `confluent` or `apicurio` 
schema registry, with `schemaRegistryPassword`. For Confluent Cloud, the API 
key of the Schema Registry."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryPassword:
+        title: Schema Registry Password
+        description: "The password of `schemaRegistryUsername`. For Confluent 
Cloud, the API secret of the Schema Registry."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthTokenEndpoint:
+        title: Schema Registry OAuth Token Endpoint
+        description: "The token endpoint of the OAuth2 server, to log in to a 
`confluent` or `apicurio` schema registry with client credentials, such as the 
token endpoint of a Keycloak realm. The URL must also be listed in the JVM 
system property `org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the 
integration fails to start."
+        type: string
+        example: 
"http://keycloak:8080/realms/registry/protocol/openid-connect/token";
+      schemaRegistryOauthClientId:
+        title: Schema Registry OAuth Client ID
+        description: "The OAuth2 client id, to log in to a `confluent` or 
`apicurio` schema registry with client credentials."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthClientSecret:
+        title: Schema Registry OAuth Client Secret
+        description: "The OAuth2 client secret of 
`schemaRegistryOauthClientId`."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthScope:
+        title: Schema Registry OAuth Scope
+        description: "The OAuth2 scope to ask for when logging in to the 
schema registry with client credentials (optional)."
+        type: string
   dependencies:
     - "camel:jackson3"
     - "camel:kafka"
@@ -247,6 +282,12 @@ spec:
               schemaFormat: "{{schemaFormat}}"
               schemaRegistryURL: "{{?schemaRegistryUrl}}"
               schemaRegistryVendor: "{{?schemaRegistryVendor}}"
+              schemaRegistryUsername: "{{?schemaRegistryUsername}}"
+              schemaRegistryPassword: "RAW({{?schemaRegistryPassword}})"
+              schemaRegistryOauthTokenEndpoint: 
"{{?schemaRegistryOauthTokenEndpoint}}"
+              schemaRegistryOauthClientId: "{{?schemaRegistryOauthClientId}}"
+              schemaRegistryOauthClientSecret: 
"RAW({{?schemaRegistryOauthClientSecret}})"
+              schemaRegistryOauthScope: "{{?schemaRegistryOauthScope}}"
               sslKeyPassword: "RAW({{?sslKeyPassword}})"
               sslKeystoreLocation: "{{?sslKeystoreLocation}}"
               sslKeystorePassword: "RAW({{?sslKeystorePassword}})"
diff --git a/kamelets/kafka-source.kamelet.yaml 
b/kamelets/kafka-source.kamelet.yaml
index 3ff7959ca..44d09cb07 100644
--- a/kamelets/kafka-source.kamelet.yaml
+++ b/kamelets/kafka-source.kamelet.yaml
@@ -38,7 +38,7 @@ spec:
 
       Output: the body is the value of the record, as text. With 
`schemaRegistryVendor`, the value is read with its schema from the registry and 
the body is JSON text, such as `{"id": 7, "item": "camel"}` for an Avro record. 
A record without a value (a tombstone) gives a message with no body. The 
`kafka-topic`, `kafka-key`, `kafka-partition`, `kafka-offset` and 
`kafka-timestamp` (in milliseconds since 1970) headers say where the record 
came from. They are also set as `ce-kafkatopic`, `ce [...]
 
-      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS. A new consumer group starts at the newest 
records, unless `autoOffsetReset` is `earliest`. Without `consumerGroup`, every 
start uses a new group, so the records sent while the integration was stopped 
are skipped. With `schemaRegistryVendor`, the integration needs the serde jars 
of the vendor, which Camel JBang downloads by itself; for `confluent` add the 
Confluent Maven repository [...]
+      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS. A new consumer group starts at the newest 
records, unless `autoOffsetReset` is `earliest`. Without `consumerGroup`, every 
start uses a new group, so the records sent while the integration was stopped 
are skipped. With `schemaRegistryVendor`, the integration needs the serde jars 
of the vendor, which Camel JBang downloads by itself; for `confluent` add the 
Confluent Maven repository [...]
     required:
       - topic
       - bootstrapServers
@@ -86,7 +86,7 @@ spec:
           - urn:camel:group:credentials
       oauthTokenEndpointUri:
         title: OAuth Token URL
-        description: "The URL of the OAuth 2.0 provider where the Kamelet gets 
its access token. Required when `saslAuthType` is `OAUTH`."
+        description: "The URL of the OAuth 2.0 provider where the Kamelet gets 
its access token. Required when `saslAuthType` is `OAUTH`. The URL must also be 
listed in the JVM system property 
`org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the integration fails to 
start."
         type: string
         example: "https://auth.example.com/oauth2/token";
       oauthScope:
@@ -186,6 +186,41 @@ spec:
         type: string
         enum: ["avro", "json"]
         default: avro
+      schemaRegistryUsername:
+        title: Schema Registry Username
+        description: "The username to log in to a `confluent` or `apicurio` 
schema registry, with `schemaRegistryPassword`. For Confluent Cloud, the API 
key of the Schema Registry."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryPassword:
+        title: Schema Registry Password
+        description: "The password of `schemaRegistryUsername`. For Confluent 
Cloud, the API secret of the Schema Registry."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthTokenEndpoint:
+        title: Schema Registry OAuth Token Endpoint
+        description: "The token endpoint of the OAuth2 server, to log in to a 
`confluent` or `apicurio` schema registry with client credentials, such as the 
token endpoint of a Keycloak realm. The URL must also be listed in the JVM 
system property `org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the 
integration fails to start."
+        type: string
+        example: 
"http://keycloak:8080/realms/registry/protocol/openid-connect/token";
+      schemaRegistryOauthClientId:
+        title: Schema Registry OAuth Client ID
+        description: "The OAuth2 client id, to log in to a `confluent` or 
`apicurio` schema registry with client credentials."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthClientSecret:
+        title: Schema Registry OAuth Client Secret
+        description: "The OAuth2 client secret of 
`schemaRegistryOauthClientId`."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthScope:
+        title: Schema Registry OAuth Scope
+        description: "The OAuth2 scope to ask for when logging in to the 
schema registry with client credentials (optional)."
+        type: string
   dataTypes:
     out:
       headers:
@@ -261,6 +296,12 @@ spec:
         schemaFormat: "{{schemaFormat}}"
         schemaRegistryURL: "{{?schemaRegistryUrl}}"
         schemaRegistryVendor: "{{?schemaRegistryVendor}}"
+        schemaRegistryUsername: "{{?schemaRegistryUsername}}"
+        schemaRegistryPassword: "RAW({{?schemaRegistryPassword}})"
+        schemaRegistryOauthTokenEndpoint: 
"{{?schemaRegistryOauthTokenEndpoint}}"
+        schemaRegistryOauthClientId: "{{?schemaRegistryOauthClientId}}"
+        schemaRegistryOauthClientSecret: 
"RAW({{?schemaRegistryOauthClientSecret}})"
+        schemaRegistryOauthScope: "{{?schemaRegistryOauthScope}}"
         sslKeyPassword: "RAW({{?sslKeyPassword}})"
         sslKeystoreLocation: "{{?sslKeystoreLocation}}"
         sslKeystorePassword: "RAW({{?sslKeystorePassword}})"
diff --git 
a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json 
b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
index cbecef035..92147c7f6 100644
--- a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
+++ b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
@@ -1315,7 +1315,7 @@
     "supportLevel" : "Stable",
     "title" : "Kafka Batch Source",
     "summary" : "Receives records from one or more topics in Apache Kafka in 
batches, as one message that holds a list of up to `batchSize` records.",
-    "description" : "Receives records from one or more topics in Apache Kafka 
in batches, as one message that holds a list of up to `batchSize` 
records.\n\nUse it to handle many records at once, for example to write them to 
a database in one go, or to save the position in Kafka only once a whole batch 
was handled. To handle one record at a time use `kafka-source`. When the 
records are written with a schema kept in a schema registry, such as Confluent 
Schema Registry, Redpanda or Apicurio [...]
+    "description" : "Receives records from one or more topics in Apache Kafka 
in batches, as one message that holds a list of up to `batchSize` 
records.\n\nUse it to handle many records at once, for example to write them to 
a database in one go, or to save the position in Kafka only once a whole batch 
was handled. To handle one record at a time use `kafka-source`. When the 
records are written with a schema kept in a schema registry, such as Confluent 
Schema Registry, Redpanda or Apicurio [...]
     "group" : "Kafka",
     "namespace" : "Kafka",
     "provider" : "Apache Software Foundation"
@@ -1335,7 +1335,7 @@
     "supportLevel" : "Stable",
     "title" : "Kafka Sink",
     "summary" : "Sends each message as a record to a topic in Apache Kafka, or 
in a Kafka-compatible service such as Amazon MSK, Confluent Cloud or Redpanda.",
-    "description" : "Sends each message as a record to a topic in Apache 
Kafka, or in a Kafka-compatible service such as Amazon MSK, Confluent Cloud or 
Redpanda.\n\nUse it to publish events or data for other applications to read, 
such as orders, sensor readings or changes from a database. To write the 
records with a schema kept in a schema registry, such as Confluent Schema 
Registry, Redpanda or Apicurio Registry, set `schemaRegistryVendor`.\n\nInput: 
the body becomes the value of the re [...]
+    "description" : "Sends each message as a record to a topic in Apache 
Kafka, or in a Kafka-compatible service such as Amazon MSK, Confluent Cloud or 
Redpanda.\n\nUse it to publish events or data for other applications to read, 
such as orders, sensor readings or changes from a database. To write the 
records with a schema kept in a schema registry, such as Confluent Schema 
Registry, Redpanda or Apicurio Registry, set `schemaRegistryVendor`.\n\nInput: 
the body becomes the value of the re [...]
     "group" : "Kafka",
     "namespace" : "Kafka",
     "provider" : "Apache Software Foundation"
@@ -1345,7 +1345,7 @@
     "supportLevel" : "Stable",
     "title" : "Kafka Source",
     "summary" : "Receives each record from one or more topics in Apache Kafka, 
or in a Kafka-compatible service such as Amazon MSK, Confluent Cloud or 
Redpanda.",
-    "description" : "Receives each record from one or more topics in Apache 
Kafka, or in a Kafka-compatible service such as Amazon MSK, Confluent Cloud or 
Redpanda.\n\nUse it to react to events or data that other applications publish, 
such as orders, sensor readings or changes from a database. To get many records 
in one message use `kafka-batch-source`. When the records are written with a 
schema kept in a schema registry, such as Confluent Schema Registry, Redpanda 
or Apicurio Registry,  [...]
+    "description" : "Receives each record from one or more topics in Apache 
Kafka, or in a Kafka-compatible service such as Amazon MSK, Confluent Cloud or 
Redpanda.\n\nUse it to react to events or data that other applications publish, 
such as orders, sensor readings or changes from a database. To get many records 
in one message use `kafka-batch-source`. When the records are written with a 
schema kept in a schema registry, such as Confluent Schema Registry, Redpanda 
or Apicurio Registry,  [...]
     "group" : "Kafka",
     "namespace" : "Kafka",
     "provider" : "Apache Software Foundation"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/kafka-batch-source.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/kafka-batch-source.kamelet.yaml
index 4b741979c..3bfa3c06b 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/kafka-batch-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/kafka-batch-source.kamelet.yaml
@@ -38,7 +38,7 @@ spec:
 
       Output: the body is a List with one entry per record, up to `batchSize`. 
Each entry is a Camel `Exchange` for one record, not a message: a step reads 
the value of the record, as text, with `getMessage().getBody()` on the entry, 
such as `${body[0].getMessage().getBody()}`. With `schemaRegistryVendor`, each 
value is read with its schema from the registry and is JSON text, such as 
`{"id": 7, "item": "camel"}` for an Avro record; a record without a value (a 
tombstone) gives an entry wi [...]
 
-      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS. To save the position in Kafka only once a 
batch was handled, set `allowManualCommit` to true and `autoCommitEnable` to 
false, and end the flow with `kafka-batch-manual-commit-action`. A new consumer 
group starts at the newest records, unless `autoOffsetReset` is `earliest`. 
Without `consumerGroup`, every start uses a new group, so the records sent 
while the integration was stopped [...]
+      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS. To save the position in Kafka only once a 
batch was handled, set `allowManualCommit` to true and `autoCommitEnable` to 
false, and end the flow with `kafka-batch-manual-commit-action`. A new consumer 
group starts at the newest records, unless `autoOffsetReset` is `earliest`. 
Without `consumerGroup`, every start uses a new group, so the records sent 
while the integration was stopped [...]
     required:
       - topic
       - bootstrapServers
@@ -86,7 +86,7 @@ spec:
           - urn:camel:group:credentials
       oauthTokenEndpointUri:
         title: OAuth Token URL
-        description: "The URL of the OAuth 2.0 provider where the Kamelet gets 
its access token. Required when `saslAuthType` is `OAUTH`."
+        description: "The URL of the OAuth 2.0 provider where the Kamelet gets 
its access token. Required when `saslAuthType` is `OAUTH`. The URL must also be 
listed in the JVM system property 
`org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the integration fails to 
start."
         type: string
         example: "https://auth.example.com/oauth2/token";
       oauthScope:
@@ -206,6 +206,41 @@ spec:
         type: string
         enum: ["avro", "json"]
         default: avro
+      schemaRegistryUsername:
+        title: Schema Registry Username
+        description: "The username to log in to a `confluent` or `apicurio` 
schema registry, with `schemaRegistryPassword`. For Confluent Cloud, the API 
key of the Schema Registry."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryPassword:
+        title: Schema Registry Password
+        description: "The password of `schemaRegistryUsername`. For Confluent 
Cloud, the API secret of the Schema Registry."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthTokenEndpoint:
+        title: Schema Registry OAuth Token Endpoint
+        description: "The token endpoint of the OAuth2 server, to log in to a 
`confluent` or `apicurio` schema registry with client credentials, such as the 
token endpoint of a Keycloak realm. The URL must also be listed in the JVM 
system property `org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the 
integration fails to start."
+        type: string
+        example: 
"http://keycloak:8080/realms/registry/protocol/openid-connect/token";
+      schemaRegistryOauthClientId:
+        title: Schema Registry OAuth Client ID
+        description: "The OAuth2 client id, to log in to a `confluent` or 
`apicurio` schema registry with client credentials."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthClientSecret:
+        title: Schema Registry OAuth Client Secret
+        description: "The OAuth2 client secret of 
`schemaRegistryOauthClientId`."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthScope:
+        title: Schema Registry OAuth Scope
+        description: "The OAuth2 scope to ask for when logging in to the 
schema registry with client credentials (optional)."
+        type: string
   dataTypes:
     out:
       headers:
@@ -261,6 +296,12 @@ spec:
         schemaFormat: "{{schemaFormat}}"
         schemaRegistryURL: "{{?schemaRegistryUrl}}"
         schemaRegistryVendor: "{{?schemaRegistryVendor}}"
+        schemaRegistryUsername: "{{?schemaRegistryUsername}}"
+        schemaRegistryPassword: "RAW({{?schemaRegistryPassword}})"
+        schemaRegistryOauthTokenEndpoint: 
"{{?schemaRegistryOauthTokenEndpoint}}"
+        schemaRegistryOauthClientId: "{{?schemaRegistryOauthClientId}}"
+        schemaRegistryOauthClientSecret: 
"RAW({{?schemaRegistryOauthClientSecret}})"
+        schemaRegistryOauthScope: "{{?schemaRegistryOauthScope}}"
         sslKeyPassword: "RAW({{?sslKeyPassword}})"
         sslKeystoreLocation: "{{?sslKeystoreLocation}}"
         sslKeystorePassword: "RAW({{?sslKeystorePassword}})"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/kafka-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/kafka-sink.kamelet.yaml
index 7b0860cf0..b28ffe49f 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/kafka-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/kafka-sink.kamelet.yaml
@@ -40,7 +40,7 @@ spec:
 
       Output: the message is unchanged.
 
-      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS, as a local Kafka expects. A managed Kafka 
service needs one of the other types. With `schemaRegistryVendor`, the 
integration needs the serde jars of the vendor, which Camel JBang downloads by 
itself; for `confluent` add the Confluent Maven repository, as in `camel run 
--repos=confluent`. With `aws-glue` and `azure`, the serde logs in with the 
credentials of the environment the int [...]
+      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS, as a local Kafka expects. A managed Kafka 
service needs one of the other types. With `schemaRegistryVendor`, the 
integration needs the serde jars of the vendor, which Camel JBang downloads by 
itself; for `confluent` add the Confluent Maven repository, as in `camel run 
--repos=confluent`. With `aws-glue` and `azure`, the serde logs in with the 
credentials of the environment the int [...]
     required:
       - topic
       - bootstrapServers
@@ -88,7 +88,7 @@ spec:
           - urn:camel:group:credentials
       oauthTokenEndpointUri:
         title: OAuth Token Endpoint
-        description: OAuth token endpoint URI. Required when saslAuthType is 
OAUTH.
+        description: "OAuth token endpoint URI. Required when saslAuthType is 
OAUTH. The URL must also be listed in the JVM system property 
`org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the integration fails to 
start."
         type: string
       oauthScope:
         title: OAuth Scope
@@ -151,6 +151,41 @@ spec:
         type: string
         enum: ["avro", "json"]
         default: avro
+      schemaRegistryUsername:
+        title: Schema Registry Username
+        description: "The username to log in to a `confluent` or `apicurio` 
schema registry, with `schemaRegistryPassword`. For Confluent Cloud, the API 
key of the Schema Registry."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryPassword:
+        title: Schema Registry Password
+        description: "The password of `schemaRegistryUsername`. For Confluent 
Cloud, the API secret of the Schema Registry."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthTokenEndpoint:
+        title: Schema Registry OAuth Token Endpoint
+        description: "The token endpoint of the OAuth2 server, to log in to a 
`confluent` or `apicurio` schema registry with client credentials, such as the 
token endpoint of a Keycloak realm. The URL must also be listed in the JVM 
system property `org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the 
integration fails to start."
+        type: string
+        example: 
"http://keycloak:8080/realms/registry/protocol/openid-connect/token";
+      schemaRegistryOauthClientId:
+        title: Schema Registry OAuth Client ID
+        description: "The OAuth2 client id, to log in to a `confluent` or 
`apicurio` schema registry with client credentials."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthClientSecret:
+        title: Schema Registry OAuth Client Secret
+        description: "The OAuth2 client secret of 
`schemaRegistryOauthClientId`."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthScope:
+        title: Schema Registry OAuth Scope
+        description: "The OAuth2 scope to ask for when logging in to the 
schema registry with client credentials (optional)."
+        type: string
   dependencies:
     - "camel:jackson3"
     - "camel:kafka"
@@ -247,6 +282,12 @@ spec:
               schemaFormat: "{{schemaFormat}}"
               schemaRegistryURL: "{{?schemaRegistryUrl}}"
               schemaRegistryVendor: "{{?schemaRegistryVendor}}"
+              schemaRegistryUsername: "{{?schemaRegistryUsername}}"
+              schemaRegistryPassword: "RAW({{?schemaRegistryPassword}})"
+              schemaRegistryOauthTokenEndpoint: 
"{{?schemaRegistryOauthTokenEndpoint}}"
+              schemaRegistryOauthClientId: "{{?schemaRegistryOauthClientId}}"
+              schemaRegistryOauthClientSecret: 
"RAW({{?schemaRegistryOauthClientSecret}})"
+              schemaRegistryOauthScope: "{{?schemaRegistryOauthScope}}"
               sslKeyPassword: "RAW({{?sslKeyPassword}})"
               sslKeystoreLocation: "{{?sslKeystoreLocation}}"
               sslKeystorePassword: "RAW({{?sslKeystorePassword}})"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/kafka-source.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/kafka-source.kamelet.yaml
index 3ff7959ca..44d09cb07 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/kafka-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/kafka-source.kamelet.yaml
@@ -38,7 +38,7 @@ spec:
 
       Output: the body is the value of the record, as text. With 
`schemaRegistryVendor`, the value is read with its schema from the registry and 
the body is JSON text, such as `{"id": 7, "item": "camel"}` for an Avro record. 
A record without a value (a tombstone) gives a message with no body. The 
`kafka-topic`, `kafka-key`, `kafka-partition`, `kafka-offset` and 
`kafka-timestamp` (in milliseconds since 1970) headers say where the record 
came from. They are also set as `ce-kafkatopic`, `ce [...]
 
-      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS. A new consumer group starts at the newest 
records, unless `autoOffsetReset` is `earliest`. Without `consumerGroup`, every 
start uses a new group, so the records sent while the integration was stopped 
are skipped. With `schemaRegistryVendor`, the integration needs the serde jars 
of the vendor, which Camel JBang downloads by itself; for `confluent` add the 
Confluent Maven repository [...]
+      Good to know: `saslAuthType` has no default and must be set; `NONE` 
connects with no login and no TLS. A new consumer group starts at the newest 
records, unless `autoOffsetReset` is `earliest`. Without `consumerGroup`, every 
start uses a new group, so the records sent while the integration was stopped 
are skipped. With `schemaRegistryVendor`, the integration needs the serde jars 
of the vendor, which Camel JBang downloads by itself; for `confluent` add the 
Confluent Maven repository [...]
     required:
       - topic
       - bootstrapServers
@@ -86,7 +86,7 @@ spec:
           - urn:camel:group:credentials
       oauthTokenEndpointUri:
         title: OAuth Token URL
-        description: "The URL of the OAuth 2.0 provider where the Kamelet gets 
its access token. Required when `saslAuthType` is `OAUTH`."
+        description: "The URL of the OAuth 2.0 provider where the Kamelet gets 
its access token. Required when `saslAuthType` is `OAUTH`. The URL must also be 
listed in the JVM system property 
`org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the integration fails to 
start."
         type: string
         example: "https://auth.example.com/oauth2/token";
       oauthScope:
@@ -186,6 +186,41 @@ spec:
         type: string
         enum: ["avro", "json"]
         default: avro
+      schemaRegistryUsername:
+        title: Schema Registry Username
+        description: "The username to log in to a `confluent` or `apicurio` 
schema registry, with `schemaRegistryPassword`. For Confluent Cloud, the API 
key of the Schema Registry."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryPassword:
+        title: Schema Registry Password
+        description: "The password of `schemaRegistryUsername`. For Confluent 
Cloud, the API secret of the Schema Registry."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthTokenEndpoint:
+        title: Schema Registry OAuth Token Endpoint
+        description: "The token endpoint of the OAuth2 server, to log in to a 
`confluent` or `apicurio` schema registry with client credentials, such as the 
token endpoint of a Keycloak realm. The URL must also be listed in the JVM 
system property `org.apache.kafka.sasl.oauthbearer.allowed.urls`, or the 
integration fails to start."
+        type: string
+        example: 
"http://keycloak:8080/realms/registry/protocol/openid-connect/token";
+      schemaRegistryOauthClientId:
+        title: Schema Registry OAuth Client ID
+        description: "The OAuth2 client id, to log in to a `confluent` or 
`apicurio` schema registry with client credentials."
+        type: string
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthClientSecret:
+        title: Schema Registry OAuth Client Secret
+        description: "The OAuth2 client secret of 
`schemaRegistryOauthClientId`."
+        type: string
+        format: password
+        x-descriptors:
+          - urn:camel:group:credentials
+      schemaRegistryOauthScope:
+        title: Schema Registry OAuth Scope
+        description: "The OAuth2 scope to ask for when logging in to the 
schema registry with client credentials (optional)."
+        type: string
   dataTypes:
     out:
       headers:
@@ -261,6 +296,12 @@ spec:
         schemaFormat: "{{schemaFormat}}"
         schemaRegistryURL: "{{?schemaRegistryUrl}}"
         schemaRegistryVendor: "{{?schemaRegistryVendor}}"
+        schemaRegistryUsername: "{{?schemaRegistryUsername}}"
+        schemaRegistryPassword: "RAW({{?schemaRegistryPassword}})"
+        schemaRegistryOauthTokenEndpoint: 
"{{?schemaRegistryOauthTokenEndpoint}}"
+        schemaRegistryOauthClientId: "{{?schemaRegistryOauthClientId}}"
+        schemaRegistryOauthClientSecret: 
"RAW({{?schemaRegistryOauthClientSecret}})"
+        schemaRegistryOauthScope: "{{?schemaRegistryOauthScope}}"
         sslKeyPassword: "RAW({{?sslKeyPassword}})"
         sslKeystoreLocation: "{{?sslKeystoreLocation}}"
         sslKeystorePassword: "RAW({{?sslKeystorePassword}})"
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-schema-registry-login-route.citrus.it.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-schema-registry-login-route.citrus.it.yaml
new file mode 100644
index 000000000..2f24a4988
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-schema-registry-login-route.citrus.it.yaml
@@ -0,0 +1,63 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+name: kafka-schema-registry-login-route-test
+variables:
+  - name: "kafka.topic"
+    value: "registry-login"
+actions:
+  - testcontainers:
+      start:
+        redpanda: {}
+
+  # The Confluent serde jars are in the Confluent Maven repository
+  - camel:
+      cli:
+        run:
+          args:
+            - "--repos=confluent"
+          integration:
+            file: "kafka/kafka-schema-registry-login-route.yaml"
+            systemProperties:
+              properties:
+                - name: kafka.topic
+                  value: "${kafka.topic}"
+                - name: kafka.bootstrapServers
+                  value: "${CITRUS_TESTCONTAINERS_REDPANDA_BOOTSTRAP_SERVERS}"
+                - name: kafka.schemaRegistryUrl
+                  value: "http://localhost:${kafka.sink.server.port}";
+
+  # The registry gets the login: basic auth with the username and the whole 
password
+  - http:
+      server: "kafkaSinkServer"
+      receiveRequest:
+        GET:
+          headers:
+            - name: "Authorization"
+              value: "Basic citrus:encodeBase64('registry-key:s3c&r+t=/x')"
+  - http:
+      server: "kafkaSinkServer"
+      sendResponse:
+        response:
+          status: 401
+          reasonPhrase: "Unauthorized"
+          version: "HTTP/1.1"
+          headers:
+            - name: "Content-Type"
+              value: "application/json"
+          body:
+            data: '{"error_code":40101,"message":"Unauthorized"}'
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-schema-registry-login-route.yaml
 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-schema-registry-login-route.yaml
new file mode 100644
index 000000000..3ee105c30
--- /dev/null
+++ 
b/tests/camel-kamelets-itest/src/test/resources/kafka/kafka-schema-registry-login-route.yaml
@@ -0,0 +1,51 @@
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+# kafka-sink logs in to the schema registry with a username and password; the 
test server of KafkaIT stands in
+# for the registry and checks the login
+- route:
+    from:
+      uri: "timer:tick"
+      parameters:
+        period: "1000"
+        repeatCount: 1
+      steps:
+        - setBody:
+            constant: '{"id":1,"item":"camel"}'
+        - setHeader:
+            name: Content-Type
+            constant: application/json
+        - doTry:
+            steps:
+              - to:
+                  uri: "kamelet:kafka-sink"
+                  parameters:
+                    bootstrapServers: '{{kafka.bootstrapServers}}'
+                    saslAuthType: NONE
+                    topic: '{{kafka.topic}}'
+                    schemaRegistryVendor: confluent
+                    schemaRegistryUrl: '{{kafka.schemaRegistryUrl}}'
+                    schemaFormat: json
+                    schemaRegistryUsername: 'registry-key'
+                    # a secret with characters that have a meaning in an 
endpoint address
+                    schemaRegistryPassword: 's3c&r+t=/x'
+            doCatch:
+              - exception:
+                  - "java.lang.Exception"
+                steps:
+                  - log:
+                      message: "Send failed: ${exception.message}"

Reply via email to