Description
Wallace Wadge opened INT-3069 and commented
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:
@WebServiceCall
("http://localhost/whatever")
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.
Thoughts?
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:
-
Declared methods names of the Gateway interface should be also in the header [INT-3081] #7063 Declared methods names of the Gateway interface should be also in the header
("is duplicated by") -
Generalize Parameter Mapping Conventions for the Messaging Gateway [INT-2629] #6603 Generalize Parameter Mapping Conventions for the Messaging Gateway
-
Extend GatewayProxyFactoryBean to allow mapping of method name to Header value and to create a Map of method parameters [INT-882] #4889 Extend GatewayProxyFactoryBean to allow mapping of method name to Header value and to create a Map of method parameters
-
Add top level header expression to gateway [INT-2181] #6167 Add top level header expression to gateway
("supersedes")