Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Kevin Sapper
    @sappo
    @Alex-CodeLab the poller will notify the caller if there's a new message present on the socket
    Alex ⚡
    @Alex-CodeLab
    thanks. that makes sense. I tried to read the manual about it, but it was a bit too technical.
    Kevin Sapper
    @sappo
    The poll.poll(<request_timeout>) call will return either if there's a new message available on one of the registered sockets or it will return after the request timeout.
    The poll.register(client, zmq.POLLIN) registers the client socket with the poller and the zmq.POLLIN parameter will tell the poller to return on the poll call if there's a new incoming message on the socket. Another option could be zmq.POLLOUT but you will usually not require to use it.
    Alex ⚡
    @Alex-CodeLab
    thanks a lot.
    Joséphine Barthel
    @JoBarthel_gitlab
    Hello again, I am still doing some research regarding ZeroMQ possible applications in video game development. Let's say I want to have a permanent record of data regarding my players ; and I want each player to have access to it. For instance, a leaderboard, or an inventory system. Would it make sense to have a pub/sub architecture for it ? Or should I use a classic request-reply pattern ?
    After reading The Guide, I understand there is 4 main patterns that are implemented by defaut in ZMQ (pub/sub, pipeline, request-reply and exclusive pairs) but I struggle to understand for which real-life case each one is appropriate.
    Joséphine Barthel
    @JoBarthel_gitlab
    @sappo Thank you for your answer. Would Peer-to-Peer pub/sub be able to handle reconnect in case a player gets dropped during a game ? Let's say I'm only sending input - wouldn't those messages be lost ?
    Kevin Sapper
    @sappo
    If you use plain pub/sub then a subscriber will not get messages redelivered that have been sent while it has been offline.
    But using Dafka a consumer can read messages that have been sent while it was offline with the help of the consumer offset
    Regarding permanent records Dafka has the concept of stores which will save events that can be reread even if the producer is already dead
    Kevin Sapper
    @sappo
    Regarding the pattern, some common use cases would be (but not exclusive):
    • Exclusive pair -> interprocess communication
    • Pipeline -> processing workflow with multiple steps
    • Request/Reply -> Clients request something from a server
    Alex ⚡
    @Alex-CodeLab
    @JoBarthel_gitlab you could store a copy of each message on the server, and on reconnect the client just tells what his latest received message-id was. Then it is up to you if you want to send the latest state, or all missed messages.
    Joséphine Barthel
    @JoBarthel_gitlab
    Thank you for your help !
    Иван Сердюк
    @oceanfish81_twitter
    Adriano Ribeiro
    @drr00t
    Hi guys, is it possible to use dafka with netmq? 😁
    Adriano Ribeiro
    @drr00t
    @sappo if not. Is it to hard implement consumers? I would like to build my services using Kafka streams style architecture. But I'm working with dotnet and netmq
    Kevin Sapper
    @sappo
    @somdoron started to port dafka to netmq. Not sure what the current state of his effort is though
    Kevin Sapper
    @sappo
    @drr00t it is rather easy to to implement the consumers. The implementation part of the consumer is extensively documented in the README
    If you need any help feel free to contact me
    Doron Somech
    @somdoron
    I will look into port to .net in couple of weeks.
    Will use in production soon
    Adriano Ribeiro
    @drr00t
    Nice @somdoron i wondering to use in production too. Good to know that, thank you @sappo and @somdoron I will back to metter
    Tushar Mathur
    @tusharmath
    I am trying to distribute my worker over a set of workers. I have 1 Request socket on Client and N Reply Sockets on N Workers. Is this the right combination?
    Right now the execution is such that only one message is being sent by the Request and until a response is recieved no new message can be sent.
    Is there a better way?
    Kevin Sapper
    @sappo
    Yes, use the pipeline pattern with PUSH and PULL sockets: https://zeromq.org/socket-api/#pipeline-pattern
    Tushar Mathur
    @tusharmath
    fig20.png
    But its not being parallel really. @sappo
    Kevin Sapper
    @sappo
    This is an example using the pipeline pattern: https://zeromq.org/socket-api/#pipeline-pattern
    To make your current code work asynchronous read this: http://zguide.zeromq.org/page:all#The-Asynchronous-Client-Server-Pattern
    Tushar Mathur
    @tusharmath
    @sappo What is wrong with my pattern?
    If the work isn't distributed, what is the purpose of having multiple REP?
    :point_up: December 31, 2019 7:59 PM Thanks i will take a look at this.
    Kevin Sapper
    @sappo
    It only makes sense if you also have multiple REQ sockets @tusharmath
    Tushar Mathur
    @tusharmath
    Oooh .... it doesn't say so in the doc though.
    I mean the diagram is from the doc.
    Apparently the middle proxy layer is supposed to make this system async.
    Kevin Sapper
    @sappo
    The second link I send does exactly this ;)
    iqbaldzone
    @iqbaldzone
    Hey Guy, I am using jeromq 0.5.1 version and i got this warning Warning:(31, 26) java: createSocket(int) in org.zeromq.ZContext has been deprecated. any have idea what i need to use.
    iqbaldzone
    @iqbaldzone
    and getting this error too while shutdowning program org.zeromq.ZMQException: Errno 4 at org.zeromq.ZMQ$Socket.mayRaise(ZMQ.java:3533) ~[jeromq-0.5.1.jar:?]
     zmq.ZError$IOException: java.nio.channels.ClosedByInterruptException
        at zmq.Signaler.send(Signaler.java:101) ~[jeromq-0.5.1.jar:?]
        at zmq.Mailbox.send(Mailbox.java:71) ~[jeromq-0.5.1.jar:?]
        at zmq.Ctx.sendCommand(Ctx.java:540) ~[jeromq-0.5.1.jar:?]
        at zmq.ZObject.sendCommand(ZObject.java:382) ~[jeromq-0.5.1.jar:?]
        at zmq.ZObject.sendPipeTerm(ZObject.java:246) ~[jeromq-0.5.1.jar:?]
        at zmq.pipe.Pipe.terminate(Pipe.java:458) ~[jeromq-0.5.1.jar:?]
        at zmq.SocketBase.termEndpoint(SocketBase.java:639) ~[jeromq-0.5.1.jar:?]
        at org.zeromq.ZMQ$Socket.disconnect(ZMQ.java:3082) ~[jeromq-0.5.1.jar:?]
    Doron Somech
    @somdoron
    Yo
    You probably need to create the socket directly with a constructor. Context has been deprecated in some bindings and ports
    iqbaldzone
    @iqbaldzone
    could you please give a example how can i create ?
    @somdoron Because currently i create socket in constructor.
    Kevin Sapper
    @sappo
    @iqbaldzone check the examples from the guide. Those should use non-deprecated API: https://github.com/zeromq/jeromq/tree/master/src/test/java/guide
    iqbaldzone
    @iqbaldzone
    Okay thank @sappo ,
    any suggestion to close socket multi threading socket zmq.ZError$IOException: java.nio.channels.ClosedByInterruptException at zmq.Signaler.send(Signaler.java:101) ~[jeromq-0.5.1.jar:?] at zmq.Mailbox.send(Mailbox.java:71) ~[jeromq-0.5.1.jar:?] at zmq.Ctx.sendCommand(Ctx.java:540) ~[jeromq-0.5.1.jar:?] at zmq.ZObject.sendCommand(ZObject.java:382) ~[jeromq-0.5.1.jar:?] at zmq.ZObject.sendPipeTerm(ZObject.java:246) ~[jeromq-0.5.1.jar:?] at zmq.pipe.Pipe.terminate(Pipe.java:458) ~[jeromq-0.5.1.jar:?] at zmq.SocketBase.termEndpoint(SocketBase.java:639) ~[jeromq-0.5.1.jar:?] at org.zeromq.ZMQ$
    Kevin Sapper
    @sappo
    Also be aware that you shouldn't use one socket from multiple threads