Announcement Announcement Module
No announcement yet.
Using StepExecutionInterceptor and Step Scope Dependencies on Remote Slave Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using StepExecutionInterceptor and Step Scope Dependencies on Remote Slave

    I am implementing a step using Remote Chunking. The remote processor/writer have scope step dependencies and I get the following error with those beans.

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.partitionProcessor': 
    Scope 'step' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; 
    nested exception is java.lang.IllegalStateException: No context holder available for step scope
    I found the StepExecutionInterceptor whose javadocs StepExecutionInterceptor say:
    A {@link ChannelInterceptor} that adds the current {@link StepExecution} (if there is one) as a header to the message. Downstream asynchronous handlers can then take advantage of the step context without needing to be step scoped, which is a problem for handlers executing in another thread because the scope context is not available.
    This sounded like it might be the way to go and I can see the StepExecution in the headers when the message is received by the slave. However I cant see where the StepExecution is used after that point. The only other thing I can see that seems to be of relevance is in RemoteChunkHandlerFactoryBean:

    // TODO: create step context for the processor in case it has
    // scope="step" dependencies
    Does this mean this is not fully implemented or am I missing some piece in the process?