Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:39
    Detect1ve commented #4218
  • 11:49
    joakim-brannstrom commented #4218
  • 07:04
    Detect1ve commented #4218
  • Jun 22 14:47
    k-stachowiak opened #4221
  • Jun 22 09:13
    Detect1ve edited #4218
  • Jun 22 09:01
    Detect1ve commented #4218
  • Jun 17 10:02
    bluca commented #4220
  • Jun 17 09:08
    egpbos edited #4220
  • Jun 17 09:05
    egpbos opened #4220
  • Jun 16 15:04
    sphaero closed #4219
  • Jun 16 15:04
    sphaero commented #4219
  • Jun 16 14:59
    sphaero commented #4219
  • Jun 16 14:58
    sphaero commented #4219
  • Jun 16 14:58
    sphaero edited #4219
  • Jun 16 14:55
    sphaero commented #4219
  • Jun 16 14:43
    bluca commented #4219
  • Jun 16 14:27
    sphaero opened #4219
  • Jun 15 18:22

    bluca on master

    Problem: formatting is broken … (compare)

  • Jun 15 18:21

    bluca on master

    fix unused parameter warning wh… add relicense statement for egp… Merge pull request #4211 from e… (compare)

  • Jun 15 18:21
    bluca closed #4211
Allie
@cite-reader
Subscriptions are a prefix match on the first frame.
That's in the Guide
mental
@mental32
@cite-reader thank you! <3
degeorg
@degeorg
Hi! Working on project, trying to implement n to n topology. Currently thinking about this: DEALER (client) <-> ROUTER <-> ROUTER ("broker") <-> DEALER (worker). What i need: 1. Client: connect to broker, send several requests at a time (async) and waiting responses, could work several clients at a time, also retry logic on error. 2. Worker: predefined pool of workers, each connect to broker (self registration on broker), receive requests from broker, processing and send responses back. 3. Broker: received requests from client and load-balancing (round-robin or based on load) them throught workers, then route responses back to clients, also heartbeating workers and tracking state per client request. Could someone give advice on that, is it good idea or i'am going wrong way...Thanks!
gerald-dotcom
@gerald-dotcom

The response to browser only sent if I CTRL+C the running ZeroMQ Application but I don't know why.

// Send Response socket.send(frames[0], zmq::send_flags::sndmore); socket.send(zmq::str_buffer("HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\nHello, World!"), zmq::send_flags::none); // Close Connection with Browser socket.send(frames[0], zmq::send_flags::sndmore); socket.send(zmq::buffer(std::string_view("\0")), zmq::send_flags::none);

Nassim Abedi
@nassimabedi
Hello, Could you please help me:) how send specific message size in request-reply I found ZMQ_MAXMSGSIZE but it is related to socket option . I want to send specific message size . Is it related to socket option ? or just control message size in other way?
another question how can I send huge message per second?(for example 10000 kb/p)
mental
@mental32
I may go and bench this but I think it's smart that I ask here first: Is there a performance difference between using a PUSH/PULL pair of sockets instead of a DEALER? (my gut feeling says no))
Kevin Sapper
@sappo

@mental32 There's no performance difference between them but a memory difference.

DEALER sockets create both a send and receive queue per connection.

PUSH/PULL sockets create only a single send and receive queue per connection respectively.

mental
@mental32
gotcha thanks!
zoobab "NO Software Patents"
@zoobab_twitter
hey
can you tell me if Bitcoin still uses zeromq?
@sappo @bluca I sent you an email
Kevin Sapper
@sappo

can you tell me if Bitcoin still uses zeromq?

Seems like it https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md

zoobab "NO Software Patents"
@zoobab_twitter
have you seen my email?
vote on UPC, the 3rd attempt to get swpats in Europe, is tomorrow
we will loose it
mental
@mental32

I've just noticed that libzmq sub sockets performs prefix match filtering when I use TCP, reading spec 29 the section describing the SUB socket does allow it

MAY, depending on the transport, filter messages according to subscriptions, using a prefix match algorithm.

My question is how can I know which transports libzmq will try to prefix match for? I can't find it in the documentation for setsockopt

mental
@mental32
For now I'm just going to assume it applies to all transports
priyanshu850
@priyanshu850

Hello @sappo , @cite-reader ,
could you please help me out from this problem :
java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 at java.util.ArrayList.rangeCheck(ArrayList.java:659) at java.util.ArrayList.get(ArrayList.java:435) at zmq.socket.pubsub.Dist.distribute(Dist.java:162) at zmq.socket.pubsub.Dist.sendToMatching(Dist.java:138) at zmq.socket.pubsub.XPub.xsend(XPub.java:253) at zmq.SocketBase.send(SocketBase.java:718) at org.zeromq.ZMQ$Socket.send(ZMQ.java:3205) at org.zeromq.ZMQ$Socket.sendMore(ZMQ.java:3131)

I am using PUB/SUB pattern in multithreading.
When i try to publish event, i am getting this error.
using jeromq-0.5.2

import org.json.JSONObject;
import org.zeromq.SocketType;
import org.zeromq.ZContext;
import org.zeromq.ZMQ;
import org.zeromq.ZMQException;
import java.math.BigDecimal;
import java.util.Arrays;

public class RatePublisher {
    private static final ZContext context = new ZContext();
    private static final ZMQ.Socket publisher = context.createSocket(SocketType.PUB);
    private static String zmqAddress = "tcp://localhost:5563";
    static {
        publisher.bind(zmqAddress);
    }

 public static void publish(String name, String ident, BigDecimal rate, BigDecimal changePercentage) throws InterruptedException {
        try {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("name", name);
            jsonObject.put("ident", ident);
            jsonObject.put("rate", rate);
            jsonObject.put("changed_percentage", changePercentage);
           publisher.sendMore("rate");
           publisher.send(jsonObject.toString());
        } catch (ZMQException e) {
            e.printStackTrace();
            throw new InterruptedException();
        }
    }

    public static void close() throws InterruptedException {
        try {
            context.destroy();
        } catch (Exception e) {
            throw new InterruptedException();
        }
    }
}
in start of program, i initialise it.
After that Multiple thread are using this publish method.
For exapmle : Class A, B, C are working in asyncronous way and rapidily calling this publish method like this :
RatePublisher.publish("test", pair, rate, changePercentage);
Kevin Sapper
@sappo
@priyanshu850 the current zeromq sockets are not thread-safe.
Also make sure that you only have one ZContext object per JVM instance
priyanshu850
@priyanshu850
@sappo I need to publish event on a single port for example 5563, then how can i do that ?
I need this scenerio :
Class A, B, C are working in asyncronous way and calling this publish method like this :
RatePublisher.publish("test", pair, rate, changePercentage);
priyanshu850
@priyanshu850
currently doing like this
import org.json.JSONObject;
import org.zeromq.SocketType;
import org.zeromq.ZContext;
import org.zeromq.ZMQ;
import org.zeromq.ZMQException;
import java.math.BigDecimal;
import java.util.Arrays;

public class RatePublisher {
    private static final ZContext context = new ZContext();
    private static final ZMQ.Socket publisher = context.createSocket(SocketType.PUB);
    private static String zmqAddress = "tcp://localhost:5563";

   static {
        publisher.bind(zmqAddress);
    }

 public static void publish(String name, String ident, BigDecimal rate, BigDecimal changePercentage) throws InterruptedException {
        try {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("name", name);
            jsonObject.put("ident", ident);
            jsonObject.put("rate", rate);
            jsonObject.put("changed_percentage", changePercentage);
           publisher.sendMore("rate");
           publisher.send(jsonObject.toString());
        } catch (ZMQException e) {
            e.printStackTrace();
            throw new InterruptedException();
        }
    }

    public static void close() throws InterruptedException {
        try {
            context.destroy();
        } catch (Exception e) {
            throw new InterruptedException();
        }
    }
}

public class A 
{   
    public static void main(String[] args)
    {
        int i = 100;
        while(i>0) {
           RatePublisher.publish("test", pair, rate, changePercentage);
           i--;
        }
    }
}

public class B 
{   
    public static void main(String[] args)
    {
        int i = 100;
        while(i>0) {
           RatePublisher.publish("test", pair, rate, changePercentage);
           i--;
        }
    }
}

public class C 
{   
    public static void main(String[] args)
    {
        int i = 100;
        while(i>0) {
           RatePublisher.publish("test", pair, rate, changePercentage);
           i--;
        }
    }
}

public class D
{   
    public static void main(String[] args)
    {
        int i = 100;
        while(i>0) {
           RatePublisher.publish("test", pair, rate, changePercentage);
           i--;
        }
    }
}
ofc in my program i am using thread, it is similar like that
Kevin Sapper
@sappo
Either make RatePublisher.publish thread-safe or use one socket per thread (preferred)
Fialkovsky Maxim
@makometr
Hello guys, i am new to libzmq and i have a small question now: how to handle zmq-messages (from hello-world-client example) on server without zmq-wrapper, for example on standart go or python-flask server backend?
Thanks for any idea
Kristian
@topproto
hey all, is there a support guide for installing this on PHP 7.4 with PECL somewhere? :)
Szekely Gyorgy
@hoditohod
Hi All, building libzmq on windows with cmake results in pretty long dll name: libzmq-v142-mt-4_3_4.dll, is it possible to get libzmq.dll with build time configuration? I don't want to touch the CMakeLists.txt due to GPL license...
1 reply
𝘿𝘼𝙉
@danieldalaota_twitter

Hi all, I have a question.

I am building an app with a microservice application and one of those applications is a system monitor to monitor the health of my applications. The apps are sending heartbeats and pings to the system monitor through zmq.

One time, the system monitor did not receive any messages coming from the apps and I had few edits on the code, one of which that fixed the problem is to set the multicast rate in the socket options to 1 billion.

May I ask what the multicast rate is for? How does it affect the sending and receiving of messages? Thank you.

Allie
@cite-reader
That sets the maximum line rate for multicast transports--PGM or EPGM--in units of kilobits per second. It's there to prevent the network fabric from getting overwhelmed by the traffic, since there protocol doesn't have TCP's congestion control.
Allie
@cite-reader
It seems like you'd be in a really unusual situation if multicast rates were preventing delivery of heartbeat messages.
pmuvb
@pmuvb
Hi, I have a sample app where a Server sends messages to Client once a second (after the handshake). How can a second Client (third, and so on) join to receive messages from Server? Client has to initiate the conversation by sending the first message so then Server always has to listen to the incoming messages. So I have to set up a separate thread for a Server to listen to incoming messages? And then once it receives a message it has to figure out if it is existing Client or a new Client. What is the best way to handle all of this?
here is what I have: https://pastebin.com/KXhSMZTW
pmuvb
@pmuvb
I am pretty much want to set up Pub-Sub here but using Client-Server b/c Client-Server has 5x throughput.
smalls12
@smalls12
You can doo all of that in one thread if that thread is set up for polling
Poll for receive, if nothing to receive just keep sending
But you have it periodically sending messages Hmm
You could then make a separate thread for periodically sending over an inproc socket where the main thread could poll for it and then send it over the pub socket
pmuvb
@pmuvb
I got it -- pollling. TX. I've actually used it with DEALER/ROUTER.
Judd Taylor
@juddtaylor
Any perlzmq devs on here? I'm trying to contribute something, but can't figure out this codegen/build system
Judd Taylor
@juddtaylor
Ok, I've got all of that working, now just need to figure out how to do a pull request on gh
Judd Taylor
@juddtaylor
Pull request submitted to perlzmq
Ashok Kumar Karasala
@ashokchowdary863

We are facing a ZMQ proxy crash every 3 days and when we look at the system graphs we don't see any CPU or memory spikes. From the code, we have gracefully handled the socket's initialization and termination.

And adding socket.setsockopt(zmq.UNSUBSCRIBE, topic.encode('utf-8')) before closing the socket seems helping us in this. Does the UNSUBSCRIBE helps in releasing any resources other than close() ?

Kevin Sapper
@sappo

We are facing a ZMQ proxy crash every 3 days and when we look at the system graphs we don't see any CPU or memory spikes. From the code, we have gracefully handled the socket's initialization and termination.

And adding socket.setsockopt(zmq.UNSUBSCRIBE, topic.encode('utf-8')) before closing the socket seems helping us in this. Does the UNSUBSCRIBE helps in releasing any resources other than close() ?

@ashokchowdary863 you'll have better luck getting that question answered on the mailing list

Judd Taylor
@juddtaylor
So I'm using ZAP, and when my authenticator sends a reject reply, the client doesn't seem to notice, it just doesn't hear messages from the server. Any ideas how I can get the client to tell me that authentication failed?
pmuvb
@pmuvb
Does the Radio-dish works at all? I tried it but it did not work for me. I see Client-server works well, and it's very fast too.
Hendrik
@Asmod4n
Hi, is it supported to run ./configure --disable-shared --enable-static? I'm getting errors about not finding libdl and about using a pointer without initialising it.