activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: Broker discovery when no brokers exist still returns a connection factory which cannot be used.
Date Mon, 08 Feb 2010 16:30:28 GMT
You may wish to raise an enhancement request for this. There is currently no
way to block till some broker is discovered.
I imagine the best that could be easily achieved is to have start() block
till a broker is discovered, with some variable determining the length of
the block before an exception is thrown.


At teh moment, there is no high level way get notified when a broker is
discovered

On 5 February 2010 19:58, kjones <kjones@safe.com> wrote:

>
> I'm using ActiveMQ 5.3.0 with a single broker running as a stand-alone app
> (not
> embedded).
>
> I have a client consumer app with the following code which finds the broker
> through multicast discovery, obtains a connection to it and a session on
> it:
>
>
> ActiveMQConnectionFactory connectionFactory = new
>
>
> ActiveMQConnectionFactory("discovery:multicast://default?group=myMessageBroker");
>
> ActiveMQConnection msgBrokerConnection =
> (ActiveMQConnection)connectionFactory.createConnection();
>
> Session msgBrokerSession = msgBrokerConnection.createSession(false,
> Session.AUTO_ACKNOWLEDGE);
>
>
> When the broker is running, the above code successfully discovers the
> broker,
> gets a connection to it and a session on it.
>
> However, when the broker is not running, the same code still returns an
> ActiveMQConnectionFactory and a connection to a non-existent broker. The
> subsequent attempt to create a session on this connection fails.
>
> I would ideally like to have the ActiveMQConnectionFactory return null or
> throw
> an exception if no brokers are discovered.
>
> Is there a way to determine when no brokers are discovered?
>
> Any thoughts are appreciated.
> --
> View this message in context:
> http://old.nabble.com/Broker-discovery-when-no-brokers-exist-still-returns-a-connection-factory-which-cannot-be-used.-tp27473153p27473153.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

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