Active MQ is an open source messaging. To use it in an cluster environnement we can use UDP multicast discovery. Unfortunatly musticast is not supported in a lot of cloud offer like Amazon EC2. So this module use a Data Base to reference all broker.
For the moment I need a hook to get Spring Context. So please insert this bean in your Spring configuration :
<bean id="sContext" class="com.netliard.SpringHook"/>
And use multicastdb instead of multicast
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="url" value="jdbc:derby:target/derbyDB;create=true" />
<property name="username" value="" />
<property name="password" value="" />
</bean>
<bean id="jmsFactory" class="org.apache.activemq.pool.PooledConnectionFactory" destroy-method="stop">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<value>discovery:(multicastdb://default?dataSource=myDataSource)?initialReconnectDelay=100</value>
</property>
</bean>
</property>
</bean>
<amq:broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" persistent="false">
<transportConnectors>
<transportConnector uri="tcpcloud://localhost:12122" discoveryUri="multicastdb://default?dataSource=myDataSource"/>
</transportConnectors>
</amq:broker>
- Get Spring context without SpringHook classe
- Add factory for JDBCAdapter