Announcement Announcement Module
Collapse
No announcement yet.
Listener interface for the Partitioner? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Listener interface for the Partitioner?

    Hi,

    I am tryig to implement a custom partitioner implementation that splits the data to processed based on the content of a table. One of the filtering criteria is the id of the JobInstance.

    I am trying to retrieve that information and I just can't seem to be able to do it. I tried @BeforeStep for instance.

    Am I missing something? How can I retrieve the jobInstanceId and the name of the job for instance.

  • #2
    Did you try scope="step" and injecting the step execution?

    Comment


    • #3
      injecting the step execution with @BeforeStep you mean? yes.

      Comment


      • #4
        That should work (but I wouldn't bother with the listener - just use late binding to inject it into a setter). Did you forget to register the listener?

        Comment


        • #5
          Originally posted by Dave Syer View Post
          That should work (but I wouldn't bother with the listener - just use late binding to inject it into a setter). Did you forget to register the listener?
          How can I inject the jobInstanceId? Is there a predefined object holding it that I could use.

          If I register the partitioner as a listener it works of course, the idea is to avoid this config by automatically register the pieces of the step if they implement the interface or they have the method (just as you do for writer/reader/processor

          Comment


          • #6
            I don't like marker interfaces (just my opinion, yours may vary), so I would go with dependency injection using late binding. The job instance id is there under stepExecution.jobExecution.jobId.

            Comment


            • #7
              Originally posted by Dave Syer View Post
              I don't like marker interfaces (just my opinion, yours may vary), so I would go with dependency injection using late binding. The job instance id is there under stepExecution.jobExecution.jobId.
              Yep, same opinion. Thanks for the tip, that's what I was missing.

              Comment

              Working...
              X