I duplicated Benjy's results (libzmq 4.2.3; master from Github) https://github.com/drbitboy/test_0mq_subscribe_limit
That is, on starting pub_env and sub_env, in either order, sub_env only picks up envelopes 512, 511, and 1023 - N.B. sub_env subscribes to envelopes 24 through 2600, inclusive, but normally does not not receive any envelope above 1023. HOWEVER, I did also stumble onto another odd behavior: if pub_evn and sub_env are running, and I kill pub_env and restart it, then sub_env picks ups 512, 1024, 1536, and 2048, but not 511, 1023, 1535 or 2047. Brian Carcich On Tue, May 14, 2019 at 4:02 AM Bekritsky, Benjamin via zeromq-dev < [email protected]> wrote: > Justin, > > > > Thanks for the guidance, but I set the HWMs to 0 and neither application > crashed. I also played with changing the HWMs to 2048 and am still > encountering the same issue. > > > > I then subscribed to “all” and received the messages from all the topics > (0-1024); > > > > It seems as though it is limiting the number of subscriptions to 1000. If > I subscribed from 20 -1024, I get topics 20 – 1019. > > > > I am using lib 4.2.3 and the publisher and subscriber on the same Ubuntu > box. > > > > Thanks, > > Benjy > > *From:* zeromq-dev <[email protected]> *On Behalf Of *Justin > Karneges > *Sent:* Tuesday, May 14, 2019 7:10 AM > *To:* Jamie Stewart via zeromq-dev <[email protected]> > *Subject:* Re: [zeromq-dev] max PUB/SUB topics > > > > [External Email] > > Hi, > > > > Subscribing sends a message to the publisher. I believe you're hitting the > default high water mark, and subscription messages are getting dropped. > > > > If I'm expecting lots of subscriptions, my rule of thumb is to set > SNDHWM=0 on the SUB socket and RCVHWM=0 on the PUB socket. This way the > application will sooner die than lose a subscription message. > > > > Justin > > > > On Mon, May 13, 2019, at 10:06 AM, Bekritsky, Benjamin via zeromq-dev > wrote: > > I am using libzmq and setting up topics using binary data. In other words, > my topic is the first 2 bytes of my message. > > > > I subscribe by setting a and b to the values I’m interested in: > > for (uint16_t i = a; i <= b; i++) > > { > > d = zmq_setsockopt(sub_socket, ZMQ_SUBSCRIBE, &i, 2); > > if (d) > > { > > printf ("E: subscription failed: %s\n", strerror > (errno)); > > return -1; > > } > > } > > > > My publisher publishes like this: > > string incoming_string = " this message"; > > incoming_string.insert(0,1,i>>8); > > incoming_string.insert(0,1,i%256); > > > > int rc = zmq_send(pub_socket, incoming_string.c_str(), > incoming_string.size(), 0); > > > > I can’t seem to subscribe to more than 1000 topics (values 0x0000 – > 0x03e7). From what I understand, thousands of topics should be available. > > > > Any guidance would be helpful. > > > > Thanks, > > Benjy > > > > Benjamin Bekritsky > > c/o Zebra Technologies > > 2 Negev St. (Motorola Building) > > 4th Floor > > Airport City 7019900 > > Israel > > > > > > > ------------------------------ > > - CONFIDENTIAL- > > > > This email and any files transmitted with it are confidential, and may > also be legally privileged. If you are not the intended recipient, you may > not review, use, copy, or distribute this message. If you receive this > email in error, please notify the sender immediately by reply email and > then delete this email. > > > ------------------------------ > > - CONFIDENTIAL- > > This email and any files transmitted with it are confidential, and may > also be legally privileged. If you are not the intended recipient, you may > not review, use, copy, or distribute this message. If you receive this > email in error, please notify the sender immediately by reply email and > then delete this email. > > _______________________________________________ > > zeromq-dev mailing list > > [email protected] > > https://lists.zeromq.org/mailman/listinfo/zeromq-dev > > > > > _______________________________________________ > zeromq-dev mailing list > [email protected] > https://lists.zeromq.org/mailman/listinfo/zeromq-dev >
_______________________________________________ zeromq-dev mailing list [email protected] https://lists.zeromq.org/mailman/listinfo/zeromq-dev
