
How to Version Event Schemas With Avro and Schema Registry
Version event schemas with Avro and a schema registry in Java: define a schema, set compatibility modes, evolve fields safely, use Spring Kafka.
Everything you need to level up your coding skills.

Version event schemas with Avro and a schema registry in Java: define a schema, set compatibility modes, evolve fields safely, use Spring Kafka.

Write a Kafka consumer that survives restarts, duplicates, poison messages and slow batches, with manual commits, idempotency, retries and a dead letter topic

Add retries and a dead letter topic to a Spring Kafka consumer: DefaultErrorHandler, backoff, DeadLetterPublishingRecoverer and RetryableTopic.

Configure RabbitMQ with Spring AMQP so messages are never lost or stuck: acks, publisher confirms, bounded retries and dead letter queues.

Make POST endpoints safe to retry with an Idempotency-Key header, a unique constraint and a stored response, and know which methods are idempotent already.

Choose synchronous requests or asynchronous messages between Java services based on whether the caller needs an answer now, and design for failure either way.

Handle Kafka consumer rebalances and offset commits in Java: ConsumerRebalanceListener, manual commits, cooperative rebalancing and avoiding duplicates.

Implement distributed locks in Java: why a JVM lock is not enough, Redis and database options, lease expiry, fencing tokens and when to avoid locks entirely.

Implement the saga pattern in Java: choreography versus orchestration, compensating actions, persisted state and failure handling.

Implement event sourcing and CQRS in Java: an event store, aggregates rebuilt from events, projections for reads, snapshots and when the cost is justified.

Do contract testing with Pact in Java: consumer tests that generate a contract, provider verification, the Pact Broker, can-i-deploy and CI workflow.

Build resilient calls in plain Java: bounded timeouts, retries with backoff and jitter, a semaphore bulkhead and how the three combine safely.
We send one email when a new post is published. No spam.