2

I'm able to add a dynamic header to a gateway by using:

public interface Gateway {
    @Gateway(requestChannel="myChannel")
    public void send(String message, @Header("dynamicHeaderValue") String dynamicHeader);
}

Alternatively I can add a static header in the xml config:

<si:gateway service-interface="app.MyGateway">
    <si:method name="myMethod" request-channel="myChannel">
        <si:header name="staticHeaderValue" value="FOO" />
    </si:method>
</si:gateway>

Currently my code is as above and the dynamic one is set but not the static. If I remove the dynamic annotations then the static one works but obviously not the dynamic one. How can I get both to work? Is it possible to set static header values with annotations? Correct me if I'm wrong but I don't think it's possible to set dynamic ones from arguments in the config file - see (jira INT-1860)

omnomnom
  • 8,911
  • 4
  • 41
  • 50
James
  • 1,720
  • 5
  • 29
  • 50

1 Answers1

2

If you use XML configuration, remove @Gateway annotation from method - it should work then (both headers should be set).

omnomnom
  • 8,911
  • 4
  • 41
  • 50