logo
down
shadow

ZeroMQ mutliple publishers and subscribers using XPUB/XSUB - is this a correct implementation?


ZeroMQ mutliple publishers and subscribers using XPUB/XSUB - is this a correct implementation?

By : hao wanghao
Date : November 21 2020, 04:03 PM
Any of those help I raised an issue on ZeroMQ github page and got a response. It is a known bug in ZeroMQ that is caused due to the fact that publish and subscribe are happening in different threads that are raising subscription requests before the receivers of the subscription messages are fully ready. More details can be found here.
https://github.com/zeromq/libzmq/issues/897
code :


Share : facebook icon twitter icon
how to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ(jzmq) 3.xx

how to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ(jzmq) 3.xx


By : Sighery
Date : March 29 2020, 07:55 AM
will help you Wow I'm answering my own question. I missed to add a forwarder from publisherX to subscriberX. Here is the missing code. Now XSUB and XPUB are able to send and get data.
public class XSender extends Thread implements Runnable {
code :
public class XSender extends Thread implements Runnable {

private static final String TAG = null;
private Socket publisherX;
private Context ctx;
private Socket subscriberX;

public XSender(ZMQ.Context ctx, ZMQ.Socket subscriberX,
        ZMQ.Socket publisherX) {
    this.ctx = ctx;
    this.subscriberX = subscriberX;
    this.publisherX = publisherX;

}

@Override
public void run() {
    super.run();
    while (true) {
        // Read envelope with address
        Log.d(TAG, "XListener loop started..");

        String msg = new String(subscriberX.recv(0));
        Log.v(TAG, "Listener Received: " +"MSG :"+msg);
        publisherX.send(msg.getBytes(), 0);         

    }


}
How to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ(C++)?

How to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ(C++)?


By : Aishath Hudha
Date : March 29 2020, 07:55 AM
it helps some times I am a newcomer to zeromq. Recently I did some tests on pub/sub of zeromq, and I don't konw how to implement Pub-Sub Network with a Proxy by using XPUB and XSUB in ZeroMQ. Hope your help, thank you very much . , Proxy:
code :
int main (int argc, char *argv[])
{
zmq::context_t context(1);
zmq::socket_t frontend (context, ZMQ_XSUB);
....//set hwm
frontend.bind("tcp://*:5559");
zmq::socket_t backend (context, ZMQ_XPUB);
....//set hwm
zmq_bind (backend, "tcp://*:5560");
zmq_proxy (frontend, backend, NULL);
return 0;
}
ZeroMQ PUB/XPUB/XSUB/SUB filtering

ZeroMQ PUB/XPUB/XSUB/SUB filtering


By : Egor
Date : March 29 2020, 07:55 AM
Any of those help
If filtering is indeed performed on the publisher side, then is it a problem if a SUB subscribes before a PUB comes online?
ZeroMQ XPub-XSub with PHP: Messages never arrive at proxy

ZeroMQ XPub-XSub with PHP: Messages never arrive at proxy


By : Xelatihy
Date : March 29 2020, 07:55 AM
Any of those help [PROXY] needs to have the topic-filter set too:
$frontend->send( chr(1) + "" ); /* XSUBSCRIBE to { ANY == "" } topic incoming */
ZeroMQ XPUB/XSUB Serious Flaw?

ZeroMQ XPUB/XSUB Serious Flaw?


By : markoware
Date : March 29 2020, 07:55 AM
Does that help I found one workaround here, and that is to use PUSH/PULL on the publisher side, and PUB/SUB on the subscriber side. The new topology looks like this:
code :
#include <zmq.hpp>

int main()
{
    zmq::context_t context(1);

    //Incoming publications come here
    zmq::socket_t sub(context, ZMQ_PULL);
    sub.bind("ipc://subscriber.ipc");

    //Outgoing publications go out through here.
    zmq::socket_t pub(context, ZMQ_PUB);
    pub.bind("ipc://publisher.ipc");

    zmq::proxy(sub, pub, nullptr);

    return 0;
}
#include "zhelpers.hpp"

int main () {
    //  Prepare our context and publisher
    zmq::context_t context(1);
    zmq::socket_t publisher(context, ZMQ_PUSH);
    publisher.connect("ipc://subscriber.ipc");

    s_sendmore (publisher, "B");
    s_send (publisher, "No sleep!");

    return 0;
}
Related Posts Related Posts :
  • Filtering from data
  • Where is the problem about selenium with python?
  • ansible custom filter fails when importing python library
  • How to assign the label of one column to the new one based on group maximum in pandas
  • What is the best approach for isolating a single area of similar colour?
  • Creating multiple clients for topics
  • Why is my 'for loop', despite iterating over all keys, only acting on the last one?
  • Can someone tell me what's wrong, when I run it the browsers says "This site can’t be reached"
  • Error in setting up mitmproxy on alpine 3.9
  • From traditional loop to list comprehension
  • Django celery unregistered task | relative imports
  • How to add elements in a multi dimensional array
  • Async await with sqs receive messages not working properly
  • What is definition of 'NAME' in Python grammar
  • Easy method to move rows from df to another with coditions?
  • Changing the size of only a single plot in matplotlib, without altering figure parameters
  • Fastest way to use Vision API on 10,000+ images with python
  • How to install nvidia apex on Google Colab
  • Random numbers Continuous in python
  • Fetching data after a certain time interval(10 sec) from a continuously increasing database like mysql using flask
  • Using VLOOKUP with merge in Python
  • Calculate geographical distance between 5 cities with all the possible combinations of each city
  • How to filter a pandas dataframe using multiple partial strings?
  • Pygame- make bullet shoot toward cursor direction
  • Create SEQUENCE based dictionary from list
  • How to fix broken link from Django MEDIA_ROOT?
  • How can I display the current time left in a timer in a label?
  • Compute number of occurance of each value and Sum another column in Pandas
  • How to separate the prefix in words that are 'di'?
  • Handling network errors from an external API across an application
  • Want a pandas Series of Trips Completed to count(Request) ratio for each hour as index for the given dataframe
  • Access dict keys and list elements by same index to loop over and assign values
  • Find rows from the same dataframe based on condition
  • Read only specific part first two lines from text file in python
  • Python How to convert string to dataframe?
  • How to fix this my error code program? I use Python 3.6
  • Is there a way of getting this string down to 3 words?
  • Large difference between overall F Score for a custom Spacy NER model and Individual Entity F Score
  • Drop rows where timestamps are older than subsequent row
  • Implement a bottle spin
  • Unable to convert widows epoch time to normal date time
  • Values from a XML file
  • PyAudio readframes not ending when wav file completes
  • Could not load the module
  • How to change datetime.datetime(2012, 1, 1, 0, 0) to 1/1/2012 in Python?
  • How to create ASN.1 Sequence without NamedType?
  • How to locate specific sequences of words in a sentence efficiently
  • How can I generate a multi-step process in Django without changing pages (w/out a new request)?
  • Why does this list comprehension only "sometimes" work?
  • send html report with row collapsed
  • How to define a type hint to a argument (the argument's value is a class, all expected value is a subclass of a certain
  • How do I send a styled pandas DataFrame by e-mail without losing the format?
  • How to view/average a groupby dataframe when the data is a string?
  • Django 2.2 staticfiles do not work in development
  • Flag to enable/disable numba JIT compilation?
  • Trying to split byte in a byte array into two nibbles
  • Error in Query - missing FROM-clause entry for table - SQL
  • Reading double c structures of Dll with Ctypes in Python
  • Autofill missing row in database based on missing time range
  • Get the max of a nested dictionary
  • shadow
    Privacy Policy - Terms - Contact Us © festivalmusicasacra.org