Hi,
I changed to 0.19.10 version of Elasticsearch, 2.2 version of ZeroMQ and
0.0.4 SNAPSHOT version of zeroMq transport plugin (
GitHub - bpaquet/transport-zeromq: ØMQ transport layer plugin for Elasticsearch). I am not able to run the java
SimpleClient in the test package in the github package. The client was able
to send the message but couldn't receive the message from Elasticsearch.
Java program stops at the line where socket.recv function called. I am
thinking that it's waiting for the reply and could not receive the message.
Simple Client ::
//Format function to append the message in the proper format
private static byte format(String method, String url, String json,
Integer count) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder(method);
sb.append(ZMQSocket.SEPARATOR);
if (count != null) {
sb.append(url).append(count);
} else {
sb.append(url);
}
sb.append(ZMQSocket.SEPARATOR);
if (json != null) {
sb.append(json);
}
return sb.toString().getBytes("UTF-8");
}
public static void main(String args) throws IOException {
final ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket socket = context.socket(ZMQ.DEALER);
socket.connect(address);
socket.send(format(method, url, json, null), 0);
byte response = socket.recv(0);//////////////////////////////////////At
this line Java Program stops
System.out.println(response);
}
finally {
try {
socket.close();
} catch (Exception e2) {
// ignore
}
try {
context.term();
} catch (Exception e2) {
// ignore
}
System.out.printf("%d message(s) sent in %dms", repeat,
System.currentTimeMillis()-startTime);
}
Ononday, November 26, 2012 1:53:07 PM UTC+5:30, Tanguy wrote:
Hi Vinay,
Did you install zeromq and the plugin on every hosts? Which version of
zeromq do you use? Which OS?-- Tanguy
Le lundi 26 novembre 2012 08:24:22 UTC+1, Vinay Gurram a écrit :
Have anyone worked with zeromq plugin for elasticserach?
I tried to run SimpleClient provided by the github package, but couldn't
post message on Elasticsearch. Can anyone provide a working example code?
--