Contact Us 1-800-596-4880

Using Mule with Spring

Mule leverages the Spring framework for developing Java applications.

Supported Spring Versions

  • Mule 3.8: Spring 4.1.9 and Spring Security 4.0.4

  • Mule 3.7.5: Spring 4.1.9 and Spring Security 4.0.4

  • Mule 3.7.0 - 3.7.4: Spring 4.1.6 and Spring Security 4.0.1

  • Mule 3.6 and earlier: Spring 3.2 and Spring Security 3.0

XML Configuration File

The way to configure a Mule application is with an XML file that uses custom Mule namespaces. By default, a Spring configuration builder takes this XML file to create Mule artifacts and register them with a Mule runtime instance.

Use one of the two namespaces in your Mule XML Configuration file:

  • http://www.springframework.org/schema/beans

  • http://www.springframework.org/schema/beans/spring-beans-current.xsd

Spring Application Contexts

Mule offers several options for creating and managing Spring Application Contexts for your application.

Build Spring beans to define component behaviors which Mule applications can reference. See Using Spring Beans as Flow Components

Spring Bean Definition Profiles

Mule’s XML configuration file takes advantage of Spring 4.1.6’s ability to create bean definition profiles. You can use Spring bean definition profiles to register different beans for different target environments, instead of using one bean for all target environments. For more information, see Bean Definition profiles in the Spring Framework Reference.