1
votes

I have two apps that run on the same server. One is a c++ app and another is a java web server running on top of vertx. The webserver wants to send request to the C++ part and obtains response. ZeroMq seems a performing solution to do the inter process communication. And it exists a bridge to vertx (https://github.com/dano/vertx-zeromq), but no so well documented.

I'm wondering if what i think can be done with this bridge:

  • C++ zeroMq socket type is a dealer, it registers to the event bus by sending the appropriate message that contains the handler adress.
  • Webserver send data to the socket event bus handler address and get response in its callback.

Does it have an opportunity to work or i misunderstand the zeroMq bridge ?

1
If ZeroMQ is not a strong requirement, you could use the TCP EventBus bridge to make your C++ app communicate with the Vert.x - tsegismont
At the point ZeroMq is an architectural constraint in the project. I also see that a C++ client is available : github.com/julien3/vertxbuspp (websocket under the hood). Tcp event bus bridge will be more efficient no ? The approach described with ZeroMq works in my poc. - colin aygalinc
If your work inside the datacenter then you can probably avoid websockets and yes, it should be more efficient. - tsegismont

1 Answers

0
votes

That sounds correct to me but you don't need ZeroMQ - you can just used regular TCP - https://vertx.io/docs/vertx-tcp-eventbus-bridge/java/ and that has good documentation and support.

I'm currently looking into the benefits of using ZeroMQ for my project and suspect it is useful for more complex topologies like "broadcasting an event without knowing who wants it (don't require handlers to register)" but Vertx doesn't support this from what I can see.