1
votes

I have used Spring Amqp Outbound Gateway integration to send request to a third party web service. Below shown is my gateway interface.

public interface AccountManagerGateway {

    public RetrieveAccountResponse retrieveAccount(RetrieveAccountRequest request);
}

I need to know how to send custom Message Headers with the gateway call.

Ex:- "AccountID" in the header

I did some google searches but couldn't find a solution. May be I'm doing the search in a wrong context or a wrong direction. I'm expecting your kind support on this.

Please let me know if you need more info. I didn't post my integration-context xml in here because then the post will get lengthy.

Thanks.

1

1 Answers

1
votes

See the documentation about gateways.

For example:

public RetrieveAccountResponse retrieveAccount(RetrieveAccountRequest request,
               @Header("AccountId") String accountId);

By default, user-defined headers are not sent over AMQP so you need to configure the mapped-request-headers on the outbound gateway; something like

mapped-request-headers="STANDARD_REQUEST_HEADERS,AccountId"

Again, refer to the documentation.