Then this looks like a bug on ActiveMQ.. Could you past that info into
a new JIRA issue at:
http://issues.apache.org/activemq/browse/AMQ
Regards,
Hiram
On 6/21/06, wconroy <[EMAIL PROTECTED]> wrote:
Thanks for the quick reply.
I am trying to connect with the following now.
discovery:(multicast://default)?maxReconnectAttempts=1
and this is the output.
0 [main] INFO test.activemq.MyActiveMQSubscriber - Connecting to:
discovery:(multicast://default)?maxReconnectAttempts=1
959 [main] WARN
org.apache.activemq.transport.discovery.multicast.MulticastDiscoveryAgent -
brokerName not set
969 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport -
Started.
984 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport -
Waiting for transport to reconnect.
1987 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport
- Waiting for transport to reconnect.
2988 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport
- Waiting for transport to reconnect.
3990 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport
- Waiting for transport to reconnect.
4992 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport
- Waiting for transport to reconnect.
5994 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport
- Waiting for transport to reconnect.
6996 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport
- Waiting for transport to reconnect.
7997 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport
- Waiting for transport to reconnect.
8999 [main] DEBUG org.apache.activemq.transport.failover.FailoverTransport
- Waiting for transport to reconnect.
It goes on indefinitely, so I would assume that it is not working properly.
I am using 4.0 and am purposely not starting a broker.
Here is the source I am running.
public class MyActiveMQSubscriber {
public static void main(String[] args) throws Exception {
BasicConfigurator.configure();
String url =
"discovery:(multicast://default)?maxReconnectAttempts=1";
Logger.getLogger(MyActiveMQSubscriber.class).info("Connecting to: "
+ url);
Connection connection = createConnection(url);
Session session = createSession(connection);
MessageConsumer consumer = creatConsumer(session);
System.out.println("Connection created");
Message m;
while ((m = consumer.receive()) != null) {
Logger.getLogger(MyActiveMQSubscriber.class).info("Got message:
" + m);
}
}
public static Connection createConnection(String url) throws Exception {
ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnectionFactory(url);
Connection connection = connectionFactory.createConnection();
connection.start();
return connection;
}
public static Session createSession(Connection connection) throws
Exception {
Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
return session;
}
public static MessageConsumer creatConsumer(Session session) throws
Exception {
MessageConsumer consumer =
session.createConsumer(session.createTopic("SecurityChanged"));
return consumer;
}
protected static void close(Connection connection, Session session)
throws JMSException {
// lets dump the stats
dumpStats(connection);
if (session != null) {
session.close();
}
if (connection != null) {
connection.close();
}
}
protected static void dumpStats(Connection connection) {
ActiveMQConnection c = (ActiveMQConnection) connection;
c.getConnectionStats().dump(new IndentPrinter());
}
}
Thank you very much for your help.
--Bo
--
View this message in context:
http://www.nabble.com/Discovery-Fail-if-no-Broker-t1824894.html#a4982927
Sent from the ActiveMQ - User forum at Nabble.com.
--
Regards,
Hiram
Blog: http://hiramchirino.com