Error Handling and Transactions Flashcards

(10 cards)

1
Q

How do you configure retry logic in Spring Batch?

A

By using .faultTolerant().retry(Exception.class).retryLimit(3).

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

How do you configure a step to skip exceptions?

A

Using .skip(Exception.class).skipLimit(5).

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

How do you configure a step to fail on specific exceptions?

A

By using .noSkip(SpecificException.class).

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

What is SkipPolicy?

A

A policy that determines which exceptions should be skipped.

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

What is RetryPolicy?

A

A policy that defines retry logic for transient failures.

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

How can you log failed records in Spring Batch?

A

By implementing a custom SkipListener.

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

What is a RetryTemplate?

A

A Spring utility for handling retries outside of batch steps.

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

How do you configure a retryable writer?

A

By using .faultTolerant().retry(SomeException.class).retryLimit(3).

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

How do you define a custom SkipPolicy?

A

By implementing the SkipPolicy interface.

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

How can you ignore certain exceptions in a step?

A

By using .noRollback(Exception.class).

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