Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Using Mule with Spring

Mule leverages the Spring framework for developing Java applications. Mule ESB 3.7 supports the latest version of the framework, Spring 4.1.6, making use of the Eclipse-based development environment.

Mule App XML Configuration File

The most common way to configure Mule is with Spring XML files that use custom Mule namespaces.

Use one of the two namespaces in your spring framework schema in Mule:

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

  • 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.

  • Single application context

  • Multiple application context

  • Existing application context

  • Existing application context as parent

Build Spring beans to define component behaviors which Mule applications can reference.

Spring Bean Definition Profiles

Mule’s configuration file takes advantage of Spring 4.1’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. Refer to Spring’s blog posting for more information about bean definition profiles.