[
https://issues.apache.org/activemq/browse/AMQ-2597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61123#action_61123
]
Timothy Bish commented on AMQ-2597:
-----------------------------------
There doesn't seem to be an error here, in the configuration specified the
Connection is created and without a broker it will fail to connect to anything.
Creating a ConnectionFactory doesn't initiate a connection to the broker, that
starts after you call createConnection.
It sounds like the behaviour you want requires the use of a combination of
failover and the discovery transport.
> 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.