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

Using Mule Configuration Patterns

Introduction

Configuring Mule involves XML, and though using a decent XML editor can help a lot (thanks to the contextual help it provides from Mule’s schemas), there are still a enough angle brackets to warrant a coffee break as projects get more complicated. As the number of flows and components in a Mule project increases, so does the amount of noise in its configuration files, making it harder and harder to understand and maintain them. In Mule 3, we’ve decided to tackle this problem with the introduction of pattern-based configuration.

XML namespace:


         
      
1
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"

XML Schema location:


         
      
1
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.1/mule-pattern.xsd

When to Use a Pattern

A configuration pattern provides a very specific integration feature.

The following table will help you pick up the configuration pattern that fits your needs.

Pattern Name Usage

Simple Service

Exposes JAX-WS annotated components as SOAP web services. Exposes JAX-RS annotated beans as RESTful components. Can also handle JAXB, XML and raw content with simple POJO components.

Web Service Proxy

Proxies remote web services. Can perform transformations on the SOAP envelope. Can rewrite or redirect remote WSDLs to local ones.

Bridge

Establishes a direct conduit between an inbound endpoint and an outbound endpoint. Supports request-response and one-way bridging. Can perform transformations. Supports transactional bridging of inbound to outbound.

Validator

Validates inbound messages against a defined acceptance filter. Returns an ACK or NACK response synchronously and dispatches valid messages asynchronously.

HTTP Proxy

Sits between a caller application and a target web resource, propagating HTTP requests and responses. You can use it to access remote web resources in a controlled manner.

Should none of the existing patterns satisfy your need, turn to Using Flows for Service Orchestration for advanced configuration mechanisms.