关于Camel In Action 的理解

      写在前面,前提,最近用公司的平台开发一个应用系统用到了Camel就对此做了一些了解。把一些理解的概念或者用法

拿出来给大家分享。希望对此有更深理解的人给予点评和指证。

    OSGI+Camel+SpringDM 这个环境的搭建基础软件。在一个Camel的应用中就像Spring一样有一个CamelContext的实例在

组织单个或者多个的Router(路由)、其中ProducerTemplate 和CusmerTemplate起到了至关重要的作用。

    ProducerTemplate 是将消息发送到路由中的一个客户端(暂且这么理解),它有两种模式InOnly和InOut 。

InOnly是只发送消息不管响应结果,就像发送邮件一样,点击发送的时候只知道邮件发送出去了,但不知道对方是否收到。

InOut 刚好相反,是在发送了消息后要等待一个结果的回应,可以是同步、也可以是异步。当在异步发送的时候可以设置

具体的等待时间,要求在具体等待的时间范围内返回具体的、被期望的结果。否则就会产生超时异常。

    CusmerTemplate 只有InOnly模式,是一个消费者,仅存在一些接收消息的方法,刚好和上面的生产者模板相反,是在

轮询等待接收消息的一个模板接口。

具体的例子或者代码就不在此赘述了。有理解和描述不当之处请批评、指证。

转载于:https://my.oschina.net/dolor/blog/65370

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
中文名: Camel 实战 原名: Camel in Action 作者: Claus Ibsen Jonathan Anstey 资源格式: PDF 版本: 英文文字版/更新源代码 出版社: Manning书号: 9781935182368发行时间: 2010年12月 地区: 美国 语言: 英文 简介: 内容介绍: Apache Camel is a Java framework that lets you implement the standard enterprise integration patterns in a few lines of code. With a concise but sophisticated DSL you snap integration logic into your app, Lego-style, using Java, XML, or Scala. Camel supports over 80 common transports such as HTTP, REST, JMS, and Web Services. Camel in Action is a Camel tutorial full of small examples showing how to work with the integration patterns. It starts with core concepts like sending, receiving, routing, and transforming data. It then shows you the entire lifecycle and goes in depth on how to test, deal with errors, scale, deploy, and even monitor your app—details you can find only in the Camel code itself. Written by the developers of Camel, this book distills their experience and practical insights so that you can tackle integration tasks like a pro. 目录: Part 1 First steps 1 Meeting Camel 2 Routing with Camel Part 2 Core Camel 3 Transforming data with Camel 4 Using beans with Camel 5 Error handling 6 Testing with Camel 7 Understanding components 8 Enterprise integration patterns Part 3 Out in the wild 9 Using transactions 10 Concurrency and scalability 11 Developing Camel projects 12 Management and monitoring 13 Running and deploying Camel 14 Bean routing and remoting appendix A Simple, the expression language appendix B Expressions and predicates appendix C The producer and consumer templates appendix D The Camel community appendix E Akka and Camel

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值