Announcement Announcement Module
Collapse
No announcement yet.
Dynamic Job/Step Invocation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic Job/Step Invocation

    Hi,

    I am trying to rewrite existing batch project using java+spring batch.

    In existing project, it uses a database table to wire the jobs. On completion of one job, job can delegate control to a generic module which would check the table and fire additional jobs as defined in the table as subsequent jobs.

    In spring batch I can hardcode these job steps in xml. But then I lose the elasticity and dynamism provided in current solution. Is there a way to fire a specific step dynamically at the end of given step by consulting the database table (or referring anything external to the xml.). In production environment, as part of prod support, its much easier to update the database data than updating the xml due to controls around it.

    Any help?

    I am new to spring-batch so this might be a n00b question. I have tried to do my homework before asking. I have read the documentation, searched forums, and google.. I could not figure it out.

    Thanks,
    Vijay Dharap

  • #2
    I have implemented this kind of behaviour using a Step implementation that just dispatches to one of a catalog of steps using a simple map, e.g. String->Step. The map key in your case would come from an external source like the database you mentioned. It would be nice to see a JIRA for this to be a framework feature, but it's pretty simple to implement as a custom DispatcherStep.

    Comment


    • #3
      Dispatcher Step

      Originally posted by Dave Syer View Post
      I have implemented this kind of behaviour using a Step implementation that just dispatches to one of a catalog of steps using a simple map, e.g. String->Step. The map key in your case would come from an external source like the database you mentioned.
      I currently wrote a decider which would have similar map and would provide a decision to invoke a new step. But I still need to define all the steps in the job. If I want to add a completely new step (which by the way is already mapped in db, may be to a different job), then I still need to modify the xml. So I think, the DispatcherStep that you mentioned would help me there.. But I am not quite sure about the implementation yet..

      Originally posted by Dave Syer View Post
      It would be nice to see a JIRA for this to be a framework feature,
      Let me try to add one.. as soon as I become clear as to what exactly do I need to ask as new feature.

      Originally posted by Dave Syer View Post
      but it's pretty simple to implement as a custom DispatcherStep.
      I am still kind of fuzzy about this Dispatcher"Step". Would it be possible for you to share relevant code snippet?

      Thanks,
      Vijay Dharap

      Comment

      Working...
      X