Rework kafka-avro example: drop Confluent Schema Registry, fix OOM
The example was broken: CachedSchemaRegistryClient(schemas,
Integer.MAX_VALUE) in both serializer/deserializer caused an OOM
crash on startup regardless of schema registry reachability, real
Avro object creation was commented out (it sent a plain String, not
Avro), the avro-maven-plugin codegen was commented out in the pom,
the schema registry URL was hardcoded, and the README documented two
contradictory setup paths (manual Confluent vs. camel infra run
kafka) - neither worked alone since infra kafka has no schema
registry.
Replace the Confluent client-based serializers with Camel's native
AvroDataFormat, which needs only a plain Kafka broker and no schema
registry at all. This removes the OOM-causing code outright, wires
up real Employee Avro object creation, uncomments and fixes the
avro-maven-plugin codegen, and lets the README document a single,
working setup path via `camel infra run kafka`. Also fixes two
latent bugs found while verifying end-to-end: the KAFKA_RECORD_META
header needed recordMetadata=true to populate, and consumer.group
was defined but never wired into the consumer endpoint.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HseDjsECuZhsCXxxioiD1k
13 files changed