davsclaus opened a new pull request, #3281:
URL: https://github.com/apache/camel-kamelets/pull/3281
Part of #3279: `kafka-batch-source` can read records through a schema
registry, as `kafka-source` and `kafka-sink` do since #3203.
**Built on #3275**, which rewords the `Output:` paragraph of
`kafka-batch-source` that this PR extends. Merge #3275 first; this PR's own
change is the last commit.
### What changed
- **Options:** `schemaRegistryVendor`, `schemaRegistryUrl`,
`schemaRegistryRegion`, `schemaRegistryName` and `schemaFormat`, the same as
`kafka-source`, with the same text. camel-kafka sets the deserializer and the
registry properties from them (CAMEL-27130), also in batch mode.
- **The value of each entry is JSON text**, as `kafka-source` gives it for
one record:
- with `schemaFormat: json`, the value is marshalled to JSON text;
- with `avro`, the value (a `GenericRecord`, or an Avro string) is turned
into its text;
- a tombstone keeps no body.
The template does this with a `loop` over the entries of the `List`, only
when `schemaRegistryVendor` is set: a `choice` with `precondition: true`, so
without a registry nothing is added to the route.
- **Dependency:** `camel:jackson3`, for the JSON marshalling.
- **Description:** the `Use it to`, `Output:` and `Good to know:` paragraphs
say the same as `kafka-source` about the registry, the serde jars, and the
missing registry login.
### Tests
- **Citrus:** new `kafka-batch-schema-registry-json-route` and
`kafka-batch-schema-registry-avro-route`, against the schema registry of
Redpanda. Each one:
- writes two records with `kafka-sink` and `schemaRegistryVendor:
confluent`;
- reads them back as one batch, with `batchSize: 2`;
- checks that the batch has two entries, that each value is a `String`,
and the values themselves;
- checks that the schema is in the registry.
- **Results:** `KafkaIT` 7 of 8 pass, with both new tests among the passing
ones. The one failure is `kafka-source-route-test`, which this PR does not
change: it is flaky because it sends its record right after the consumer
subscribes, with `autoOffsetReset: latest`. A separate PR fixes that.
- **Build:** `./mvnw clean install` from the root passes, run twice.
What is left of #3279: `protobuf`, a registry login (it needs a Camel
change), and `apicurio` with `json`.
_Claude Code on behalf of Claus Ibsen_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]