Announcement Announcement Module
No announcement yet.
[Spring Batch Integration] Writing to a channel Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Spring Batch Integration] Writing to a channel

    I am trying to use Spring Batch & Integration in my current project. I have it set up so that when a file arrives on a channel it gets processed via a batch job. I then want the results of the job to be written back to another channel.

    I found ChunkMessageChannelItemWriter but I'm having trouble finding useful examples / docs. Any direction as to where to look for those also would be appreciated.

    Are there any other existing classes in Spring Batch Integration that can be supplied as a writer to a chunk and output items on a channel?


  • #2
    I haven't really understood your use case. The ChunkMessageChannelItemWriter is mainly intended for use in a Remote Chunking pattern (there are samples / integration tests in the project at


    • #3
      What I'm trying to accomplish is something like the following sudo-config where the writer for a chunk just writes items to a integration:channel.

      <bean id="writer" class="????">
         <property name="output-channel" ref="outputChannel"/>
      <batch:job id="processJob" job-repository="jobRepository">
          <batch:step id="parse">
                 <batch:chunk reader="reader" writer="writer" commit-interval="100"/>
      Does a writer which simply writes to a channel already exist? It's also possibly I'm not using spring batch integration correctly.


      • #4
        Just use a gateway - it's a standard Spring Integration feature. From MessagingGatewayIntegrationTests-context.xml:

        <integration:gateway service-interface="org.springframework.batch.item.ItemWriter" id="writer"	default-request-timeout="100" default-request-channel="inputs" />