WCF 消息传递本地和互联网

发布于 2024-11-15 22:06:36 字数 480 浏览 3 评论 0原文

我有以下场景:

有一个主服务,它以轮询方式读取其他数据服务和/或数据库。当新作业可用时,它指示“从属”服务创建一个新进程(不是线程!)来处理该特定作业,并存储新进程的标识符。然后,如果出现有关该作业的新命令,它必须向该特定进程发送消息(队列?)。
更复杂的是,“从属”服务可能与主服务位于同一台服务器上,也可能不在同一台服务器上,并且创建的进程与创建它的从属服务位于同一台服务器上。
我正在寻找与主进程进行通信(单工与回复)的最佳方式。

  • 如果我必须通过从属程序将消息发送到进程,这是可以接受的。
  • 如果我必须使用与远程进程相同的方法来访问本地进程,那就更好了

我首选的工具是 WCF,但我没有使用过比 WsDualHttpBinding 更复杂的工具...
我有什么选择?可靠的会话?消息队列?
什么绑定? NetTcpBinding、NetMsmqBinding、NamedPipes?

I have the following scenario:

There is a master service, which reads other data services and/or a database in a polling fashion. When a new job becomes available it instructs a "slaver" service to create a new process (not thread!) to work on that particular job, and stores the new process' identifier. Then, if new command regarding that job comes up, it has to send a message (queue?) to that particular process.
To make it more complicated, the "slaver" service may or may not be on the same server as the master service, and the created processes are on the same server as the slaver that created it.
I'm looking for the best way to communicate (simplex with reply) with the processes from the master.

  • It is acceptable if I have to send the messages to the processes via the slaver.
  • It is preferrable if I have to use the same method to reach the local process as the remote process

My preferred tool is WCF, but I haven't used anything more complicated than WsDualHttpBinding...
What are my options? Reliable session? Message Queue?
What binding? NetTcpBinding, NetMsmqBinding, NamedPipes?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千柳 2024-11-22 22:06:36

我将使每个启动的进程公开一个使用 NetNamedPipeBinding (不允许离机交互)公开的“进程控制”WCF 服务。然后通过其本地从属服务来控制其中每一个。这意味着无论进程是本地还是远程,您都拥有通用的通信模型,并且您拥有 WCF 方面的标准通信技术

I would make each of the launched processes expose a "process control" WCF service exposed using NetNamedPipeBinding (which does not allow off-machine interaction). Then control each of these via it's local Slaver service. This means you have your common model for communication whether the processes are local or remote and you have a standard communication technology in terms of WCF

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文