Scheduling Low-Frequency Jobs in Spring Batch
Trigger a nightly or weekly Spring Batch job with a zone-aware cron expression, unique job parameters and a decider that skips runs when no new data exists.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
Trigger a nightly or weekly Spring Batch job with a zone-aware cron expression, unique job parameters and a decider that skips runs when no new data exists.
Spring Batch is near-real-time at best. See how to schedule frequent, bounded runs with fixedDelay, avoid overlap and know when to switch to streaming.
Design restartable, idempotent steps and set retry, skip and quarantine rules per failure type for reliable Spring Batch recovery.
Add spring-kafka, configure the consumer group, write a @KafkaListener, and handle JSON, offsets and failures with a dead-letter topic.
Kafka brokers cannot filter records, so consumers must. Compare consumer-side checks, Spring Kafka RecordFilterStrategy and Kafka Streams with examples.
csrf().disable() turns off Spring Security CSRF protection. See when it is safe, when it is not, and the Spring Security 6 lambda syntax.
Spring has no CacheableCondition interface. Conditional caching uses the condition and unless attributes of @Cacheable, shown here with examples.
Configure MongoTransactionManager on a replica set and use @Transactional or TransactionTemplate for multi-document ACID transactions in Spring Data MongoDB.
Connect Spring Boot to MongoDB, Redis or Cassandra with Spring Data starters, model data for each store and test with Testcontainers.
The Liquibase changelog is the ordered record of every schema change. Learn how changesets, checksums and DATABASECHANGELOG keep databases in sync.
Set up Liquibase in Spring Boot, write immutable changesets, understand checksums and the changelog tables, and manage environments with contexts and rollback.
Add flyway-core and a database module, place V1__ scripts in db/migration, and Spring Boot applies them at startup. This guide covers properties, baselining and production safety.
Flyway and Liquibase apply versioned schema migrations and track them in a history table. Compare both tools and set them up in Spring Boot.
Spring Boot runs Flyway or Liquibase migrations at startup. See how to set up each, compare them, and apply safe schema changes in production.
Add hand-written methods to a Spring Data JPA repository with a fragment interface and an Impl class, and learn when a custom base repository is justified.
Hook into persist, update, remove and load events with JPA lifecycle callbacks, entity listeners and mapped superclasses, plus the rules that trip people up.
JPA maps one-to-one, one-to-many, many-to-one and many-to-many links with annotations. Learn the owning side, cascades, fetch types and common pitfalls.
They are Spring Data auditing annotations that fill creation and update timestamps automatically. Learn how to enable and use them correctly.
Flyway does not have an @Migration annotation. Migrations are found by file name or by extending BaseJavaMigration. See the naming rules and a Java example.
Emit JSON logs from Spring Boot, ship them to Logstash over TCP or Filebeat, index them in Elasticsearch and explore them in Kibana, with MDC and trace id enrichment.