将接收到的消息从发送者获取到特定控制器:ASP.NET Core Web API 中的 MassTransit
我对 Masstransit 和rabbitMq 很陌生,我想在两个 Web API 之间建立通信。
目标:如果服务 A
收到做出某些操作的请求,但它需要来自另一个服务 B
的一些附加信息,我想要使用 Masstransit 和 RabbitMq 之间的两个服务之间的连接,但我想在服务 A 中的特定控制器(请求信息的 API)中的操作方法中获取服务 B 的返回结果。
我已经创建了 Masstransit 和 RabbitMq 的集成,但我正在消费者中获取消息,并且我希望在等待服务 B 响应的操作方法中获得该结果。
如果有任何示例或任何提示可以调整解决方案或任何可能有帮助的事情将非常感谢
谢谢
I am quite new in Masstransit and rabbitMq and I want to establish a communication between two Web APIs.
The goal: if the service A
receive a request to make something but the it needs some additional information from another service B
, I want to make this connection between the two services using Masstransit and RabbitMq, but I want to get the returned result from the service B in the action method in the specific controller in service A (the API that requested the information).
I already created the integration of Masstransit and RabbitMq, but I am getting the message in the consumer and I want get that result in the action method that is waiting for the response from the service B.
If there are any examples or any hint to adapt the solution or anything may help that would very appreciated
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用请求客户端生成请求并获取响应。 API 控制器中的示例显示在 范围过滤器示例,以及许多其他 MassTransit 示例。
Use the request client to generate a request, and get the response. An example in an API controller is shown in the scoped filter sample, along with many other of the MassTransit samples.