rrezartprebreza/spring-boot-skills / skills/spring-boot-3/spring-batch
spring-batch
VerifiedUse when building batch jobs, ETL pipelines, scheduled imports/exports, or any chunk-oriented bulk processing with Spring Batch. Covers the Spring Batch 5 / Boot 3 builder API, restartability and idempotent job parameters, reader/writer thread-safety, fault tolerance, and chunk transaction boundaries.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.5 KB |
| agents/openai.yaml | config | 185 B |
| examples/bad-batch-config.java | other | 2.0 KB |
| examples/good-batch-config.java | other | 2.7 KB |
| templates/ChunkJobConfig.java | other | 2.4 KB |
| templates/JobScheduler.java | other | 1.5 KB |
templates/JobScheduler.java
View on GitHub// Copy-paste starting point for triggering a Spring Batch job on a schedule.
// Pair with application.yml:
// spring.batch.job.enabled: false # don't auto-run jobs on startup
// spring.batch.jdbc.initialize-schema: never # manage BATCH_* tables via Flyway in prod
//
// The default JobLauncher is SYNCHRONOUS — run(...) blocks until the job finishes.
// Inject an async TaskExecutor-backed launcher if you need fire-and-forget.
@Component
@RequiredArgsConstructor
@Slf4j
public class JobScheduler {
private final JobLauncher jobLauncher;
private final Job exampleJob;
@Scheduled(cron = "0 0 2 * * *") // 02:00 daily
public void run() {
JobParameters params = new JobParametersBuilder()
.addString("status", "COMPLETED") // identifying — part of the JobInstance key
.addLong("run.id", System.currentTimeMillis()) // identifying + unique — forces a fresh instance
// .addString("requestId", id, false) // non-identifying — logged, not part of the key
.toJobParameters();
try {
JobExecution execution = jobLauncher.run(exampleJob, params);
log.info("Job {} finished with status {}", exampleJob.getName(), execution.getStatus());
} catch (JobExecutionException e) {
// JobInstanceAlreadyCompleteException, JobRestartException, etc.
log.error("Failed to launch {}", exampleJob.getName(), e);
}
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |