Skip to main content

Kafka Error Handling with Spring Kafka 4.1: DLT, Retry Topics and Poison Pills

What Spring Kafka actually does when your listener throws, measured rather than described: the stock DefaultErrorHandler is ten deliveries zero milliseconds apart and then the record is dropped. Plus the poison pill that stops a partition before any listener exists, the DLT suffix that changed to -dlt so a misconfigured recoverer logs a warning and loses the record, why a dead-lettered poison pill arrives base64-encoded, why kafka_dlt-exception-fqcn is useless for triage, and what @RetryableTopic costs in ordering — with the delivery trace to prove it.

Spring Boot and RabbitMQ: Exchanges, Queues, Bindings and a Working Dead-Letter Queue

All four AMQP exchange types against a real broker, manual acknowledgement, and a dead-letter path that actually works — including the three triggers that fill a DLQ, the one that never does, and the message that vanishes with no error at all. Why publisher-returns and mandatory are two settings in two different places, why basicNack with requeue=true is an infinite loop that never dead-letters and never raises a queue-depth alarm, what x-death.reason tells you that nothing else does, and why changing a queue's TTL is a migration rather than a config edit.

Spring Boot 4.1 and Apache Kafka: Producer, Consumer and Serialisation from Scratch

The on-ramp to Spring Kafka under Boot 4, where three things changed at once: adding spring-kafka no longer gives you auto-configuration, JsonSerializer is now the Jackson 2 one and cannot write an Instant, and the default partitioner is not the formula you would write. A producer, a consumer, serialisation, keys and partitions — with every claim run against a real Kafka broker, including the effective-configuration table showing which durability defaults come from Kafka rather than Spring, and why ConsumerFactory.isAutoCommit() answers true while no consumer auto-commits.

HTTP Client SSRF Mitigation in Spring Boot 4.1: The InetAddressFilter Everyone Will Configure Backwards

Spring Boot 4.1 added InetAddressFilter, a one-bean SSRF control for every auto-configured HTTP client. The release notes call it a way to "block" addresses; the reference documentation says it only allows addresses that match. They are opposite instructions, and acting on the first one produces a service that still leaks internal data and can no longer reach the internet. A working exploit, the allow-versus-block inversion reproduced end to end, why internalAddresses().negate() is not externalAddresses(), how the strength of the filter depends on which HTTP client is on your classpath, and the vararg overload that silently matches nothing.

Securing Spring Boot Microservices: Token Relay, Service-to-Service JWT and mTLS

Four real processes on Spring Boot 4.1.1 and Spring Security 7.1.1, and one uncomfortable finding: by default a resource server accepts any structurally valid, unexpired token from its issuer, including one minted for a completely different service. Relay, client credentials and RFC 8693 token exchange compared by transcript; what Spring Cloud Gateway's TokenRelay actually relays; and why terminating mTLS in a sidecar takes certificate-bound access tokens off the table.

CORS, CSRF and SameSite in Spring Boot 4: The Three Settings Everyone Gets Wrong

A preflight rejected by Spring Security looks exactly like a CORS misconfiguration, a CSRF token that never reached the browser looks exactly like a bad credential, and a cookie the browser silently refused to store looks exactly like a server that forgot to send it. Verified against Spring Boot 4.1.1 and Spring Security 7.1.1: why MVC-layer CORS cannot fix a security-layer rejection, the bean name that decides whether your configuration is read at all, what csrf.spa() actually assigns, and why SameSite=None without Secure is not a weaker cookie but no cookie.

Passkeys and WebAuthn with Spring Security 7: Passwordless Login That Actually Works

Passkeys on Spring Security 7.1 and Spring Boot 4.1: the registration and authentication ceremonies, WebAuthnRelyingPartyOperations, and the one-time-token fallback that solves the bootstrap problem. Every transcript comes from a real run driven by a software authenticator — including the run that shows the signature counter being written on every login and compared against on none, user verification being optional by default, and a request for DIRECT attestation being satisfied by an authenticator that attests to nothing.

Method Security in Spring Security 7: @PreAuthorize, @PostAuthorize and the Proxy Traps

@PreAuthorize is advice on a proxy, and there are three ways a call reaches an annotated method without the check ever running — self-invocation, methods the proxy cannot override, and @PreFilter handed an immutable collection. A verified tour of Spring Security 7.1 method security: the full SpEL reference, filterObject, interceptor ordering against @Transactional, and the tests that catch a check that silently is not there. Every transcript comes from a runnable companion repository.

Spring Authorization Server: Running Your Own OAuth2 / OIDC Provider (Spring Boot 4.1)

Building a real OAuth2 / OIDC provider on Spring Boot 4.1 with Spring Authorization Server 7.1: client registration, PKCE, a custom consent page and token customisation, across an authorization server, a relying party and a resource server. The 7.0 move into Spring Security deleted applyDefaultSecurity and relocated both configuration classes, and it flipped the requireProofKey default from false to true on the server and the client alike — verified by compiling against both versions of the jars. Every transcript comes from a run you can reproduce.