Mule Routers
Routers in Mule ESB play major roles to control the workflows. The router takes input, do the analysis and take the decision that will decide the next destination for the message. It is similar to the control statements in java language like if, if-else, switch etc. In Mule platform, they created many routers already to save the time of the developer while create the workflow.
Mule - Accessing / Processing posted form-data
The data received from the POST request in the content type of "form-data", mule gives the access to that data from the message using inboundAttachements.
Mule 3 - Getting Post form-data content
In mule 3, there is following way to get the data submitted thought the POST request in form-data.
Pragmatically Spring MVC example without using XML (Pure java based configuration)
After we have the Servlet 3 version, we have the option to ignore the web.xml file in our java based web application. Similarly, Spring gives us the option to ignore its XML based configuration in new releases. So, you can create the Spring MVC application without having any xml file in it. See the Example.
Here the java code to create the Web application initializer. Implementation of WebApplicationInitializer interface gives the provision to provide the configuration that would have in web.xml file
Mule - JSON to Object Transformer
This Transformer converts the json string into java object. You can specify the type of object as well. Here is the example for using the json to object transformer.
Spring MVC Template maven pom file
Here is the example for the POM file which could be used to create the Spring MVC project with Hibernate.
Mule 3 Payload
Payload it the data recevied or set in the flow. If flow is hit by some external source, the submitted data found in the payload and you can set the payload manually in the flow as well.
The type of the payload depends on the source that is generating the payload. For example, if you use the JSON to Object Transformer, the payload type would be the type of the class you specified as return class of the component Josn to Object transformer. The payload could be HashMap object in which you retrives the data by using the key in the get method.
Mule Java Transformer
Mule allows to use the custom java tranformer in which you can write your own loigic to process the message. Message is passed to this object and this object returns the Message after having the execution completed. The return Object of this tranformer bacome the message for the next component.