For the first sample I create, I show all the details, subsequently I will only quote the configuration file.
- Create a new Mule Project
(without sample code) - Create a new configuration
(add only standard I/O) - This is an empty configuration file. You will always start from here.
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd"> </mule
This does basically nothing.
-
The most basic concept you need to understand:
- A flow describes the sequence of activities that happen to a piece of information (message)
- You define one or more connectors
- A message comes from somewhere (inbound-endpoint)
- You do something to it (or not)
- The message goes somewhere (outbound-endpoint)
- The most simple flow I could think of: You enter a value at the console and you get it back at the console !
Refer to the stdio document for parameters.<?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd"> <stdio:connector name="stdioConnector" messageDelayTime="1000" promptMessage="IN: " outputMessage="OUT: " /> <flow name="SimpleFlow"> <stdio:inbound-endpoint system="IN" exchange-pattern="one-way" connector-ref="stdioConnector"/> <stdio:outbound-endpoint system="OUT" exchange-pattern="one-way" connector-ref="stdioConnector"/> </flow> </mule>
- Run (better Debug) the configuraion. Run as Mule Server
If you debug, you can terminate the Mule server from eclipse, if you run you wont be able to stop the server (due to some plugin bug I guess)