activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kieran Jones (JIRA)" <j...@apache.org>
Subject [jira] Created: (AMQ-2597) Broker discovery when no brokers exist still returns a connection factory which cannot be used.
Date Mon, 08 Feb 2010 18:07:32 GMT
Broker discovery when no brokers exist still returns a connection factory which cannot be used.
-----------------------------------------------------------------------------------------------

                 Key: AMQ-2597
                 URL: https://issues.apache.org/activemq/browse/AMQ-2597
             Project: ActiveMQ
          Issue Type: Bug
          Components: JMS client
    Affects Versions: 5.3.0
         Environment: ActiveMQ v5.3.0
Windows XP Pro SP3
Java 1.5
            Reporter: Kieran Jones
             Fix For: 5.4.0


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 see the ActiveMQConnectionFactory return null or throw an exception
if no brokers are discovered after a user-specified timeout.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message