ZMQ.REQ regression since 0.4.0
See original GitHub issueI am writing a library that communicates with the ZeroMQ server of OpenNMT. This code works using 0.3.6, but hangs on the receiving using any 0.4.x branch.
public OpenNMTZeroMQClient(String host, int port) {
this.context = ZMQ.context(2);
this.socket = context.socket(ZMQ.REQ);
String hostAddress = "tcp://" + host + ":" + port;
LOG.info("Connecting to '{}'", hostAddress);
socket.connect(hostAddress);
}
public void translate(String text) {
String js = new JSONArray()
.put(new JSONObject()
.put("src", text))
.toString();
LOG.info("Sending '{}'...", js);
boolean wasSent = socket.send(js.getBytes(ZMQ.CHARSET), 0);
if(wasSent) {
LOG.info("Sent!");
}
LOG.info("Receiving...");
String reply = socket.recvStr();
LOG.info("Received: '{}'", reply);
}
public void close() {
if(this.socket != null) {
this.socket.close();
}
if(this.context != null) {
this.context.term();
}
}
It doesn’t actually fail, but it just hangs on the recv() call. The server didn’t receive anything, so the problem is probably that the send never happened.
EDIT: code formatting
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (15 by maintainers)
Top Results From Across the Web
Upgrade 0.3.4 to 0.4.2 -> Windows running out of ports #495
With jeromq-0.4.2 the number increases until after some thousands the system is running out of ports ... ZMQ.REQ regression since 0.4.0 #497.
Read more >ZMQ (JeroMQ 0.4.0 API) - Javadoc.io
ROUTER is the socket that creates and consumes request-reply routing envelopes. It is the only socket type that lets you route messages to...
Read more >Chapter 4 - Reliable Request-Reply Patterns - ZeroMQ guide
In this chapter, we focus heavily on user-space request-reply patterns, reusable models that help you design your own ZeroMQ architectures: The Lazy Pirate ......
Read more >Log4j – Changes - Apache Logging Services
Fix regression in Rfc5424Layout default values. Fixes LOG4J2-3587. Thanks to Tomas Micko. ... Update ZeroMQ's JeroMQ from 0.4.0 to 0.4.1.
Read more >Bug listing with status RESOLVED with resolution TEST ...
status:RESOLVED resolution:TEST-REQUEST severity:critical ... regression in playlist handling: cannot open some files after audacious restarting" ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@fredoboulo The 0.4.3 release does indeed fix the issue. Thanks a bunch and sorry for the delay on my end!
Seems good to me. My email is on my profile too, definitely feel free to email me!