英文:
Register advice globally for each .handle() method in all Integrationflows
问题
有没有一种方法可以这样做:
.handle(Http.outboundGateway(host + url)
.httpMethod(HttpMethod.POST)
.mappedRequestHeaders("contentType", "x-api-key")
.expectedResponseType(String.class), e -> e.advice(expressionEvaluatingRequestHandlerAdvice))
其中这个 advice 是在全局某个地方注册的,这样你就不需要在每次调用中都注册它了。
项目中有很多 HTTP 出站网关需要应用/注册相同的 advice,想知道是否必须为每一个手动进行注册。
英文:
Is there a way to do this:
.handle(Http.outboundGateway(host + url)
.httpMethod(HttpMethod.POST)
.mappedRequestHeaders("contentType", "x-api-key")
.expectedResponseType(String.class), e -> e.advice(expressionEvaluatingRequestHandlerAdvice))
where the advice is registered globally somewhere so you don't have to register it in each call?
There are a lot of http outbound gateways in the project to which I need to apply/register the same advice and was wondering if I have to do it manually for each of them.
答案1
得分: 1
目前没有一个可以(有条件地)应用于多个端点的“全局”建议的概念。
欢迎在GitHub上提出新的功能建议,欢迎贡献。
英文:
No; there is currently no concept of a "global" advice that can be (conditionally) applied to multiple endpoints.
Feel free to open a new feature suggestion on GitHub and contributions are welcome.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论