0

I have successfully able to connect worker and broker on tcp protocol and then client to broker on tcp. Now i am evaluating that is it possible that worker and broker can connect on ipc/inproc protocol while client will connect to broker on tcp. My workers and broker will be on same machine and might even reside in same process. My client can connect to my broker from different machine that's why it needed to be on tcp

Can Broker be binded in dual way ?

Kamran Shahid
  • 3,954
  • 5
  • 48
  • 93

1 Answers1

1

Yes, there's no problem doing what you suggest. Each ZMQ socket operates completely distinct from the other sockets in your code. It often makes sense to mix connection protocols to optimize communication the way you're looking to do.

One assumption I'm making here is that your broker has 2 sets of sockets: client facing sockets that you can connect via TCP and worker facing sockets that you can connect via some other protocol. If both client and worker are connecting to the same socket on the broker, then they must connect via the same protocol.

The only thing to consider is whether your workers will always reside in the same process as your broker, or if it might grow to a point where it makes sense to separate them. But, if you define your socket connections in some sort of configurable way, rather than baking it into the code, even that could be a relatively easy fix if you decide to change things down the line.

Jason
  • 13,606
  • 2
  • 29
  • 40
  • Thanks Jason. Any way i can do any sort of authentication between worker and broker so that only allowed worker can be registered on broker while client to broker connectivity is open. – Kamran Shahid Apr 02 '19 at 14:36
  • 1
    Sure, but what sort of authentication process would work for you is going to be outside the scope of ZMQ, outside the scope of Majordomo, and you'll have to determine the best design and implementation of that yourself. The upshot is that you'll make a successful ZMQ connection between worker and broker, and then determine appropriate authentication over some sort of message protocol you design (or can find to implement). – Jason Apr 02 '19 at 18:17