Mule 3 - Whats new in Mule 3
Top features of Mule 3 are -
1. Flow
A Flow is a simple yet very flexible mechanism that enables orchestration of services using the message flow capabilities of Mule ESB. Using Flow, you may automate integration processes of Mule ESB.
Below is a simple example of Hello World through flow
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.3.0" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd ">
<flow name="Hello_WorldFlow1" doc:name="Hello_WorldFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8086" doc:name="HTTP"/>
<echo-component doc:name="Echo"/>
</flow>
</mule>
2. Hot deployment
Prior to Mule 3, hot deployment was not supported. It means that we were forced to restart the Mule container whenever we made any changes to the routing configuration. Impact could be minimized by running multiple mule instances in a distributed manner but it was a burden. In Mule 3, we can deploy our application in $MULE_HOME/apps directory and add our libs and configuration file. Mule will pick up this file and start our application. Mule will keep on checking if any changes has been made in the config file inside app directory. If yes, then Mule will reload this configuration and libraries.
3. Annotations
Mule 3 supports concept of annotations. Annotations can be used for different purposes from creating a transformer to message payloads as shown in below example.
e.g. message payload
public class MyComponent {
public Object process(@Mule("message.payload") String payload) {
// do stuff
}
}
e.g. transformer
You can create a transformer by performing the conversion in a method that you annotate with the @Transformer annotation. At runtime, this method will be discovered and registered with Mule. Then, whenever an Mule needs to convert from a String to a URL, this transformer will be used.
@ContainsTransformerMethods // since Mule 3.0.1
public class MyTransformers
{
@Transformer
public URL stringToURL(String string) throws MalformedURLException
{
return new java.net.URL(string);
}
}
You can find different type of annotations @ http://www.mulesoft.org/documentation/display/current/Creating+Flow+Objects+and+Transformers+Using+Annotations
4. Cloud connectors
Mule 3 offers cloud connectors for Magento,Mongo DB,Salesforce and Twitter
Comments
Post a Comment