Announcement Announcement Module
No announcement yet.
Force Exception Handling Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Force Exception Handling

    I'm working on a Spring Integration project that has a data flow that looks (roughly) like this:
    1. Unzip file (custom transformer)
    2. Split list of unzipped files (splitter)
    3. Process file contents (one or more transformers)

    I would like to prevent an exception in step 3 from causing the remainder of the unzipped files to be skipped. I also need to process all of this in a single thread for various reasons (transactions, load balancing, etc.). The only way I've come up with to do this is to use a messaging gateway between step 2 and step 3 that doesn't do anything, but has its error channel set. (I haven't had a chance to test this, but I think it will work.) Is this the best way to accomplish this? Is there an easier way to force Spring Integration to catch an exception and send it to a specified error channel?


  • #2
    The gateway is the correct approach. Think of the gateway as being similar to adding a try{} catch{} block in Java.


    • #3
      Excellent. Thanks for the quick response Gary!