This page contains links to resources you can download if you want to see the full Mule ESB presentation or run the demo locally on your machine. Please note, there are a few slides in the full version that I did not have time to cover in the talks. I am hopeful they are self-explanitory. There are a few steps to get the demo going, but I hope to simplify this some in the future. Please send us feedback on this page or the demo if something is not clear or you have a suggestion for improvement. And, feel free to mention if things worked and you learned something :-)
Pre-requisites
-
Download & install Java 6 - if not done already. Make sure you have JAVA_HOME set correctly.
-
Download & unpack Mule 2.2.1 - Grab the version labeled "Mule ESB Full Distribution" and be sure to set MULE_HOME to the new installation. If you have trouble finding the right version at MuleSource, then you can download Mule from this server.
Quick Test of Mule ESB
-
Start a command shell
-
cd to MULE_HOME/examples/echo
-
Run the echo.bat (for Windows) or echo (Mac/Unix) shell script
-
At the prompt, you should choose option 1 and hit return
NOTE: you will need to accept the Mule license only the first time you run Mule. -
Enter something when prompted by the echo demo and hit return
-
If all went well, then you will see the reply, which is what you typed in at the console as input.
-
Enter <Ctrl-C> to exit Mule
Setting up the demo
-
Download esb-demo.zip and unzip it somewhere on the filesystem
-
Configure the file system directories to match where you installed the esb-demo. Specifically, change the values for LOGMSG_IN_URI and LOGMSG_OUT_DIR appropriately.
on Windows, edit conf\win-file.properties
on Mac/Unix, edit conf/mac-file.properties - Configure the email and SMTP server properties appropriately (smtp.host, smtp.username, etc.)
NOTE: these properties are in conf/common.properties for both Windows and Mac, which currently expects you are able to run a mail server locally. I assume this is not the case, so you will want to use the same values you use for outbound email - e.g. your own SMTP settings. Do NOT use your POP3 inbound settings. The email.fromAddress should be an email account allowed by your ISP. Your main account would work well, yes?. The email.toAddress can be any email address, like a gmail account or the same as the email.fromAddress.
- Configure the SMS server properties appropriately [also in conf/common.properties]
NOTE: You can configure the SMTP and the SMS server properties to be the same. The sms.toAddress would only need a number change if you use AT&T. If you use T-Mobile or Verizon, or something else, then you will need to change the server part as well. A good reference for the different SMS email gateway servers can be found at http://en.wikipedia.org/wiki/List_of_carriers_providing_Email_or_Web_to_SMS
for verizon, use number@vtext.com
for t-mobile, use number@tmomail.netwhere 'number' is the 10 digit phone number without dashes
- Finally, edit the DEMO_HOME and MULE_HOME environment variables in the demo.bat or demo.sh files to match where you installed them. The run scripts are found in the bin folder under DEMO_HOME.
Running the demo
If you've done all the prep work above, you should be ready to run the demo.
-
Start Mule by running the appropriate shell script (bin/demo.bat or bin/demo.sh)
[You did edit the DEMO_HOME and MULE_HOME properties, right?] -
If Mule starts successfully, you should see the nice box of asterisks with the notice that Mule started. If not, then check your environment variable settings for MULE_HOME, JAVA_HOME, DEMO_HOME.
-
Open a new command shell window and cd to the logmsg folder under the esb-demo folder
-
Copy the logmsg.csv file into the folder named "in"
-
You should see activity in the Mule console window and if all went well, you should get an email with the WARNING
-
Copy the logmsg-I.xml file into the "in" folder and you should see some more activity. This message will be disposed, because it is only an INFO message.
-
Copy either (or both) of the logmsg-E.xml and/or logmsg-F.xml and you should see more activity. And, if you setup the SMS address correctly for your phone, you should get an SMS text message.
-
If the last step went well, then you can also run the LogMessageProducer program by executing the appropriate muleclient shell script. You will need to configure the MULE_HOME and DEMO_HOME environment variables in this shell script as you did for the main demo. This will produce four messages and send them to Mule using the MuleClient APIs provided by Mule.
-
In a second command/shell window, execute the muleclient script bin\muleclient.bat or bin/muleclient.sh
- If step 9 worked, then you can try the WebService demo. You will need to download SoapUI (soapui.org) or some other web service test client. You will also need to create the test database using your favorite DB. I use MySql and there is a SQL backup script you can use to create the database and the table used in the demo. Look in the sql folder at the root of the unzipped demo. You can just 'restore' this file using the MySQL Administrator. You will likely need to edit the jdbc.username and jdbc.password properties, also found in the common.properties file.
You will also need to edit the common-config.xml and uncomment the <spring:beans> block near the top. And, you will probably need to edit the common.properties file to ensure your JDBC properties are set correctly. If you are not running MySql, you will need to add the appropriate JDBC driver jar file the the lib folder and edit the demo script to add it to your CLASSPATH.
Once the Mule demo is running, you can get the WSDL for the service by pointing your browser (or SoapUI) at:
http://localhost:9999/services/LogMessageService?wsdl
SoapUI will create a test message for you, which you will need to edit. There is a sample request (found in the ws folder) you can paste as the complete SOAP request.
Once you've got the request created appropriately, send it by clicking the green "play" button. If all went well, you will see lots of success messages in the Mule console, get a SMS message, see that a new record was inserted into the db.
-
Enter Ctrl-C to stop Mule
-
That's all folks :-)
Messing with the source files
If you want to mess around with the source files. If so, then read on...
There is a build.xml file ready for you to type in "ant" at the command line. This assumes you have ant version 1.7 or later installed. Assuming you have no errors in code, it will compile all the source files found in the src folder. Once you've successfully compiled the source, just run the shell script again.
Have fun and good luck!
