activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dejan Bosanac <de...@nighttale.net>
Subject Re: get Broker from ActiveMQConnectionFactory?
Date Thu, 26 Feb 2009 08:26:15 GMT
Hi,

ActiveMQConnectionFactory is the "client" side of the connection, so it
could not contain the instance of the broker. If you want to purge the queue
on a remote broker, you should use the JMX API. Take a look at the following
links for more information and some samples.

http://activemq.apache.org/jmx.html
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java?view=markup

Cheers
--
Dejan Bosanac

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Thu, Feb 26, 2009 at 2:12 AM, centis <centis_biks@hotmail.com> wrote:

>
> I'm looking for a way to do this too...  I would like to be able to purge a
> queue, but can't figure out how to get the BrokerService instance for the
> currently running broker.
>
> Anyone?
>
> Thanks!
> CB
>
>
> silver1 wrote:
> >
> > Hi,
> >
> > I have a standalone ActiveMQ-Broker (started with activemq.bat).
> > In my code i use following:
> >
> >     ActiveMQConnectionFactory cf = new
> > ActiveMQConnectionFactory(prop.getProperty("TCP"));
> >     ActiveMQConnectionconnection =
> > (ActiveMQConnection)cf.createConnection();
> >     ActiveMQConnection connection.start();
> >     System.out.println(connection.getBrokerInfo().getBrokerId());
> >
> > I get the BrokerId, but i find no option to get the Broker- or the
> > BrokerService-instance.
> >
> > Has anybody an Idea?
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/get-Broker-from-ActiveMQConnectionFactory--tp21327599p22215702.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message