multicastdb

Created: 2011-07-18 12:35
Updated: 2013-11-10 08:16
License: apache-2.0

README.md

Active MQ discovery transport with a Data Base

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.

Configuration

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>

TODO list

  • Get Spring context without SpringHook classe
  • Add factory for JDBCAdapter
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more