Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-1129 Refactor MessageChannelTemplate and gateway classes
  3. INT-1301

MessagingTemplate send methods should return void but throw exceptions for timeouts, etc.


    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.0 M7
    • Component/s: Core
    • Labels:


      Currently, MessagingTemplate send methods return the boolean value as returned by the underlying MessageChannel send() method. At the template level, we should actually always throw an Exception for 'false' returns there. Most likely this would be a "timeout" condition (otherwise the underlying channel would already be throwing a runtime Exception that simply propagates).

      If someone has a real need to send and handle a false return for timeouts, they should be working at a lower level, directly with the MessageChannel itself. However, since the MessagingTemplate is used in many places within the framework, such as the MessageHandler implementations, we need to close the gap where a handler implementation (e.g. service-activator or transformer) might silently fail to send a reply Message to its output-channel. By throwing runtime Exceptions we would instead cause those cases to produce a fatal condition for an entire message flow.


        There are no comments yet on this issue.


          • Assignee:
            mark.fisher Mark Fisher
            mark.fisher Mark Fisher
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: