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 : <br>
rpc:call(rabbit@server,rabbit_exchange,info_all,[<<"/">>],3000)]<br><br>The above command represented in JInterface code :<br><br><br> OtpSelf self = new OtpSelf("client", "rathitest");<br>
OtpPeer other = new OtpPeer("rabbit@server");<br> OtpConnection connection = self.connect(other);<br> OtpErlangObject [] obj = {new OtpErlangAtom("<<\"/\">>")} <br>
OtpErlangList arg = new OtpErlangList(obj); <br> connection.sendRPC("rabbit_exchange","info_all",arg);<br><br>When I invoke the above given code it gives : <br><br>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}]}}}<br>
<br>Can anybody please suggest what is going wrong here.<br><br>thanks & regards,<br>rathi <br><br><br><br><div class="gmail_quote">On Tue, Mar 24, 2009 at 1:32 AM, Matthias Radestock <span dir="ltr"><<a href="mailto:matthias@lshift.net">matthias@lshift.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Chris,<div class="im"><br>
<br>
Chris Pettitt wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
A few weeks back I was looking at using JInterface to create a JMX<br>
interface for RabbitMQ. I still haven't had cycles to work on it, but<br>
one of the immediate issues I saw was that I could not use<br>
rabbitmq_control.erl (the actual module for rabbitmqctl) directly,<br>
because it does not return the results, but instead prints them to<br>
stdout. You can make the same RPC calls that rabbitmqctl does though<br>
to get the results.<br>
</blockquote>
<br></div>
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.<br>
<font color="#888888">
<br>
<br>
Matthias<br>
<br>
</font></blockquote></div><br>