How do you integrate Spring Boot with Kafka for messaging?
Add spring-kafka, configure the broker in application.properties, send with KafkaTemplate and receive with @KafkaListener, with JSON, error handling and production tips.
2,882 posts about Java: questions with answers, tutorials and articles, newest first.
Add spring-kafka, configure the broker in application.properties, send with KafkaTemplate and receive with @KafkaListener, with JSON, error handling and production tips.
MessageListenerAdapter wraps a POJO method as a Redis Pub/Sub subscriber. Register it on a RedisMessageListenerContainer to receive messages in Spring Boot.
Publish with StringRedisTemplate and subscribe with a MessageListener registered in a RedisMessageListenerContainer, plus the limits of pub/sub versus Streams.
Configure Redis key expiration in Spring Boot with RedisTemplate and per-cache TTLs, and understand how it differs from maxmemory eviction policies.
RedisTemplate is the Spring Data Redis class for reading and writing Redis data. This guide covers Boot setup, serializers and common operations.
Cache Spring Boot data in Redis with @Cacheable, @CachePut and @CacheEvict, set TTLs and serializers, and avoid self-invocation and stale data.
Automate SQL Server full backups and restores from Spring Boot with JdbcTemplate and @Scheduled, with checks for permissions, safety and production use.
Measure with Query Store, add covering indexes, fetch fewer columns, fix N+1 queries and enable JDBC batching to speed up SQL Server in Spring Boot.
Connect Spring Boot to SQL Server with SQL logins, Windows or Kerberos authentication, or an Entra ID managed identity, and keep the credentials secure.
Add the mssql-jdbc driver and JPA starter, set the datasource URL and let Spring Boot auto-configure HikariCP and Hibernate for SQL Server.
Configure delivery limits, dead-letter bad messages with a reason, read the DLQ sub-queue and resubmit messages from Spring Boot.
Route messages in Azure Service Bus with SQL and correlation filters on topic subscriptions, with Spring Boot code for rules, sender and receiver.
Publish to and consume from an Azure Service Bus queue in Spring Boot with the Java SDK, managed identity, explicit message settlement and dead-lettering.
Use the Spring Cloud Azure Service Bus starter with passwordless authentication, a sender client to publish and a processor listener to consume queue messages.
Consume an HTTP-triggered Azure Function from Spring Boot using WebClient, typed responses, error mapping, timeouts and safe retries.
Call an Azure Function from Spring Boot with RestClient or WebClient, secure it with a function key, add timeouts and retries, or use a queue trigger.
Run Spring Boot logic on Azure Functions with Spring Cloud Function: define function beans, add a FunctionInvoker handler, run locally and deploy with Maven.
Declare an @Aspect bean, select methods with pointcuts and apply advice. Includes logging and timing examples and the limits of proxy-based AOP.
Choose a partition key, annotate it with @PartitionKey and pass it on reads and deletes using CosmosRepository and CosmosTemplate in Spring Boot.
Define a RUNTIME annotation, then give it behaviour with a Spring AOP aspect, a meta-annotation or a Jakarta Bean Validation constraint, with working Spring Boot 3 code.