Results 1 to 2 of 2

Thread: Step Scope Dependencies on Remote Slave & StepExecutionInterceptor

  1. #1
    Join Date
    Nov 2009
    Posts
    7

    Question 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.

    Code:
    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:

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

    Thanks
    Last edited by chanley; Dec 8th, 2011 at 08:17 AM.

  2. #2
    Join Date
    Nov 2009
    Posts
    7

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •