[英]Sending Message Headers with Spring AMQP outbound gateway
I have used Spring Amqp Outbound Gateway integration to send request to a third party web service. 我已经使用Spring Amqp出站网关集成来将请求发送到第三方Web服务。 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.
我没有在这里发布集成上下文xml,因为这样发布的时间会很长。
Thanks. 谢谢。
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; 默认情况下,用户定义的标头不是通过AMQP发送的,因此您需要在出站网关上配置被
mapped-request-headers
。 something like 就像是
mapped-request-headers="STANDARD_REQUEST_HEADERS,AccountId"
Again, refer to the documentation . 同样,请参阅文档 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.