Skip to content

Step Execution Context not available on RepeatInterceptor's open method [BATCH-125] #3450

Closed
@spring-projects-issues

Description

@spring-projects-issues

Andres Bernasconi opened BATCH-125 and commented

The StepExecutionContext is not available to RepeatInterceptor's open method. I created a RepeatInterceptor in order to have a step initialization routine, but I need the step name (or other configuration) and it is not available. This is when setting the repeatInterceptor to the stepOperations RepeatTemplate of the SimpleStepExecutor.

Since my Step only performs one cycle in the stepOperations iterator I thought to put the interceptor in the chunkOperations iterator of the Executor. The problem here is that the Context is emptied by the time it reaches the chunk operations.

(Maybe a bug in CompositeCompletionPolicy.java:126?. It seems that the main context passed as parameter it is not being taken into account, but I am not sure). The fact is that I lose all the properties of the RepeatContext in the chunk operations, and the StepExecutionContext is lost because of that.

Let me know if I there's the need for more info on this.

Regards
AB


Affects: 1.0-m2

Attachments:

Referenced from: commits efc6247

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions