01 lab primer mule 3 configuration (ms)
TRANSCRIPT
Module 01-Fundamental Mule 3
Module 1 Lab Primer - Mule 3 Configuration
All contents Copyright 2011, MuleSoft Inc.
Use Case Overview
All contents Copyright 2011, MuleSoft Inc.
Minor Simplification
All contents Copyright 2011, MuleSoft Inc.
Final Result (Client perspective)
All contents Copyright 2011, MuleSoft Inc.
Final Result (Developer Perspective)
All contents Copyright 2011, MuleSoft Inc.
First Task
All contents Copyright 2011, MuleSoft Inc.
Hello World Equivalent
SFO 500
All contents Copyright 2011, MuleSoft Inc.
Simplest Ticket Component
public class SimpleTicketPriceComponent {public String priceRequest(String airportCode) throws Exception{
if(airportCode.equals("SFO")){
return "300";}else if (airportCode.equals("MLT")){
return "1300";}else if(airportCode.equals("HEL")){
return "300";}else{
return "Unknown code "+airportCode;
}}
}
What about using a Map instead of static values?
What about making the component configurable through Spring?
All contents Copyright 2011, MuleSoft Inc.
STDIO Connector Primer
<stdio:connector name="stdioConnector"
promptMessage="Enter Airport Code:"messageDelayTime="500"
outputMessage="Price:"/>
All contents Copyright 2011, MuleSoft Inc.
Other Snippets
<stdio:inbound-endpoint system="IN"/><stdio:outbound-endpoint system="OUT"/>
<component class="…"/><component>
<spring-object bean="BeanId"/></component>
<spring:bean id="BeanId"><spring:property name="priceMap">
<spring:map><spring:entry key="SFO">
<spring:value>500</spring:value></spring:entry>
…
All contents Copyright 2011, MuleSoft Inc.
Practical Lab
Take input from console in the form of airport code:– MLT, SFO, HEL
Display the price of the ticket to screen:– 300,400
Must create POJO and use it as a component in the configuration
Optional:– Make POJO configurable through configuration
– Configure STDIO connector to have a more
user friendly application
All contents Copyright 2011, MuleSoft Inc.
Downloads
Getting Started with the IDE
Download Eclipse
Mule IDE
Java SDK
Mule Enterprise Trial