Announcement Announcement Module
No announcement yet.
Spring Batch as a Router? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch as a Router?

    Hi all,

    We are going to use Spring Integration to model a workflow that takes a single input and then calls multiple services in order based on that input (and sometimes based on the output of the previous call).

    For this I would use a Router to co-ordinate the calls out to the other services in order. (something like the RecipientListRouter).

    The problem that I have is that if the system goes down at a time when the router has not finished all of the calls, then the message is lost and some systems will not receive their call.

    As Spring Batch provides resilience out of the box for its batch jobs, and our router could be thought of as sequentially executing series of outgoing calls, I am investigating writing a "SpringBatchRouter" to save us the headache of writing our own resilience.

    I was thinking that the Spring Batch definition could have an execution step that had a channel injected into it (ChannelSendingExecutionStep) and the step just sent the message to that channel and the rest could be handled by SI.

    I would really appreciate any opinions, hints or comments from anyone on this.

    Last edited by elpablo; Feb 2nd, 2010, 09:05 AM.

  • #2
    Spring Batch Integration (, has a MessageOrientedStep that sounds very similar. Lots of other good stuff there as well, but it might be more than you need, unless you already have Batch in your stack.

    An alternative would be to simply use a jms:channel to receive the trigger for your flow, and make the Queue / Message durable. That might be simpler if you already have the middleware. Or wait a bit for the JDBC adapters to hits Spring Integration 2.0.