mulesoft 入门与实践-1

来源:互联网 发布:超级直播软件apk 编辑:程序博客网 时间:2024/06/15 19:16

mulesoft 入门与实践-1

从今天开始也进入csdn博客一族, 独学而无友,则孤陋而寡闻。所以知识还是要分享出来,一方面加深自己的理解,另一方面有不足的地方,大神们也可以指出来。

———-

mulesoft 的anypoint studio 是一个可视化的开发工具,使得开发变得非常的简单,只需要拖拽几个简单的组件就可以完成一个web项目。在多系统集成方面非常有优势 。

下面来演示一个hello world的例子:

1.打开anypoint studio, File->New->Mule project

这里写图片描述

2.project-name: hello-world, Runtime:3.8.5. 然后点击finish

这里写图片描述

3.在打开的hello-world.xml 中拖入http 组件

这里写图片描述

4.配置http组件, connector configuration 点击加号 添加http listener
host-> localhost post-> 8099(可以根据自己喜欢配置)
这里写图片描述

http配置path-> /hello

这里写图片描述

5.从mule palette 拖入set payload 组件放入flow中
这里写图片描述

6.双击set payload 组件,在value中写入hello world

这里写图片描述

7.运行工程, hello-world工程右键–>run as–> mule application, 观察log,没有报错,并且出现下面的状态信息,说明服务已经起成功

这里写图片描述

8.测试api, 浏览器中输入http://localhost:8099/hello, 返回hello world

这里写图片描述

不到5分钟的时间做出来一个web 工程,有没有很简单!

ps: 喜欢本文的加关注哦,如果有问题,可以留言,我们一起讨论。

原创粉丝点击