Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3069

GatewayProxy does not keep track which method triggered the message flow


    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 3.0 RC1
    • Component/s: Core
    • Labels:


      I want to try and avoid having to manually define each method in a gateway bean. My current setup is:

      gateway --> (a bunch of irrelevant stuff) --> http outbound gw

      Each gateway method is multiplexed to use the same HTTP outbound gw in order to unnecessarily create a bunch of HTTP gateways. To make this happen I need to pass along a URL which is unique per method. The usual way to do this would be to define each method in the XML config, setup a static header (there's no way to create a static header via annotation) and then read that off in the http outbound gateway but that would leave me defining each method which is messy.

      In my interface I want to be able to just say something like:
      HeartBeat getHeartbeat();

      and in a later header enricher read that annotation off. There's only one thing missing: the gateway bean does not keep track which method trigged the message. If I had a

      {"originatingMethodCall": methodInvocation}

      reference then it would be trivial.


      Aside #1: I worked around it by making an aspect and storing what I wanted in a thread-local but that looks an unclean approach
      Aside #2: This would not have been necessary if it were possible to define static headers per method as an annotation.


          Issue Links



              • Assignee:
                grussell Gary Russell
                wwadge Wallace Wadge
              • Votes:
                0 Vote for this issue
                4 Start watching this issue


                • Created: