activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Leyba" <xle...@gmail.com>
Subject Loading configuration from properties file
Date Mon, 02 Apr 2007 11:08:50 GMT
Hi


I've tried to make a pure properties loader fro activemq but it took
much time than I can assume in my job so I´ll try to do it at home and
now I'm trying to make a simple loader in my app.


In my old  xml spring style configuration file I used to have:

----------------
<beans>

  <broker xmlns="http://activemq.org/config/1.0"
brokerName="MASTERUBUNTU" persistent="true" useJmx="true">

        <!-- Use the following to configure how ActiveMQ is exposed in JMX -->
        <managementContext>
           <managementContext connectorPort="2011"
jmxDomainName="org.apache.activemq"/>
        </managementContext>

    <transportConnectors>
       <transportConnector  uri="tcp://172.31.112.9:62002" />
    </transportConnectors>

    <networkConnectors>
        <networkConnector
uri="static://(tcp://172.31.112.9:62003,tcp://172.31.27.1:62012,tcp://172.30.27.1:62014)"
failover="true" dynamicOnly="true" />
    </networkConnectors>

  </broker>
</beans>
---------------


Then I did a properties config file like this:

----------
brokerName=MASTERUBUNTU
transportConnector=tcp://172.31.112.9:62002
networkConnector=static://(tcp://172.31.112.9:62003,tcp://172.31.27.1:62012,tcp://172.30.27.1:62014)
-----------


And in my code I did:


------------
service = new BrokerService();
service.setBrokerName(masterBrokerProps.getProperty("brokerName"));
service.setPersistent(true);
service.addConnector(masterBrokerProps
       .getProperty("transportConnector"));

NetworkConnector nc = new DiscoveryNetworkConnector(
      			new URI(masterBrokerProps.getProperty("networkConnector")));
nc.setDynamicOnly(false);
        	
service.addNetworkConnector(nc);

if (service != null) {
      service.start();
}
--------------------


Now I wonder if this is ok and how could I add the "failover="true""
setting in my code..

Nevertheless, when I start my service I receive the message:

-------------
2:53:20,940 WARN  [NetworkConnector] Could not start network bridge
between: vm://MASTERUBUNTU?network=true and: tcp://172.31.112.9:62003
due to: java.net.ConnectException: Connection refused
12:53:25,944 INFO  [NetworkConnector] Establishing network connection
between from vm://MASTERUBUNTU?network=true to
tcp://172.31.112.9:62003
12:53:25,945 WARN  [NetworkConnector] Could not start network bridge
between: vm://MASTERUBUNTU?network=true and: tcp://172.31.112.9:62003
due to: java.net.ConnectException: Connection refused
12:53:28,028 WARN  [NetworkConnector] Could not start network bridge
between: vm://MASTERUBUNTU?network=true and: tcp://172.31.27.1:62012
due to: java.net.SocketTimeoutException: connect timed out
12:53:28,028 INFO  [NetworkConnector] Establishing network connection
between from vm://MASTERUBUNTU?network=true to tcp://172.31.27.1:62012
--------------

And my JBoss server hangs...

This error never happens with the xml configuration. What am I doing wrong ?

Also, I need to change the JMX port, how could I do it ?


Thanks in advance.



-- 
Javier Leyba
Barcelona - Spain
Mime
View raw message