title: How can I get jobId in ItemWriter in spring batch
body: <p>Is it possible to get jobId or JobName in ItemWriter in spring batch.</p>
  
  <p>I read about <a href="http://docs.spring.io/spring-batch/reference/html-single/index.html#late-binding" rel="noreferrer">late binding</a> but not sure how to use it to get job name or job id in Item Writer.</p>
  
  <p>I configured my writer as</p>
  
  <pre><code>    &lt;bean id="myWriter" ref="com.eg.man.EodWriter" scope="step"&gt;
       &lt;property name="jobInstanceId" value="#{stepExecution.jobExecution.jobId}"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>but I don't know how to use it in writer class to get value.</p>
  
  <p><strong>Edit</strong> I also found <a href="http://forum.spring.io/forum/spring-projects/batch/77344-job-instance-id-in-writer" rel="noreferrer">this</a> link which say you can get id in Write but again how to use it in writer class</p>