简体   繁体   English

天蓝色服务结构服务之间的回调?

[英]Callbacks between azure service fabric services?

I'm calling a Actor which calls a stateless service. 我要呼叫的Actor会调用无状态服务。

Now I need stateless service to send an acknowledgement back to Actor (callback), once it completes its work. 现在,我需要无状态服务,以便在完成工作后将确认发送回Actor(回调)。

Is there any mechnism to achieve this in service fabric ? 是否有任何机制可以在服务结构中实现这一目标?

You can pass ActorReference to the stateless service and then bind the ActorReference to the actor interface type on the receiving side. 您可以将ActorReference传递给无状态服务,然后 ActorReference 绑定到接收方的actor接口类型。 You can cast the return value of bind method to the actor interface. 您可以将bind方法的返回值强制转换为actor接口。

I think the most common approach to such kind of communication is to use Service Bus Queues and Pub/Sub pattern https://github.com/loekd/ServiceFabric.ServiceBus 我认为,最常见的通信方式是使用服务总线队列和Pub / Sub模式https://github.com/loekd/ServiceFabric.ServiceBus

When u need to send the acknowledgement u just publish this message to the MessageBus and handle it in the Actor(subscriber) 当您需要发送确认时,您只需将此消息发布到MessageBus并在Actor(订阅者)中进行处理

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM