[rabbitmq-discuss] Having trouble connecting via jInterface
peckb
brian.peck at lmco.com
Tue Oct 13 03:47:04 BST 2009
Hey all,
I'm trying to query my rabbitmq broker from java and I am able to make the
simple example calls that I found at
http://leftrightfold.com/2009/04/26/how-to-build-rabbit-management-console/,
but when I try a more complex call i get no response.
I'm trying to call the list_queues method with the following code.
...
OtpSelf self = new OtpSelf("guest", "myCookie");
OtpPeer other = new OtpPeer("rabbit at mercury");
OtpConnection connection = self.connect(other);
OtpErlangObject obj = new OtpErlangBinary((byte)47);
// the magic 47 was in reference to the answer I found at
//
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2009-April/003265.html
// though I am unsure it is behaving properly
connection.sendRPC("rabbit_amqqueue", "info_all", new OtpErlangList(obj));
OtpMsg receiveMsg = connection.receiveMsg();
System.out.println(receiveMsg.getMsg());
...
However the output is always {rex, []}. If I try connection.receiveRPC() the
received data is just [].
But when I hop over to the command line and type rabbitmqctl list_queues I
get
Listing queues ...
SimpleQueue 501
...done.
Also, when I try and go into erlang [erl, no parameters] and type
rpc:call(rabbit at mercury, rabbit_amqqueue, info_all, [<<"/">>]).
I get
{badrpc, nodedown}
Any thoughts on what might be causing my java code to not work?
Thanks,
Brian
Note: In case you're wondering I'm on Ubuntu 9.0.4.
--
View this message in context: http://www.nabble.com/Having-trouble-connecting-via-jInterface-tp25866384p25866384.html
Sent from the RabbitMQ mailing list archive at Nabble.com.
More information about the rabbitmq-discuss
mailing list