zeromq

Is this the right way to use a messaging queue?

我的梦境 提交于 2019-12-18 03:12:15
问题 I am new to messaging queues, and right now I am using ZeroMQ on my Linux server. I am using PHP to write both the client and the server. This is mainly used for processing push notifications. I am using the basic REQ-REP Formal-Communication Pattern on single I/O-threaded ZMQContext instances, as they have demonstrated. Here is the minimised zeromqServer.php code: include("someFile.php"); $context = new ZMQContext(1); // Socket to talk to clients $responder = new ZMQSocket($context, ZMQ:

ZeroMQ/ZMQ Push/Pull pattern usefulness

被刻印的时光 ゝ 提交于 2019-12-17 21:50:23
问题 In experimenting with the ZeroMQ Push/Pull (what they call Pipeline ) socket type, I'm having difficulty understanding the utility of this pattern. It's billed as a "load-balancer". Given a single server sending tasks to a number of workers, Push/Pull will evenly hand out the tasks between all the clients. 3 clients and 30 tasks, each client gets 10 tasks: client1 gets tasks 1, 4, 7,... client2, 2, 5,... and so on. Fair enough. Literally. However, in practice there is often a non-homogeneous

zeromq: how to prevent infinite wait?

别说谁变了你拦得住时间么 提交于 2019-12-17 21:26:51
问题 I just got started with ZMQ. I am designing an app whose workflow is: one of many clients (who have random PULL addresses) PUSH a request to a server at 5555 the server is forever waiting for client PUSHes. When one comes, a worker process is spawned for that particular request. Yes, worker processes can exist concurrently. When that process completes it's task, it PUSHes the result to the client. I assume that the PUSH/PULL architecture is suited for this. Please correct me on this. But how

ZMQ DEALER - ROUTER Communication

南笙酒味 提交于 2019-12-17 20:29:32
问题 I am currently working on a project that requires some communication over the network of a different data types from some entities of a distributed system and I am using ZMQ. The main goal of the project is to have a central node which services clients which can connect at any time. For each client connected, the central node should manage the message communication between the two. Currently, and by the moment, all communication is happening over TCP. The clients need to send and receive

Why doesn't zeromq work on localhost?

一曲冷凌霜 提交于 2019-12-17 08:28:34
问题 This code works great: import zmq, json, time def main(): context = zmq.Context() subscriber = context.socket(zmq.SUB) subscriber.bind("ipc://test") subscriber.setsockopt(zmq.SUBSCRIBE, '') while True: print subscriber.recv() def main(): context = zmq.Context() publisher = context.socket(zmq.PUB) publisher.connect("ipc://test") while True: publisher.send( "hello world" ) time.sleep( 1 ) But this code doesn't * work: import zmq, json, time def recv(): context = zmq.Context() subscriber =

Java-分布式系统---消息中间件

柔情痞子 提交于 2019-12-16 19:10:10
简介 消息中间件也可以称消息队列,是指用高效可靠的消息传递机制进行与平台无关的数据交流,并基于数据通信来进行分布式系统的集成。通过提供消息传递和消息队列模型,可以在分布式环境下扩展进程的通信。当下主流的消息中间件有RabbitMQ、Kafka、ActiveMQ、RocketMQ等。其能在不同平台之间进行通信,常用来屏蔽各种平台协议之间的特性,实现应用程序之间的协同。其优点在于能够在客户端和服务器之间进行同步和异步的连接,并且在任何时刻都可以将消息进行传送和转发。是分布式系统中非常重要的组件,主要用来解决应用耦合、异步通信、流量削峰等问题 消息中间件的作用 消息中间件几大主要作用如下: 解耦 降低工程间的强依赖程度,针对异构系统进行适配。在项目启动之初来预测将来项目会碰到什么需求,是极其困难的。通过消息系统在处理过程中间插入了一个隐含的、基于数据的接口层,两边的处理过程都要实现这一接口,当应用发生变化时,可以独立的扩展或修改两边的处理过程,只要确保它们遵守同样的接口约束。 冗余(存储) 有些情况下,处理数据的过程会失败。除非数据被持久化,否则将造成丢失。消息队列把数据进行持久化直到它们已经被完全处理,通过这一方式规避了数据丢失风险。许多消息队列所采用的”插入-获取-删除”范式中,在把一个消息从队列中删除之前,需要你的处理系统明确的指出该消息已经被处理完毕

.NET平台常用的框架整理

五迷三道 提交于 2019-12-16 15:51:18
.NET平台常用的框架整理 分布式缓存框架: Microsoft Velocity:微软自家分布式缓存服务框架。 Memcahed:一套分布式的高速缓存系统,目前被许多网站使用以提升网站的访问速度。 Redis:是一个高性能的KV数据库。 它的出现很大程度补偿了Memcached在某些方面的不足。 EnyimMemcached:访问Memcached最优秀的.NET客户端,集成不错的分布式均衡算法。 开源的.NET系统推荐: OXITE:微软ASP.NET MVC案例演示框架。 PetShop:微软ASP.NET宠物商店。 Orchard:国外一个MVC开源的博客系统。 SSCLI:微软在NET Framework 2.0时代的开源代码。 DasBlog:国外一个基于ASP.NET的博客系统。 BlogEngine.NET:国外一款免费开源的博客系统。 Dotnetnuke.NET:一套非常优秀的基于ASP.NET的开源门户网站程序。 Discuz.NET:国内开源的论坛社区系统。 nopCommerce和Aspxcommerce:国外一套高质量的开源B2C网站系统。 JumboTCMS和DTCMS:国内两款开源的网站管理系统: 日志记录异常处理: Log4Net.dll:轻量级的免费开源.NET日志记录框架。 Enterprise Library Log Application

Kafka、RabbitMQ、RocketMQ、ActiveMQ

心已入冬 提交于 2019-12-15 05:27:06
一、资料文档 Kafka:中。有kafka作者自己写的书,网上资料也有一些。rabbitmq:多。有一些不错的书,网上资料多。zeromq:少。没有专门写zeromq的书,网上的资料多是一些代码的实现和简单介绍。rocketmq:少。没有专门写rocketmq的书,网上的资料良莠不齐,官方文档很简洁,但是对技术细节没有过多的描述。activemq:多。没有专门写activemq的书,网上资料多。 二、开发语言 Kafka:Scala rabbitmq:Erlang zeromq:c rocketmq:java activemq:java 三、支持的协议 Kafka:自己定义的一套…(基于TCP) rabbitmq:AMQP zeromq:TCP、UDP rocketmq:自己定义的一套… activemq:OpenWire、STOMP、REST、XMPP、AMQP 四、消息存储 Kafka:内存、磁盘、数据库。支持大量堆积。 kafka的最小存储单元是分区,一个topic包含多个分区,kafka创建主题时,这些分区会被分配在多个服务器上,通常一个broker一台服务器。分区首领会均匀地分布在不同的服务器上,分区副本也会均匀的分布在不同的服务器上,确保负载均衡和高可用性,当新的broker加入集群的时候,部分副本会被移动到新的broker上。根据配置文件中的目录清单

How to Push data from C# to ZeroMQ and Pull from Node.JS or vice-versa?

陌路散爱 提交于 2019-12-14 03:44:03
问题 Scenario : I am trying to send a data (say String type) from C# сonsole application to Node.JS server through ZeroMQ. Information: Using clrzmq for c# and ZeroMQ libs for C# and Node.JS respectively I am able to perform push-pull from Node.JS, also push - pull from C#. So, one thing is confirmed that ZeroMQ - The Intelligent Transport Layer is installed on the machine (Windows 7 64-bit) Issue : I am not able to push data from C# Console app to Node.JS app (even tried vice-versa), both are on

Middleware to build data-gathering and monitoring for a distributed system [closed]

∥☆過路亽.° 提交于 2019-12-14 03:39:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 months ago . I am currently looking for a good middleware to build a solution to for a monitoring and maintenance system. We are tasked with the challenge to monitor, gather data from and maintain a distributed system consisting of up to 10,000 individual nodes. The system is clustered into groups of 5-20 nodes. Each group