0

I do have a problem with combining Spring Integration & Batch. I am enriching header in chain with an url and id, then the file is being downloaded from ftp and parsed using batch - that's ok. Problem is that I cannot copy header values in the writer after executing job.

<int:gateway service-interface="org.springframework.batch.item.ItemWriter" id="writer"
                 default-request-timeout="1000" default-request-channel="dataChannel"
                 default-reply-channel="replyChannel">
        <int:method name="write">
            <int:header name="id" expression="headers['id']" />
            <int:header name="url" expression="headers['url']" />
        </int:method>
    </int:gateway>

Also I tried to use jobParameters, but it is not possible to invoke them there..

What should my approach be?

Cœur
  • 37,241
  • 25
  • 195
  • 267
mikey600
  • 19
  • 1
  • 5
  • Usually the problem with job parameters is related to the scope of the reader/writer. See http://stackoverflow.com/questions/6078009/how-to-get-access-to-job-parameters-from-itemreader-in-spring-batch – Evgeni Dimitrov May 27 '16 at 15:58
  • Yes, I understand that concept. But in my case I am using the gateway as an batch:tasklet writer, so I cannot set gateway's scope to 'step'. And I have truly no idea how to to so.. – mikey600 May 29 '16 at 10:43

0 Answers0