[rabbitmq-discuss] Broker data

rathi riteshrathi at gmail.com
Thu Apr 2 20:01:27 BST 2009


I have found out the various commands which I need to invoke to get the data
exposed via rabbitmqctl. Have been able to get the values via the JInterface
for some of them. But for queue, exchange related information I am not able
to get things via JInterface. The erlang command which I invoke to get the
list of exchanges :
rpc:call(rabbit at server,rabbit_exchange,info_all,[<<"/">>],3000)]

The above command represented in JInterface code :


        OtpSelf self = new OtpSelf("client", "rathitest");
        OtpPeer other  = new OtpPeer("rabbit at server");
        OtpConnection connection = self.connect(other);
        OtpErlangObject [] obj = {new OtpErlangAtom("<<\"/\">>")}
        OtpErlangList  arg = new OtpErlangList(obj);
        connection.sendRPC("rabbit_exchange","info_all",arg);

When I invoke the above given code it gives :

test :
receiveRPC{badrpc,{'EXIT',{function_clause,[{rabbit_misc,r,['<<\"/\">>',exchange]},{rabbit_exchange,list,1},{rabbit_exchange,map,2},{rpc,'-handle_call/3-fun-0-',5}]}}}

Can anybody please suggest what is going wrong here.

thanks & regards,
rathi



On Tue, Mar 24, 2009 at 1:32 AM, Matthias Radestock <matthias at lshift.net>wrote:

> Chris,
>
> Chris Pettitt wrote:
>
>> A few weeks back I was looking at using JInterface to create a JMX
>> interface for RabbitMQ. I still haven't had cycles to work on it, but
>> one of the immediate issues I saw was that I could not use
>> rabbitmq_control.erl (the actual module for rabbitmqctl) directly,
>> because it does not return the results, but instead prints them to
>> stdout. You can make the same RPC calls that rabbitmqctl does though
>> to get the results.
>>
>
> rabbit_control.erl is just a thin wrapper around the internal APIs. It
> deals with option parsing and result presentation. So calling the internal
> APIs directly, as you suggest, is indeed the way to go if you want to expose
> the rabbit_control functionality programmatically.
>
>
> Matthias
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090403/90dffc5e/attachment.htm 


More information about the rabbitmq-discuss mailing list