使用Mono Zip识别哪些请求失败时,请在网络上获取请求主体
我正在使用网络电量使用Mono Zip并行调用3个不同的外部API。现在,如果在任何API调用中发生任何错误,我已经通过使用ExchangeFilterFinction的常见异常处理程序对其进行了处理。现在,我想知道哪个特定请求失败(在3个外部API调用中)?有什么办法可以识别出来?我也想附加“输入请求主体”,而我从API呼叫中获得的例外响应。我可以获取API失败的请求主体(在过滤器本身中)吗?
I am using webclient to call 3 different external APIs in parallel using Mono zip. Now, if any error occurs in any of the API call, I have handled it through a common exception handler using ExchangeFilterFunction. Now, I want to know which particular request fails(out of 3 external API calls) ? Is there any way I can identify that? I also want to append the 'input request body' with the exception response I got from the API call. Can I fetch the request body for which the API Fails (in filter itself)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在
ExchangeFilterFunction
中,您可以访问该请求。您可以使用一些标识符“装饰”您的请求,然后使用它来解决客户端。WebClient
的请求属性,然后从请求对象读取它In the
ExchangeFilterFunction
you have access to the request. You could "decorate" your request with some identifier and then use it to resolve the client.WebClient
and then read it from the request object