activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruce Snyder" <>
Subject Re: How to create BrokerService
Date Wed, 16 May 2007 15:29:29 GMT
On 5/16/07, Jiang <> wrote:
> bsnyder thanks a lot.
> In fact I just want to admin ActiveMQ from remote admin tools(which written
> by myself). I want to add/remove destinations on that  MQ server .  From my
> opinion, I think I should first get a referece of the remote server ,then I
> can do some operations on the server through that ref ( What I do is not
> create the broker really , In fact it has been created and run on the server
> when Activemq server starts.I just use it .Maybe what I think is wrong). So
> I connect to the broker at first step use the original code BrokerService
> service = BrokerFactory.createBroker(new URI("xxxxx")); or maybe the code
> you write for example , then I will use the code below:
>      ActiveMQDestination[] destinations = service.getDestinations();  //to
> get destinations list
>      BrokerView brview = service.getAdminView();    //get the admin
> BrokerView
>      brview.addTopic("Hello");    //add Hello topic to the broker --- Step 1
>      brview.addTopic("World");  //add World topic to the broker---Step 2
>      brview.removeTopic("Hello");  //remove Hello topic from the
> broker---Step3
>     brview.removeTopic("World");  //remove World topic from the
> broker---Step 4
> All the add/remove actions can been seen from the jconsole (after Step1 , we
> can seen from jconsole that Hello Topic has been added. after Step2 we can
> seen World topic has been added. after Step3 Hello topic can been seen
> removed. after Step4 just as Step3 )
> bsnyder what I say is right ? (Now the code I wirte above has not been
> tested for lack of environment. I will test it late )

OK, I see what you need now. You need to use the methods exposed via
JMX to achieve this task. I'm attaching a file that is an example of
exactly this. Let me know if you have any questions.

perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

Apache Geronimo -
Apache ActiveMQ -
Apache ServiceMix -
Castor -

View raw message