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

  • Step Scope Dependencies on Remote Slave & StepExecutionInterceptor

    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 is in RemoteChunkHandlerFacotoryBean:

    // 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?

    Last edited by chanley; Dec 8th, 2011, 09:17 AM.

  • #2
    Is there any plans for a new version of spring-batch-integration to complete the missing implementation mentioned above?

    At the moment you cannot use remote chunking for processors that need step scope dependencies.

    From the comments in the class, the RemoteChunkHandlerFactoryBean is not fully implemented.