mule 异步方式是一种单向调用,调用者不需要获得响应。
来源:互联网 发布:卡尔曼滤波算法视频 编辑:程序博客网 时间:2024/05/17 23:52
异步方式通过inbound和outbound endpoint的exchange-pattern=”one-way”实现。
使用基本的Stdio Transport验证,通过标准输入传输字符串,将其原样传递给标准输出进行显示。相应配置如下:
stdio-asynchronous-single.xml
Java代码
1. <?xml version="1.0" encoding="UTF-8"?>
2. <mule xmlns="http://www.mulesoft.org/schema/mule/core"
3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4. xmlns:spring="http://www.springframework.org/schema/beans"
5. xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
6. xsi:schemaLocation="
7. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
8. http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
9. http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/current/mule-stdio.xsd">
10.
11. <stdio:connector name="stdioConnector"
12. messageDelayTime="1234"
13. outputMessage="abc"
14. promptMessage="bcd"
15. promptMessageCode="456"
16. />
17.
18.
19. <model name="model">
20. <service name="echo">
21. <inbound>
22. <stdio:inbound-endpoint system="IN" exchange-pattern="one-way" />
23. </inbound>
24.
25. <component>
26. <singleton-object class="com.easyway.esb.mule.stdio.StdIo" />
27. </component>
28. <outbound>
29. <pass-through-router>
30. <stdio:outbound-endpoint system="OUT" exchange-pattern="one-way" />
31. </pass-through-router>
32. </outbound>
33. </service>
34. </model>
35. </mule>
测试代码:
Java代码
1. String configFile = "stdio-asynchronous-single.xml";
2. String[] configFileArr = new String[] {configFile };
3. MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
4. MuleContext muleContext = muleContextFactory.createMuleContext(new SpringXmlConfigurationBuilder(
5. configFileArr));
6. muleContext.start();
异步方式适用于简单的消息传递的场景。
- mule 异步方式是一种单向调用,调用者不需要获得响应。
- Mule ESB 学习笔记 异步请求-响应方式
- 异步方式调用WinInet
- mule学习笔记(八):代理方式调用服务
- 使用异步方式调用WebService
- WinINet的异步调用方式
- C#异步调用WebService方式
- PHP异步调用实现方式
- xcode 中异步调用 WebService 获得大数据量的处理方式
- 获得调用者信息
- 一种动态方式调用dll中类
- 一种动态方式调用dll中类
- 函数调用的第一种方式(补充)
- WebService第一种方式发布和调用
- 运用委托是注意异步调用
- 异步调用Web Service的方式
- 使用异步方式调用同步方法
- 使用异步方式调用同步方法
- WPF常用控件资源汇集
- 无头单链表删除一个节点
- uint8_t数据类型
- Macos svn命令行工具
- 博客收集
- mule 异步方式是一种单向调用,调用者不需要获得响应。
- WebClient上传文件Jsp接受文件流数据
- a4j:jsFunction不会执行oncomplete方法的原因
- C#调用WIN32 的API函数--USER32.DLL
- 网络监控数据中心的设置
- 织梦dede怎样去掉后台登陆界面广告
- 使用memcached显著提升站点性能
- LibSVM分类的实用指南
- 2_进制及进制转换