Skip to content

GatewayProxy does not keep track which method triggered the message flow [INT-3069] #7026

Closed
@spring-operator

Description

@spring-operator

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:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions