activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugeny N Dzhurinsky <>
Subject Embedded broker, adding connections after broker was configured with xbean:
Date Wed, 20 Aug 2008 12:00:55 GMT
Hello all!

I have the activemq.xml file, listed below:

    <broker brokerName="broker0" xmlns="">
            <managementContext connectorPort="1599"
            <transportConnector name="openwire" uri="tcp://localhost:1235" />
    <jetty xmlns="">
            <nioConnector port="8161" />
            <webAppContext contextPath="/fileserver"
                resourceBase="webapps/" logUrlOnStart="true" />

When transportConnectors section was uncommented, everything is working fine -
the broker is listening for connections at port 1235.

Due to flexibility requests we need to allow the application to be configured
by passing the broker connection url through the command line, so we decided
to comment out the transportConnectors section and use addConnection() method
in the broker as listed below:

    final BrokerService broker = BrokerFactory.createBroker(new URI(
    System.out.format("Using transport connector '%1$s'\n", connectorUrl);

However this doesn't work well - while there is something listening on port
1235, the remote clients of the brokers are getting such exception during

Exception in thread "main" javax.jms.JMSException: Wire format negotiation timeout: peer did
not send his wire format.
        at org.apache.activemq.util.JMSExceptionSupport.create(
        at org.apache.activemq.ActiveMQConnection.syncSendPacket(
        at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(
        at org.apache.activemq.ActiveMQConnection.start(

With replacing the code line 
    final BrokerService broker = BrokerFactory.createBroker(new URI(

final BrokerService broker = new BrokerService();

everything works fine and connections are negitiated and accepted by broker.

the question is - what is the correct way to add the connection listeners to the
BrokerService, configured with bean definition like I pasted above?

Thank you in advance!

Eugene N Dzhurinsky

View raw message