Prerequisites

准备

  • You must have the JDK 5 or later installed on the computer where you will install Mule.
  • 你的电脑上必须安装了JDK5 或者更高版本的JDK。

Download and Install Mule

下载和安装Mule

  1. In your browser, go to the Mule download page.
  2. 打开浏览器,跳转至 Mule download page.
  3. Use the .zip button for Windows and the .tar.gz button for Linux/UNIX. On Linux/UNIX, if wget ships by default on your distribution, or if you have installed wget, you can also enter the following command in a terminal window to download Mule:
    wget http://dist.codehaus.org/mule/distributions/mule-standalone-3.2.0.tar.gz).

  4.  windows下载 .zip Linux/UNIX 下载 .tar.gz,如果安装了wget 也可以再命令行输入下面的命令安装Mule;
    wget http://dist.codehaus.org/mule/distributions/mule-standalone-3.2.0.tar.gz).

  5. Extract the files from it into the directory you want to use as your Mule home directory.
    Do not install Mule in a directory path that contains spaces!

    On Linux/UNIX, in a terminal window switch to your installation directory, and enter the following command:

    tar -xvzf mule-standalone-3.2.0.tar.gz

  6. 注意安装目录中不能出现空格 。在Linux/UNIX中 打开命令行输入下面的命令安装
    tar -xvzf mule-standalone-3.2.0.tar.gz

If you're upgrading from Mule ESB 2.2, read this: Previous versions of Mule ESB required setting an environment variable called MULE_HOME to run Mule. As of Mule 3.1, the MULE_HOME variable is no longer required. Make sure to remove this setting from your environment before running Mule 3.2. This is also true of a previously set MULE_BASE variable.
如果是从Mule ESB 2.2升级的,注意这段:3.x之前版本的Mule ESB需要设置环境变量MULE_HOME去运行Mule。但从3.1开始MULE_HOME已经不再需要了。在运行3.2版本的Mule前确认已经移除了MULE_HOME的环境变量

Install Eclipse and Mule IDE

To begin developing a Mule application, install the Mule IDE.

  1. If you do not have Eclipse version 3.4 or later, download the latest version of Eclipse fromhttp://www.eclipse.org/downloads/ and install it. MuleSoft recommends the Eclipse Java EE Developers package, but you can also install the Java Developers package.
  2. Start Eclipse, and set up a workspace for your installation of Mule. (Important: Make sure your workspace does not have a space in the directory path or the Mule application you develop will not run.)

For Eclipse version 3.5/3.6/3.7 (Galileo/Helios/Indigo) follow these steps to install Mule IDE:

  1. In the workbench view, click Help > Install New Software.
  2. Click the Add button next to the Work with text box, enter http://dist.muleforge.org/mule-ide/updates-2.1.x/ for the location, and pressEnter. The Mule IDE now appears in your list of available software.
  3. Select the Mule IDE check box and click Next. Eclipse will process for a moment. When Eclipse is finished processing, clickNext again.
  4. Review the Mule IDE license, select the option to accept the license, and then clickFinish.
  5. Click Yes to restart Eclipse.

If you are using Eclipse version 3.4 (Ganymede), read this:

  1. In the workbench view, choose Help > Software Updates.
  2. On the Available Software tab, click Add Site.
  3. Specify http://dist.muleforge.org/mule-ide/updates-2.1.x/ for the location and clickOK. It now appears in your list of available software.
  4. Expand the list until you see the Mule IDE. Choose Mule IDE and clickInstall.
  5. Click Next, read and accept the license agreement terms, and clickFinish.
  6. Choose to run the installation in the background.
  7. When prompted, restart Eclipse.

Configure the Mule Distribution

To execute Mule properly, you must specify in the IDE the location of your Mule distribution.

  1. In the Eclipse workbench, choose Window > Preferences. (On Mac OS X, chooseEclipse > Preferences.)
  2. Choose Mule, and then click Add
  3. Specify your Mule home directory. Then click OK.
  4. Select the Mule distribution's check box, click Apply, then clickOK.

Create a Mule Application

  1. Choose File > New > Project, expand the Mule folder and selectMule Project, and then click Next.
  2. Enter a name for the project, ensuring that there is no space in the project name. If you want to put the project in a location other than the default workspace, clear theUse default location check box and specify a new file location.
  3. Click Finish so the Mule IDE will generate your project. The project just created is added to the Package Explorer pane. The Mule libraries from the distribution you selected are contained in the project.
  4. Create a conf directory in your Mule project.
  5. Create a new file in the conf directory called "mule-config.xml."
  6. Add the following configuration to mule-config.xml:
<?xml version="1.0" encoding="UTF-8"?><mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:script="http://www.mulesoft.org/schema/mule/scripting"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.2/mule-scripting.xsd
      http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd" >
<simple-service name="hello" address="http://localhost:8080/hello">
        <script:component><script:script engine="groovy"><script:text>return "Hello World"</script:text></script:script></script:component></simple-service>
</mule>


Note that what you have just done is create a Mule application, which is XML-driven. When you create a configuration, you are creating an application.

Run the Application

  1. In the Package Explorer, expand the conf directory, and right-click themule-config.xml configuration file.
  2. Choose Run As > Mule Server.

A new run configuration is created automatically and the server is started. To trigger the Hello service, connect tohttp://localhost:8080/hello in your browser. The server should respond back with the text "Hello World."

That's it! You have a complete Mule development environment up and running and have created your first application.

Next Steps

  • Run the example launcher for the included examples to learn more about how to program Mule.
  • You can now modify the configuration file, or create a new configuration file as described in theMule IDE User Guide.
  • If you want to use Maven for a task such as using the Maven archetypes for creating transports and modules, seeSetting Up Eclipse for Use with Maven for complete instructions.

Hello, Mule!相关推荐

  1. Mule 官方例子研究

    Mule 官方例子研究 一.编译导入Mule自带的例子 1.准备 安装Mule.这里就不介绍mule的安装了,请参考<Mule安装部署手册>. 2. 编译Mule自带例子中的Hello例子 ...

  2. Mule,目前综合状态最良好的开源ESB方案

    原文地址: http://blog.csdn.net/calvinxiu/archive/2007/06/19/1657989.aspx ,版权所有,转载请保留原文链接,谢谢.-- 江南白衣 Mule ...

  3. Mule与Servicemix比较

    Servicemix的优点: 1,基于JBI规范: 2,可以热部署: 3,支持Camel(可以用DSL去开发集成流程): Servicemix的缺点: 1,JBI规范带来了使用上的繁琐,且JBI规范没 ...

  4. Mule3用户手册:Mule ESB 3使用要点

    Mule是一个灵活的消息处理和集成框架.你使用Mule的方式取决于你要尝试解决的问题.Mule3提供了多种配置构建方法,这些方法可以根据需要被混合和装配,来实现你的方案. l  理解Mule配置 l  ...

  5. Mule ESB-3.Build a webservice proxy

    自从引入ESB后,系统之间不再直接依赖,我负责的这块,主要是解决Webservice的问题,使系统A不再直接依赖系统B的Webservice. 我们选择的产品是Mule ESB,所以自然要使用Mule ...

  6. Mule ESB 学习笔记(11)Web Service Proxy(这里是一个可以正常运行的例子)

    一.WebSevice Proxy 简介      WebService Proxy 是ESB中最常见的使用场景之一,即通过 ESB 直接转发 WebService Client 的 SOAP 请求, ...

  7. MULE ESB学习笔记

    写之前的内容时,Mule刚刚3.0.1版本,很多官方文档还没有更新(尤其示例代码),维持在V2的状态.经过了一年多的时间,Mule社区版发展至了3.2版本,并且推出了Mule Studio可视化开发工 ...

  8. Mule ESB 学习笔记

    写之前的内容时,Mule刚刚3.0.1版本,很多官方文档还没有更新(尤其示例代码),维持在V2的状态.经过了一年多的时间,Mule社区版发展至了3.2版本,并且推出了Mule Studio可视化开发工 ...

  9. 一个基于Mule的企业服务总线的案例(关于JMS)

    面向服务架构的关键字之一就是ESB.以前很多厂商靠买消息服务器来提供集成交互的方案,然后出现了SOAP和REST. 早期的尝试基本上都是通过定一个固定的消息格式,例如xml来让各个系统交换.但是这些消 ...

  10. 通过MULE集成服务的几种方式

    6. 配置模式 Mule 3.0版本提供了"pattern"的机制.Pattern总结了实际使用过程中的常见场景,以简化的服务配置方式提供. 6.1 简单服务模式(simple s ...

最新文章

  1. 题目1051:数字阶梯求和
  2. Entity framewrok (linq to entity)查询优化的一点摸索
  3. java调用c写的dll jna_jna调用c编写的dll
  4. 微信开发之——Ubuntu Apache2的https域名配置
  5. 一天测血压的最佳时间_高血压病患者,一天之内在什么时间点测血压最好?
  6. tigervnc远程控制linux,CentOS 6.8 安装TigerVNC 实现 Linux 远程桌面(示例代码)
  7. Eltima SDK 中存在27个漏洞,影响多家云服务提供商
  8. 第二次作业刘惠惠2.6,2.15
  9. Javascript基础知识笔记四
  10. SSM-SpringMVC-15:SpringMVC中小论注解式开发之通配符篇
  11. 极光笔记 | 极光clickhouse千亿级数据分析实践之路
  12. html5 web报表工具,Web报表工具的填报功能
  13. 通用有限元软件简介及比较
  14. Oracle11g客户端client的下载与安装
  15. matlab根号二,matlab根号二怎么打_常见问题解析,matlab,根号二,根号
  16. 软件测试需求频繁变更,软件测试人员如何测试需求频繁变动的项目
  17. iOS系统 查看设备序列号 获取UDID
  18. SSH端口转发Forwarding及隧道Tunneling
  19. java 数组是连续存储吗_数组在Java中储存在()中_学小易找答案
  20. Android 军刀级神器:Magisk

热门文章

  1. 6月3号绝地求生服务器维护,2020年绝地求生6月3日更新维护开服时间 绝地求生6月3日更新维护了哪些...
  2. (实验4)单片机,STM32F4学习笔记,代码讲解【串口实验】【正点原子】【原创】
  3. ps43月24日服务器维修通告,From Software将于3月24日更新《黑暗之魂3》1.1版本补丁...
  4. round()函数,四舍五入
  5. android手机耗电快怎么办,手机耗电快怎么办、怎么解决?简单几步帮你延长手机续航...
  6. 无线蓝牙耳机性价比排行_2022最值得入手的蓝牙耳机推荐
  7. U-net 训练自己的数据集
  8. 【05】学生邮箱申请clion账号
  9. 联阳(ite) IT66021FN
  10. Mac实用技巧(二)—— 截图