Erlang/OTP Forums

Author Message

<  RabbitMQ mailing list  ~  Having trouble connecting via jInterface

Guest
Posted: Tue Oct 13, 2009 2:47 am Reply with quote
Guest
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@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@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.


_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
Guest
Posted: Tue Oct 13, 2009 10:38 am Reply with quote
Guest
Brian,


Try connection.receiveRPC() instead of
Guest
Posted: Tue Oct 13, 2009 3:07 pm Reply with quote
Guest
When I try that I just get [] from the output, which Java is telling me is an
OtpErlangList with .arity() = 0


Aaron Feng wrote:
>
> Brian,
>
> Try connection.receiveRPC() instead of OtpMsg receiveMsg =
> connection.receiveMsg();
>
> Aaron
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss@lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>

--
View this message in context: http://www.nabble.com/Having-trouble-connecting-via-jInterface-tp25866384p25874678.html
Sent from the RabbitMQ mailing list archive at Nabble.com.


_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist
Guest
Posted: Wed Oct 14, 2009 12:26 am Reply with quote
Guest
I swapped over to python using http://gist.github.com/102602 as a base and
had much more luck, still don't know what was wrong with the java side
though.

Brian
--
View this message in context: http://www.nabble.com/Having-trouble-connecting-via-jInterface-tp25866384p25883302.html
Sent from the RabbitMQ mailing list archive at Nabble.com.


_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum