Announcement Announcement Module
No announcement yet.
Use Spring Batch or Spring Integration or both Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Use Spring Batch or Spring Integration or both

    I have following requirements:

    1) For every half-hour check the remote folder using FTP. If file exists, get it to local processing machine.
    2) Load the file contents into database.
    3) After the database is loaded, optionally get additional data and save it in the same database.
    4) Then send each record as a XML message to a Topic.
    5) Update the database with the status as 'MessageSent' and message sent time.

    I am not sure whether I should design this with Spring batch or Spring Integration or use both of them.

    If we can use both, then how do a I launch Spring batch Job from Spring Integration?

    All suggestions are appreciated. TIA.

  • #2
    You could certainly handle all of this is Spring Integration. What you would get from Spring Batch would be some help with the file processing, some quality of service guarantees on restartability of failed processes, and the ability to track the progress and history of processing each file or batch of files as a Job.

    Spring Batch and Spring Integration don't share any features really, but there are quite a lot of real life "end-to-end" use cases where features from both projects are very helpful. This looks like one of them. To help out a bit there is a Spring Batch Integration mini-project at with some concrete implementations of some of these cross over use cases. We would like to develop this project through a community process, so if people use it, it will grow.

    The specific feature you mentioned (triggering a Batch Job with a Message) is one of the features of Spring Batch Integration, for example (JobLaunchingMessageHandler).