Mule ESB的component(二)——Component的使用
来源:互联网 发布:sql注入攻击检测工具 编辑:程序博客网 时间:2024/04/26 10:52
一 Mule自带的component
打开mule的核心jar包mule-core-3.0.0.jar,可以看到如下结构,期中simple中的component即mule自带的component:
1. bridge component
mule中的每一个service中都会包含一个bridge component,它被隐式的引用了:
定义:This is the bridge component. As its name suggests, it bridges its inbound router to its outbound router, but doesn’t perform any particular operation on the message.
从定义中看,bridge component的作用是将message从inbound传递到outbound中,期间它对message没有任何操作。
在《Mule-ESB-3-User-Guide》中找到一段关于PassThroughComponent的描述,bridge component的默认实现类应该就是PassThroughComponent:
- Service Bridge
- Service component configuration is optional in Mule 2.x. The default and implicit component used is PassThroughComponent . This component
- automatically bridges inbound messages to the outbound phase and simply passes messages to the outbound routers. This approach is useful for
- bridging endpoints if you want to pass a message from one transport to another.
2. echo component和log component
两者都是为了记录信息,从源码中分析,两者的关联是EchoComponent extends LogComponent,前者调用父类的方法进行日志输出。两者的差别是:echo将message的信息全部输出,而log会默认截取前100个长度的信息。
使用方法如下图,log component使用<log-component />替换<echo-component />:
3. null component
从源码中可以看到,当NullComponent接收到信息时,会抛出一个异常:
- package org.mule.component.simple;
- import org.mule.api.MuleEventContext;
- import org.mule.api.lifecycle.Callable;
- /**
- * <code>NullComponent</code> is a service that is used as a placeholder. This
- * implementation will throw an exception if a message is received for it.
- */
- public class NullComponent implements Callable
- {
- public Object onCall(MuleEventContext context) throws Exception
- {
- throw new UnsupportedOperationException("This service cannot receive messages. Service is: "
- + context.getFlowConstruct().getName());
- }
- }
使用方法
4. StaticComponent
这个没有找到先关的资料,从api中可以看到该类的描述:
A service that will return a static data object as a result. This is useful for testing with expected results. The data returned can be read from a file or set as a property on this service.
这个component应该是mule用于测试时设置期望数据的组件。
二 远程调用
mule支持远程调用,它支持RPC和REST两类调用,由于对这两块技术是空白,所以大家自己研究吧= =!
- Mule ESB的component(二)——Component的使用
- Mule ESB的component(三)——Java Component
- Mule ESB的component(一)——概念介绍
- Mule ESB Component配置摘要
- ESB之Mule ESB的使用
- hibernate的Component使用
- @Component注解的使用
- ESB构架的MULE
- Mule ESB的filter
- Mule ESB 学习笔记mule和jersey的整合使用
- OWC(Office Web Component)的使用
- <context:component-scan> 的使用
- ESB构架的MULE ActiveMQ
- Mule ESB 的一些基本概念
- Mule ESB 的基本概念(一)
- RESTLET开发实例(二)使用Component、Application的REST服务
- RESTLET开发实例(二)使用Component、Application的REST服务
- SWT应用之:随机RGB颜色、ScrolledComposite控件的使用(二)————SWT Component(SWT组件)使用
- 编写高度可维护javascript代码的几点关键性原则
- java 多线程并发执行
- HDU1102 Constructing Roads 最小生成树
- C++ Primer(类)
- 高性能服务开发之定时器
- Mule ESB的component(二)——Component的使用
- Apache commons chain简介和简单实现
- Error:Command /usr/bin/codesign failed with exit code 1
- androidstudio导入opencv
- 页面错误有哪些类型
- 排列算法总结
- Mule ESB的component(三)——Java Component
- CMD批处理循环,太强大了
- PHP学习大全