jkalucki/grabby-hands — Issue #8: always lost message when using with java
Author: yc-huang
Created: 2011-11-30 04:02:59+00:00
State: open

I'm testing grabby-hands with java; I tried the sample code, it works fine, but if I changed the receive queue to use a different GrabbyHands client as the send queue used, it will never receive the sent msg, e.g the following code will always get a NPE:
String queue = "example-yc";
Config config = new Config();
config.addServer("192.168.0.4:22133");
config.addQueue(queue);

GrabbyHands grabbyHandsSend = new GrabbyHands(config);
GrabbyHands grabbyHandsRecv = new GrabbyHands(config);
String send = "payload";
grabbyHandsSend.getSendQueue(queue).put(new Write(send));
String receive = new String(grabbyHandsRecv.getRecvQueue(queue).poll(10,
TimeUnit.SECONDS).array());
if (send.equals(receive)) {
System.err.println("received the same string");
} else {
System.err.println("received different string, must have bugs");
}

and I'm sure at this time there's no other receiver on this queue.