You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ronchalant <ro...@gmail.com> on 2009/04/08 19:18:22 UTC

Managing a Broker via JMX

Is it possible to manage the network connectors of a broker via JMX?  I don't
see it here: http://activemq.apache.org/jmx.html

What I want to be able to do is dynamically manage network connector(s)
without running in the same VM.. is this possible via JMX or some other
protocol?

-Ron
-- 
View this message in context: http://www.nabble.com/Managing-a-Broker-via-JMX-tp22955494p22955494.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Managing a Broker via JMX

Posted by Jai_M <mj...@yahoo.com>.
I am working on a similar implementation and could not get to create
transportConnector via JMX. See my earlier post regarding this at
http://www.nabble.com/How-to-create-a-TransportConnector-using-JMX-td23643601.html

I even tried the example provided in the link by Bruce. Surprisingly
createTopic works fine. However the addConnector fails. See my code snippet
below.

try {		
			ObjectName brokerName = new
ObjectName("org.apache.activemq:BrokerName=localhost,Type=Broker"); 
			Object[] params = { "tcp://localhost:61617" }; 
			String[] sig = { "java.lang.String" };
			conn.invoke(brokerName, "addConnector", params, sig);
			
		}...

Is this a bug ?

Jai


bsnyder wrote:
> 
> On Wed, Apr 8, 2009 at 12:02 PM, ronchalant <ro...@gmail.com> wrote:
> 
>> In my application we want to leverage some kind of distributed queue
>> probably using store-forward, and new brokers may come online from
>> time-to-time.  I wanted to then update the network connector(s)
>> dynamically
>> to include these new brokers in the store-forward scheme, and I wanted to
>> do
>> this all programmatically.
>>
>> I could always roll my own JMX component that wraps the broker, providing
>> whatever management I need, but I'd rather not re-invent that wheel.
> 
> You can achieve this via a static XML configuration (the most common)
> or you could do it programatically either by embedding ActiveMQ or via
> JMX. There's a very basic example of using JMX to interact with the
> broker that's attached to the following message:
> 
> http://markmail.org/message/gjl3euwi5bgniffq
> 
> That will help to get you started. The one thing it doesn't
> demonstrate is creation of a new network connector. But via Jconsole
> you can see the addNetworkConnector() method on the Broker object.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> ActiveMQ in Action: http://bit.ly/2je6cQ
> Blog: http://bruceblog.org/
> Twitter: http://twitter.com/brucesnyder
> 
> 

-- 
View this message in context: http://www.nabble.com/Managing-a-Broker-via-JMX-tp22955494p23645583.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Managing a Broker via JMX

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Apr 8, 2009 at 12:02 PM, ronchalant <ro...@gmail.com> wrote:

> In my application we want to leverage some kind of distributed queue
> probably using store-forward, and new brokers may come online from
> time-to-time.  I wanted to then update the network connector(s) dynamically
> to include these new brokers in the store-forward scheme, and I wanted to do
> this all programmatically.
>
> I could always roll my own JMX component that wraps the broker, providing
> whatever management I need, but I'd rather not re-invent that wheel.

You can achieve this via a static XML configuration (the most common)
or you could do it programatically either by embedding ActiveMQ or via
JMX. There's a very basic example of using JMX to interact with the
broker that's attached to the following message:

http://markmail.org/message/gjl3euwi5bgniffq

That will help to get you started. The one thing it doesn't
demonstrate is creation of a new network connector. But via Jconsole
you can see the addNetworkConnector() method on the Broker object.

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

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Re: Managing a Broker via JMX

Posted by ronchalant <ro...@gmail.com>.

bsnyder wrote:
> 
> Jconsole can be used to connect to remote brokers. When making a
> connection to the broker from Jconsole, specify the ip address and
> port number to connect. But I'm not sure this will provide what you
> need given that you're looking to 'dynamically manage network
> connectors'. What exactly do you need to manage about the connectors?
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> ActiveMQ in Action: http://bit.ly/2je6cQ
> Blog: http://bruceblog.org/
> Twitter: http://twitter.com/brucesnyder
> 
> 

In my application we want to leverage some kind of distributed queue
probably using store-forward, and new brokers may come online from
time-to-time.  I wanted to then update the network connector(s) dynamically
to include these new brokers in the store-forward scheme, and I wanted to do
this all programmatically.

I could always roll my own JMX component that wraps the broker, providing
whatever management I need, but I'd rather not re-invent that wheel.
-- 
View this message in context: http://www.nabble.com/Managing-a-Broker-via-JMX-tp22955494p22956326.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Managing a Broker via JMX

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Apr 8, 2009 at 11:18 AM, ronchalant <ro...@gmail.com> wrote:
>
> Is it possible to manage the network connectors of a broker via JMX?  I don't
> see it here: http://activemq.apache.org/jmx.html
>
> What I want to be able to do is dynamically manage network connector(s)
> without running in the same VM.. is this possible via JMX or some other
> protocol?

Jconsole can be used to connect to remote brokers. When making a
connection to the broker from Jconsole, specify the ip address and
port number to connect. But I'm not sure this will provide what you
need given that you're looking to 'dynamically manage network
connectors'. What exactly do you need to manage about the connectors?

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

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder