Spring Batch Fundamentals Flashcards

(20 cards)

1
Q

What is Spring Batch?

A

A lightweight framework for processing large datasets in batch mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main components of a Spring Batch job?

A

Job, Step, ItemReader, ItemProcessor, ItemWriter, JobRepository, JobLauncher

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a JobRepository?

A

A component responsible for storing job execution metadata.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a JobLauncher?

A

It is used to start jobs, typically triggered by an external event.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an ItemReader?

A

It reads input data from a source such as a file, database or message queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does an ItemProcessor do?

A

It transforms or processes data before it is written.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an ItemWriter?

A

It writes processed data to a target, such as a file, database or API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a JobInstance?

A

A uniquely identified execution of a job with a specific set of parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a JobExecution?

A

A single execution attempt of a job instance, storing status and metadata.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a StepExecution?

A

A single execution attempt of a step, storing step-specific metadata.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the default batch metadata schema in Spring Batch?

A

A set of database tables (BATCH_JOB_INSTANCE, BATCH_JOB_EXECUTION, etc.) used to track job execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you initilize Spring Batch’s metadata schema?

A

By setting spring.batch.initilize-schema=always in application.properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What happens if a job is executed with the same parameters?

A

Spring Batch treats it as the same JobInstance and does not re-run it unless it is restartable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does Spring Batch handle job restarts?

A

It resumes from the last successful step execution recorded in the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is an ExecutionContext in Spring Batch?

A

A key-value store that holds data for a job or step execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can you store custom data in ExecutionContext?

A

By using StepExecution.getExecutionContext().put(“key”, “value”).

17
Q

What is JobParametersIncrementer?

A

A strategy to generate unique job parameters for each job execution.

18
Q

What is JobOperator in Spring Batch?

A

A management interface to start, stop, and restart jobs programmatically.

19
Q

How can you programmatically stop a running job?

A

By using JobOperator.stop(jobExecutionId).

20
Q

What is JobExplorer?

A

A read-only interface for retrieving job execution metadata.