简体   繁体   English

ZeroMQ功能

[英]ZeroMQ capabilities

I am looking for solutions for a scenario. 我正在寻找方案的解决方案。

Let's assume a service-oriented architecture (SOA) with hundreds of services. 让我们假设一个具有数百个服务的面向服务的体系结构(SOA)。 The services are completely isolated – what is behind their APIs is an implementation detail. 这些服务是完全隔离的–它们的API背后是实现细节。

Different services can have different security policies – ie who can access the service. 不同的服务可以具有不同的安全策略,即谁可以访问该服务。 For example, a service can be fully public, accessible to a subset of employees, accessible to a subset of other services, etc. Some services may even have that specified on the API level, for example a public service with some internal API calls (is that a bad idea?). 例如,某项服务可以是完全公共的,一部分雇员可以访问,其他部分服务可以访问,等等。某些服务甚至可能具有在API级别上指定的服务,例如带有一些内部API调用的公共服务(这是个坏主意吗?)。

I have touched a bit on ZMQ but not enough to know if this interconnection of services can be accomplished with ZMQ. 我对ZMQ进行了一些接触,但还不足以知道是否可以使用ZMQ来完成这种服务互连。 Any help to decide on whether to continue concentration on ZMQ or not will be highly appreciated. 非常感谢您对决定是否继续专注于ZMQ的任何帮助。

Are you asking about how to handle security in a SOA? 您是否在询问如何在SOA中处理安全性? Or are you asking whether or not it is feasible to build a SOA with 0MQ? 还是您在问用0MQ构建SOA是否可行?

The former requires you to build it yourself. 前者需要您自己构建。 You need to define your own security policy between services. 您需要在服务之间定义自己的安全策略。 Not really 0MQ's domain. 并不是0MQ的域名。

For the latter, yes, 0MQ should allow you to build a SOA architecture. 对于后者,是的,0MQ应该允许您构建SOA体系结构。 In fact we're doing it right now. 实际上,我们现在正在这样做。 Services are encapsulated into containers with a HTTP endpoint handled by nginx, which then reverse proxies the request to a (one or more) nodejs server within through express, which then PUSH messages to workers' PULL sockets on a fair queue basis. 服务被封装到具有由nginx处理的HTTP终结点的容器中,然后nginx通过express将请求反向代理到一个(一个或多个)nodejs服务器,然后将其按公平队列将消息推送到工作程序的PULL套接字。 Upon finishing processing the request, the worker PUSH its reply back to the server's PULL socket. 处理完请求后,工作程序将其回复推回到服务器的PULL套接字。 This way we can spin up or any number of workers we want with minimal disruption to the server. 这样,我们可以在不中断服务器的情况下启动或增加所需数量的工作人员。 And this is one service. 这是一项服务。

Service to service communications is handled through REST-over-HTTP. 服务到服务的通信是通过HTTP上的REST处理的。

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

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