Questions tagged [zeromq]

5

votes
1

answer
42

Views

Create a group of streamers and publishers

I have a number of nodes that will use a secondary service to be informed about the address of each other. I want to be able to publish information so as all the other nodes can hear it. Using an XPUB socket is not an option I would want to go with here as I want this system to be distributed. What...
dearn44
1

votes
1

answer
514

Views

ZeroMQ Subscribers not receiving message from Publisher over an inproc: transport class

I am fairly new to pyzmq. I am trying to understand inproc: transport class and have created this sample example to play with. It looks a Publisher instance is publishing messages but Subscriber instances are not receiving any. In case I move Subscriber instances into a separate process and change i...
sachin
1

votes
1

answer
648

Views

Accessing NetMQ sockets from multiple threads

Is it safe to access a NetMQ socket from multiple threads, as long as they are not using it simultaneously? For example,is the following scenario OK: Thread A uses a socket. Thread A ends. Thread B uses the same socket. If not, must the sole operating thread be the very same who created the socket?
tearvisus
1

votes
1

answer
942

Views

Using zmq_recv and ZMQ_NOBLOCK versus zmq_poll for one socket

There seem to be two main ways to asynchronously get data from your socket in ZeroMQ: if(zmq_recv(&msg, ZMQ_NOBLOCK) == 0) { // could return EAGAIN or others // do stuff } ...and... if(zmq_poll(&pollItems[0], num, timeout)) { if(zmq_poll(&msg) == 0) { // do stuff } } If I only have one socket that I...
AberrantWolf
1

votes
1

answer
340

Views

Storing tags along with stream data to a file in gnuradio

I am trying to store tags along with the stream data to a file in gnuradio. While zeroMQ blocks can be used to transfer the stream data along with the tags to a socket, I am unable to use it to store the tags to a file. Is there another way to serialize the stream along with the tags ? or another b...
Saravana Manickam
1

votes
1

answer
727

Views

Sending serialized Mat object to another computer using zeromq in C++

Hello I am trying to send a mat object to another computer using zeromq and boost. this is my serialization.h file #include #include #include #include #include #include BOOST_SERIALIZATION_SPLIT_FREE(cv::Mat) namespace boost { namespace serialization { /*** Mat ***/ template void save(Archive...
Anar Bayramov
1

votes
1

answer
306

Views

Is it possible to improve this zmq architecture?

Intro: In the below architecture, there are three key components. Users - Machines where user application is running. Applications - which are running inside the remote server. Gateway/Broker - Required for isolation between user devices and server applications. Message flow between user device and...
Kumar
1

votes
2

answer
1.1k

Views

When I should use zmq_msg_t?

The functions for sending and receiving messages as follows: int zmq_send (void *socket, void *buf, size_t len, int flags); int zmq_recv (void *socket, void *buf, size_t len, int flags); However, from documentation it's not clear when I have to use zmq_msg_t or my custom data directly. So in which c...
Pablo
1

votes
2

answer
632

Views

NetMQ why is “SendReady” needed for Req-Rep?

I have a problem that I managed to fix... However I'm a little concerned as I don't really understand why the solution worked; I am using NetMQ, and specifically a NetMQ poller which has a number of sockets, one of which is a REQ-REP pair. I have a queue of requests which get dequeued into requests,...
Squanchy
1

votes
1

answer
229

Views

Cannot reuse an endpoint after NetMQ socket disposal

In my application I am creating and disposing NetMQ sockets. I have noticed that I cannot bind to an endpoint for some time after the disposal of the previous socket bound to that endpoint. A minimal example: const string endpoint = 'tcp://127.0.0.1:1234'; using (var publisher = new PublisherSocket(...
tearvisus
1

votes
1

answer
225

Views

ZeroMQ (clrzmq4) polling issue

What I'm trying to accomplish is to implement reading a message from one of two sockets, wherever it arrives first. As far as I understand polling (zmq_poll) is the right thing to do (as demonstrated in mspoller in guide). Here I'll provide small pseudo-code snippet: TimeSpan timeout = TimeSpan.From...
Aleksandar Pesic
1

votes
1

answer
645

Views

ZeroMQ on Linux environment

On official ZMQ website, there are references to Windows/Linux sources, and Windows installer (that contains binary .dll/.lib files). I am able to use the Windows DLL, but cannot find the option to download binary files (.so) for Linux. Where are the binaries available (without compiling on Linux ma...
Yoav
1

votes
1

answer
56

Views

Is messaging library asynchronous while it is imported into C application?

Is ZeroMQ or RabbitMQ asynchronous, even when it is utilized in C programming?
Prem
1

votes
1

answer
952

Views

Getting started with JeroMQ in MATLAB

I am trying to use JeroMQ from MATLAB,by implementing this example ( How to use jeromq in MATLAB ): % Author : Dheepak Krishnamurthy % License : BSD 3 Clause import org.zeromq.ZMQ; ctx = zmq.Ctx(); socket = ctx.createSocket(ZMQ.REP); socket.bind('tcp://127.0.0.1:7575'); message = socket.recv(0); jso...
Dan
1

votes
1

answer
140

Views

OCaml Bytes to Bigarray

I have a C program that has in memory an array of double or an array of int. The C program sends the corresponding binary data using ZeroMQ to an OCaml program. The OCaml program receives some bytes, and now I want to transform these bytes into an Array of int or an Array of float. How can I do this...
Anthony Scemama
1

votes
2

answer
645

Views

netMQ 4.0 multithreading

I have some problems with multi-threaded server based on netMQ 4.0. I tried to use http://zguide.zeromq.org/cs:mtserver, but there is no context on netMQ 4.0. I tried: for (var i = 0; i < workerCount; ++i) { new Thread(() => Worker(connStr.Value)).Start(); } //... private void Worker(string connSt...
krabcore
1

votes
0

answer
5

Views

Erlang with ZeroMQ in Windows

Is it possible to use Erlang with ZeroMQ in Windows? I need to make rep/req client. I tried all bindings for Erlang on site: zeromq.org but nothing works. I only could run pair client/server at Chumak binding. But I need rep/req. When I try to run req/rep client ans server I got this: req_client...
Sergey
1

votes
1

answer
74

Views

Can ZMQ publish and read in the same thread?

I've been trying to publish some data, using a ZMQ_PUB socket and then read it in the same thread, using ZMQ_SUB. But it looks like it's dropping the data before read. Is there a way to do this using ZMQ?
ATL
1

votes
2

answer
302

Views

ZeroMQ request and multiple async replies to this request

I have something like remote machine that performs heavy computations and a client machine that sends tasks to it. Output results are very big from megabytes to gigabytes and come in chunks during long time period. So it looks like this: client sends task and then needs to receive this chunks since...
Paul
1

votes
2

answer
1.2k

Views

ijavascript will not install

I have been trying to run Javascript from a Jupyter Notebook on Windows 10 but failed miserably. It seems I cannot install IJavascript to make it available. All installation guides say to use Anaconda for IJavascript - so I did, but I CANNOT FIND IJAVASCRIPT anywhere within Anaconda, only the js pac...
ryuuzako
1

votes
2

answer
73

Views

ZeroMQ 2 REQ/REP to allow nested talk

I want the following to happen: There is a main_socket, where anyone can talk to. Clients will send 'READ' and wait for 'OK' from Server before doing so. Clients will send 'WRITE', when they get a 'OK', then it will mean they can do a write action. Everyone should wait for this. So I thought anothe...
PascalVKooten
1

votes
3

answer
765

Views

REQ/REP & DEALER/ROUTER for two-way asynchronous worker processing

I'm learning ZeroMQ and just went through the tutorial and a few examples. I'm using Node.js as my main environment ( with Python eventually used to replace my workers ). Trying to sort out how I can create a fully asynchronous messaging system that will allow my API to push tasks ( via a REQ socket...
ddibiase
1

votes
1

answer
51

Views

Python ZMQ transmitting message garbled

My server in python: import time import zmq context = zmq.Context() socket = context.socket( zmq.REP ) socket.bind( 'tcp://*:5555' ) while True: # Wait for next request from client message = socket.recv() print( 'Received request: %s' % message ) # Do some 'work' time.sleep( 1 ) # Send reply bac...
Zixuan Zhang
1

votes
1

answer
351

Views

ZMQ subscriber does not receive message from remote server after long interval

The following pubsub php works normally when the both php are running in the same server. However, it does not work when they are running in the different servers. (local)client.php (local)server.php (with sleeptime 300)
zono
1

votes
1

answer
280

Views

How to use zmq inside a function (in a non-blocking manner) to obtain the function's state when requested by a client?

How to use ZMQ in a non-blocking manner to 'serve' the status of a long running job when the status is requested by a client? The below code illustrates how the long running task could be temporarily 'interrupted' to send the current status. The task is long running because there are many urls to pr...
Greg
1

votes
2

answer
260

Views

What's the max of topics I can have on ZeroMQ?

I'm new to ZeroMQ ( I've been using SQS so far ). I would like to build a system where every time a user logs in, they subscribe to a queue. The all the users subscribed to this queue are interested only in messages directed to them. I read about topic matching. It seems that I could create a patte...
user313551
1

votes
2

answer
549

Views

ZeroMQ (cppzmq) subscriber skips first message

I'm trying to use ZMQ with the CPPZMQ C++ wrapper, as it seems it is the one suggested in C++ Bindings. The client/server (REQ/REP) seems to work fine. When trying to implement a publish/subscribe pair of programs, it looks like the first message is lost in the subscriber. Why? publisher.cpp: #inclu...
fferri
1

votes
1

answer
57

Views

ZeroMQ Choosing Correct Client-Worker Model for a Call Center

I have a project that needs to be written in Perl so I've chosen ZeroMQ. There is a single client program, generating work for a variable number of workers. The workers are real human operators who will complete a task then request a new task. The job of the client program is keep all available work...
andyabel
1

votes
2

answer
264

Views

ZeroMQ blocked in a context.term() call. Why? How to prevent?

I have a java program that using ZeroMQ. But I found the program blocked in context.term(); if receiving a message( recvMsg() ) time out! ZMQ.Context context = ZMQ.context(1); ZMQ.Socket socket = context.socket(ZMQ.REQ); socket.connect(mAddress); ZMsg ZM = new ZMsg(); ZM.add(qString); Z...
jones321
1

votes
1

answer
835

Views

How to send a ZMQ message using a reference?

In the ZMQ_REQ/ZMQ_REP example a buffer is initialized and then the message is copied into it using memcpy. Specifically: zmq::message_t reply (5); memcpy (reply.data (), 'World', 5); socket.send (reply); How to reply to the message using a char pointer reference? That is, something along the lines...
Greg
1

votes
1

answer
483

Views

How does ZeroMQ queue and send queued messages?

I am the author of an R package (clustermq0) that distributes function calls on HPC schedulers using using the ZeroMQ bindings (rzmq). I have used a simple combination of REQ/REP sockets, with the workers requesting first the common data for all tasks (the function to call and constant arguments), a...
Michael Schubert
1

votes
1

answer
202

Views

ZeroMQ dealer socket doesn't work under Elixir (using Erlang's chumak)

I want to communicate between Elixir and Python. I don't want to use NIFs and stuff - I prefer loosely coupled using zeroMQ as this will allow me to use other languages than Python later. I am using the chumak library which is a native implementation of zeromq in Erlang, and seems well maintained. I...
Thomas Browne
1

votes
2

answer
151

Views

Dilemma of setting a timeout in ZeroMQ

I currently use ZeroMQ with Java binding. My program is in a PUB/SUB mode. It seems reasonable to set a timeout, while a client can't receive a message from PUB-side. But for the publish server, who sends messages without a fixed frequency, it's hard to decide a reasonable timeout. On the other han...
jones321
1

votes
1

answer
443

Views

What is the correct way to configure target_link_libraries in CMakeList when using multiple libraries? Getting Cannot specify link libraries error

I am working on a project which uses the fast-cpp-csv-parser and date libraries and want to add zmq (0mq) however cannot get CMakeList to work. The following is a working CMakeList.txt: cmake_minimum_required(VERSION 3.7) project(sample_project) set(CMAKE_CXX_STANDARD 14) set(SOURCE_FILES source/mai...
Greg
1

votes
2

answer
136

Views

MQ - How to guarantee message delivery in a non-transacted, lightweight environment?

How to guarantee message delivery in a non-transacted, lightweight environment? For example: Normal situation: Write to database, commit, send message to ZeroMQ|Redis|OtherMQ, consumer pulls the message to continue processing... 0,05% situation: Write to database, commit, application dies!, no messa...
dbdbdbdb
1

votes
2

answer
224

Views

ZMQ socket is not thread-safe, but can I use zmq_send() and zmq_recv() in different threads?

I know ZMQ is not thread-safe. But I want use one thread receive data:zmq_poll() wait data come, then use zmq_recv() receive data; use another thread send data: zmq_send() I want to know is this a right way to use ZMQ? In fact I have try it. The program core dump when call zmq_poll() once, but it on...
Roger.Kang
1

votes
1

answer
439

Views

How to detect a network was broken down with ZeroMQ monitor mechanism?

A. Description I am using ZeroMQ monitor and I find that it works when logic disconnection but does not work when network broken down (unplug my cable). For example: I launch client app on an android pad, then launch a server app on my windows laptop. They are connected through a router with cables....
Eric Jia
1

votes
1

answer
166

Views

Multiple publisher in ZeroMQ C++ Is this a good choice or not?

I am new to ZeroMQ. I want to create multiple publishers, where each publisher is publishing specific data, such as following: Publisher 1: Publishing image data Publisher 2: Publishing audio data Publisher 3: Publishing text data Basically, my requirement is to publish the data from multiple publis...
Ravi Joshi
1

votes
2

answer
429

Views

Confusion about synchronous socket in ZeroMQ

This may appear as a silly question, but I am really confused about the terminology of the ZeroMQ regarding synchronous sockets like REQ and REP. By my understanding a synchronous communication occurs when a client sends a message an then it blocks, until the response arrives. If ZeroMQ implemented...
Renato Sanhueza
1

votes
2

answer
950

Views

ZMQ DEALER - ROUTER Communication

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...
bgarcial

View additional questions