Global Config - neilcatalan/MUnit-Implementation GitHub Wiki

Below is the global configuration used for the flows. Noticed that I make use the property place holder which can be change to "test" or "prod".

<context:property-placeholder location="mule.${env}.properties"/>

<spring:beans>
	<spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" 
	destroy-method="shutdown" name="jdbcDataSourceBean">
	    <spring:property name="driverName" value="${db.driver}"/>
	    <spring:property name="url" value="${db.url}"/>
	    <spring:property name="user" value="${db.user}"/>
	    <spring:property name="password" value="${db.password}"/>
	</spring:bean>
	
	<!--
	ADDITIONAL CONFIGURATION FOR THE EMBEDDED ACTIVEMQ INSTANCE (USE IF NEEDED)
	ADD THE FOLLOWING NAMESPACE WHEN ADDING BELOW ADDITIONAL CONFIG.:
	xmlns:amq="http://activemq.apache.org/schema/core"
	xsi:schemaLocation="http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"
	-->
	
	<!-- 
	<amq:broker id="amq-broker"
        useJmx="false"
        persistent="false"
        restartAllowed="false"
        useShutdownHook="true"
        startAsync="true">
        <amq:destinationPolicy>
            <amq:policyMap>
                <amq:policyEntries>
                    <amq:policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
                        <amq:deadLetterStrategy>
                            <amq:individualDeadLetterStrategy
                                queuePrefix="DLQ." useQueueForQueueMessages="true" />
                        </amq:deadLetterStrategy>
                    </amq:policyEntry>
                </amq:policyEntries>
            </amq:policyMap>
        </amq:destinationPolicy>
        <amq:transportConnectors>
            <amq:transportConnector uri="vm://localhost"/>
        </amq:transportConnectors>
    </amq:broker>

    <spring:bean name="amqRedeliveryPolicy" class="org.apache.activemq.RedeliveryPolicy">
        <spring:property name="maximumRedeliveries" value="-1"/>
        <spring:property name="initialRedeliveryDelay" value="500"/>
        <spring:property name="useExponentialBackOff" value="false"/>
        <spring:property name="backOffMultiplier" value="5"/>
        <spring:property name="maximumRedeliveryDelay" value="-1"/>
    </spring:bean>
    
    <spring:bean name="amqConnectionFactory"
        class="org.apache.activemq.ActiveMQConnectionFactory"
        depends-on="amq-broker">
        <spring:property name="brokerURL" value="${jms.borker.url}"/>
    </spring:bean> 
    -->
    
    <!-- WILL START EMBEDDED ACTIVEMQ INSTANCE -->
    <spring:bean name="amqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
        <spring:property name="brokerURL" value="${jms.borker.url}"/>
    </spring:bean>
</spring:beans>

<db:generic-config name="Generic_Database_Configuration" dataSource-ref="jdbcDataSource" doc:name="Generic Database Configuration"/>

<jms:connector name="JMS_Connector_Configuration" 
connectionFactory-ref="amqConnectionFactory" specification="1.1" doc:name="JMS" validateConnections="true" maxRedelivery="-1"/>

<http:request-config name="HTTP_Request_Configuration" host="${http.host}" port="${http.port}" 
basePath="/" doc:name="HTTP Request Configuration"/>