Apache ServiceMix应用之深入Apache Camel

本文介绍了Apache ServiceMix如何利用Apache Camel实现应用集成和服务路由,详细讲解了通过Blueprint和Spring容器发布Camel Routes的4种方式,并对各种方式的优缺点进行了对比分析。
摘要由CSDN通过智能技术生成

阅读本文章以前建议先阅读《Apache ServiceMix 初探》

预备知识:
BluePrint
OSGI
Maven
Java DSL
Apache Camel
Apache ActiveMQ

ESB最核心的功能便是应用集成和服务路由,Apache ServiceMix完成这两大核心功能的尖兵利器便是Apache Camel。Apache Camel是一个开源的、功能丰富的应用集成框架,它支持常见的EIP模式,是一个强大的基于规则的路由引擎,可以轻松的实现消息路由和消息转换,ServiceMix对Camel进行了深度集成来支持各种复杂的ESB功能。
关于Apache Camel的介绍:
    http://camel.apache.org/(主页)
    http://marshal.easymorse.com/archives/1431
    http://blog.csdn.net/njchenyi/article/details/5174261
关于EAI模式的介绍:
    http://www.eaipatterns.com/toc.html

发布路由的4种方式
在ServiceMix上发布Camel Routes有两大类4种方式,所谓的两大类是指:其一,直接通过简单的xml配置文件发布;其二,通过自定义bundle的方式发布。而每类下面既可以通过Spring容器发布又可以通过BluePrint容器发布,所以说有4种方式。下面对这4种方式进行介绍,然后比较他们的优缺点。
1、基于blueprint容器,通过简单的Blueprint XML文档发布路由,发布方式及实验见《Apache ServiceMix 初探》

<?xml version="1.0" encoding="utf-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
      http://www.osgi.org/xmlns/blueprint/v1.0.0
      http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
  <camelContext xmlns="http://camel.apache.org/schema/blueprint">
    <route>
      <from uri="file:camel/blueprin-plain-input"/>
      <log message="Copying ${file:name} to the output directory"/>
      <to uri="file:camel/blueprint-plain-output"/>
    </route>
  </camelContext>
</blueprint>
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值