MULE ESB Config Snippet: Most Simple Flow

For the first sample I create, I show all the details, subsequently I will only quote the configuration file.

  1. Create a new Mule Project
    (without sample code)

    New Mule Project

  2. Create a new configuration
    (add only standard I/O)

    New Configuration

    New Configuration

  3. 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.

  4. 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)
  5. 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>
    

     

  6. 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)

    Run Mule Server

    Mule Server Running

Advertisements

One thought on “MULE ESB Config Snippet: Most Simple Flow

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s