All releases

v5.1.0

three-formats-one-scenario

Protobuf joins Avro at full parity, and one Java case can now seed a whole multi-topic scenario — with per-record JSON, Avro or Protobuf encoding.

Highlights

  • 01

    Protobuf, at parity with Avro

    A com.google.protobuf.Message value is auto-detected and published through Confluent's KafkaProtobufSerializer against the same mock://wiretap registry; typed reads come back as the generated class (or DynamicMessage with no generated class at all); assertions render payloads as proto3 canonical JSON; and @KafkaSeed(protoMessage = …) publishes the same plain-JSON fixtures Protobuf-encoded — where Avro takes a schema file, Protobuf takes the generated class, which already carries its descriptor.

    Read the guide →
  • 02

    Programmatic multi-topic seeding

    A fixture file seeds one topic. @KafkaSeed(multiSources = …) runs a KafkaSeedSource that builds a whole scenario in Java — Map<topic, List<SeedEvent>> — so a value generated once (an order id, a correlation id) is reused across every topic it appears in. Map keys create their topics if absent and join per-method cleanup, exactly like fixtures.

    Read the guide →
  • 03

    Per-event envelopes, per-record encoding

    Every SeedEvent carries a value, an optional key, and its own headers — different events on one topic can differ. The value type decides the encoding per record: POJO to JSON, Avro record to Avro, Protobuf message to Protobuf, tombstone(key) to a real null-valued record. One source can span all three formats across topics; mixing formats on a single topic is refused.

    Read the guide →
  • 04

    Nothing you did not ask for

    protobuf-java/-util are optional dependencies of wiretap-core, exactly like Avro: a JSON-only or Avro-only suite inherits no protobuf jars, every probe is reflective, and a missing dependency fails with the exact coordinates to add. Bean overrides retarget KafkaProtobuf* factories to the mock registry just as they do KafkaAvro*.

    Read the guide →

Full notes

Added

  • Protobuf support at full parity with Avro: publish auto-detection of com.google.protobuf.Message via Confluent's KafkaProtobufSerializer against the mock registry; typed reads into the generated class (specific.protobuf.value.type) or DynamicMessage; assertions over proto3 canonical JSON (JsonFormat — a protobuf toString() is the text format, not JSON); @KafkaSeed(protoMessage = …) fixture seeding through proto3's JSON mapping (camelCase or snake_case, unknown fields rejected for fixed-field messages); and bean overrides retargeting KafkaProtobuf* serdes. protobuf-java/-util are optional on wiretap-core; kafka-protobuf-serializer is the test-scope encoding dependency.
  • @KafkaSeed(multiSources = …): programmatic KafkaSeedSource classes that seed several topics at once, returning Map<topic, List<SeedEvent>>. The per-file attributes (value/locations/topic/avroSchema/protoMessage/placeholders) are refused on the same annotation — the map keys decide the topics.
  • SeedEvent (immutable of/tombstone/key/header builder with per-event headers and per-record encoding by value type) and KafkaSeedContext (uuid(), now(), today(), binding(name), objectMapper()) — what a source builds records with.

Fixed

  • SeedRecord.isTombstone() now answers honestly for a record carrying an encoded (Avro or Protobuf) value whose JSON node is an unread placeholder.
  • The seeder's producer and serializer closes are isolated from one another, so one close failing can no longer skip the others.