FIRST STEPS. .......................................................1
1 Meeting Camel 3
1.1 Introducing Camel 4
What is Camel? 4 ■ Why use Camel? 5 ■ Getting
started 8 ■ Getting Camel 8 ■ Your first Camel ride 9
1.2 Camel’s message model 13
Message 13 ■ Exchange 14
1.3 Camel’s architecture 15
Architecture from 10,000 feet 15 ■ Camel concepts 16
1.4 Your first Camel ride, revisited 20
1.5 Summary 21
x CONTENTS
2 Routing with Camel 22
2.1 Introducing Rider Auto Parts 23
2.2 Understanding endpoints 24
Working with files over FTP 24 ■ Sending to a JMS queue 26
2.3 Creating routes in Java 28
Using the RouteBuilder 29 ■ The Java DSL 30
2.4 Creating routes with Spring 34
Bean injection and Spring 34 ■ The Spring DSL 37 ■ Using
Camel and Spring 40
2.5 Routing and EIPs 43
Using a content-based router 44 ■ Using message filters 49
Using multicasting 50 ■ Using recipient lists 52 ■ Using the
wireTap method 55
2.6 Summary and best practices 57
PART 2 CORE CAMEL ....................................................59
3 Transforming data with Camel 61
3.1 Data transformation overview 62
Data transformation with Camel 62
3.2 Transforming data using EIPs and Java 63
Using the Message Translator EIP 63 ■ Using the Content
Enricher EIP 70
3.3 Transforming XML 73
Transforming XML with XSLT 73 ■ Transforming XML with
object marshaling 75
3.4 Transforming with data formats 77
Data formats provided with Camel 78 ■ Using Camel’s CSV data
format 79 ■ Using Camel’s Bindy data format 80 ■ Using
Camel’s JSON data format 83 ■ Configuring Camel data
formats 84 ■ Writing your own data format 85
3.5 Transforming with templates 86
Using Apache Velocity 87
3.6 About Camel type converters 88
How the Camel type-converter mechanism works 88 ■ Using Camel
type converters 90 ■ Writing your own type converter 90
3.7 Summary and best practices 92
CONTENTS xi
4 Using beans with Camel 93
4.1 Using beans the hard way and the easy way 94
Invoking a bean from pure Java 94 ■ Invoking a bean defined in
Spring 95 ■ Using beans the easy way 96
4.2 The Service Activator pattern 97
4.3 Camel’s bean registries 98
SimpleRegistry 100 ■ JndiRegistry 101 ■ ApplicationContext-
Registry 101 ■ OsgiServiceRegistry 102
4.4 Selecting bean methods 103
How Camel selects bean methods 104 ■ Camel’s method-selection
algorithm 105 ■ Some method-selection examples 107
Potential method-selection problems 109
4.5 Bean parameter binding 111
Binding with multiple parameters 112 ■ Binding using built-in
types 113 ■ Binding using Camel annotations 114 ■ Binding
using Camel language annotations 115
4.6 Summary and best practices 119
5 Error handling 120
5.1 Understanding error handling 121
Recoverable and irrecoverable errors 121 ■ Where Camel’s error
handling applies 123
5.2 Error handlers in Camel 124
The default error handler 125 ■ The dead letter channel error
handler 126 ■ The transaction error handler 128 ■ The no error
handler 128 ■ The logging error handler 128 ■ Features of the
error handlers 128
5.3 Using error handlers with redelivery 129
An error-handling use case 129 ■ Using redelivery 130 ■ Error
handlers and scopes 135 ■ Handling faults 137
5.4 Using exception policies 138
Understanding how onException catches exceptions 139 ■ Understanding
how onException works with redelivery 142 ■ Understanding how
onException can handle exceptions 143 ■ Custom exception
handling 146 ■ Ignoring exceptions 148 ■ Implementing an error
handler solution 149
5.5 Other error-handling features 150
Using onWhen 150 ■ Using onRedeliver 151 ■ Using
retryWhile 152
5.6 Summary and best practices 153
xii CONTENTS
6 Testing with Camel 154
6.1 Introducing the Camel Test Kit 155
The Camel JUnit extensions 155 ■ Using the Camel Test Kit 156
Unit testing with the CamelTestSupport class 156 ■ Unit testing an
existing RouteBuilder class 159 ■ Unit testing with the SpringCamel-
TestSupport class 159 ■ Unit testing in multiple environments 161
6.2 Using the Mock component 166
Introducing the Mock component 167 ■ Unit testing with the Mock
component 167 ■ Verifying that the correct message arrived 169
Using expressions with mocks 170 ■ Testing the ordering of
messages 174 ■ Using mocks to simulate real components 175
6.3 Simulating errors 178
Simulating errors using a processor 178 ■ Simulating errors using
mocks 180 ■ Simulating errors using interceptors 180
6.4 Testing without mocks 183
Integration testing 183 ■ Using NotifyBuilder 185
6.5 Summary and best practices 187
7 Understanding components 188
7.1 Overview of Camel components 189
Manually adding components 190 ■ Autodiscovering components 190
7.2 Working with files (File and FTP components) 192
Reading and writing files with the File component 193 ■ Accessing remote
files with the FTP component 196
7.3 Asynchronous messaging (JMS component) 197
Sending and receiving messages 200 ■ Request-reply
messaging 201 ■ Message mappings 202
7.4 Web services (CXF component) 205
Configuring CXF 206 ■ Using a contract-first approach 209
Using a code-first approach 215
7.5 Networking (MINA component) 216
Using MINA for network programming 217 ■ Using custom codecs 219
7.6 Working with databases (JDBC and JPA components) 221
Accessing data with the JDBC component 221 ■ Persisting objects with the
JPA component 224
7.7 In-memory messaging (Direct, SEDA, and VM
components) 229
Synchronous messaging with the Direct component 229
Asynchronous messaging with SEDA and VM 230
CONTENTS xiii
7.8 Automating tasks (Timer and Quartz components) 232
Using the Timer component 232 ■ Enterprise scheduling with
Quartz 233
7.9 Summary and best practices 235
8 Enterprise integration patterns 237
8.1 Introducing enterprise integration patterns 238
The Aggregator and Splitter EIPs 238 ■ The Routing Slip and
Dynamic Router EIPs 239 ■ The Load Balancer EIP 239
8.2 The Aggregator EIP 239
Introducing the Aggregator EIP 240 ■ Completion conditions for
the Aggregator 243 ■ Using persistence with the Aggregator 248
Using recovery with the Aggregator 251
8.3 The Splitter EIP 255
Using the Splitter 256 ■ Using beans for splitting 258 ■ Splitting
big messages 260 ■ Aggregating split messages 262 ■ When errors
occur during splitting 264
8.4 The Routing Slip EIP 266
Using the Routing Slip EIP 267 ■ Using a bean to compute the
routing slip header 267 ■ Using an Expression as the routing
slip 268 ■ Using @RoutingSlip annotation 269
8.5 The Dynamic Router EIP 270
Using the Dynamic Router 270 ■ Using the @DynamicRouter
annotation 271
8.6 The Load Balancer EIP 272
Introducing the Load Balancer EIP 272 ■ Load-balancing
strategies 274 ■ Using the failover load balancer 275 ■ Using a
custom load balancer 278
8.7 Summary and best practices 280
PART 3 OUT IN THE WILD ............................................281
9 Using transactions 283
9.1 Why use transactions? 284
The Rider Auto Parts partner integration application 284 ■ Setting
up the JMS broker and the database 287 ■ The story of the lost
message 288
9.2 Transaction basics 289
About Spring’s transaction support 290 ■ Adding
transactions 291 ■ Testing transactions 293
xiv CONTENTS
9.3 The Transactional Client EIP 296
Using local transactions 297 ■ Using global transactions 298
9.4 Configuring and using transactions 301
Configuring transactions 301 ■ Using transactions with multiple
routes 303 ■ Returning a custom response when a transaction
fails 306
9.5 Compensating for unsupported transactions 309
Introducing UnitOfWork 309 ■ Using Synchronization
callbacks 310 ■ Using onCompletion 312
9.6 Summary and best practices 313
10 Concurrency and scalability 315
10.1 Introducing concurrency 316
Running the example without concurrency 318 ■ Using
concurrency 318
10.2 Using thread pools 323
Understanding thread pools in Java 323 ■ Camel thread pool
profiles 326 ■ Creating custom thread pools 328 ■ Using
ExecutorServiceStrategy 329
10.3 Using concurrency with EIPs 330
Using concurrency with the Threads EIP 331 ■ Using concurrency
with the Multicast EIP 332 ■ Using concurrency with the Wire
Tap EIP 334
10.4 Synchronicity and threading 335
Asynchronous caller using one thread 336 ■ Synchronous caller
using one thread 337 ■ Asynchronous caller using multiple
threads 339 ■ Synchronous caller using multiple threads 340
Returning an early reply to a caller 342
10.5 The concurrency client API 344
The concurrency client API in Java 344 ■ The concurrency client
API in Camel 347
10.6 The asynchronous routing engine 350
Hitting the scalability limit 350 ■ Scalability in Camel 352
Components supporting asynchronous processing 353
Asynchronous API 354 ■ Writing a custom asynchronous
component 356
10.7 Summary and best practices 358
CONTENTS xv
11 Developing Camel projects 359
11.1 Managing projects with Maven 360
Using Camel Maven archetypes 360 ■ Camel Maven
dependencies 364 ■ Using Camel in Eclipse 366 ■ Using the
Maven Eclipse plugin 366 ■ Using the m2eclipse plugin 368
11.2 Developing custom components 371
Setting up a new Camel component 371 ■ Diving into the
implementation 373
11.3 Developing interceptors 377
Creating an InterceptStrategy 377
11.4 Using alternative languages 380
The Scala DSL 380 ■ Adding Scala routes to the CamelContext 382
Mixing Java and Scala 382
11.5 Summary and best practices 384
12 Management and monitoring 385
12.1 Monitoring Camel 386
Checking health at the network level 386 ■ Checking health at the
JVM level 388 ■ Checking health at the application level 388
12.2 Using JMX with Camel 389
Using JConsole to manage Camel 390 ■ Using JConsole to remotely
manage Camel 391
12.3 Tracking application activity 393
Using log files 393 ■ Using core logs 394 ■ Using custom
logging 394 ■ Using Tracer 398 ■ Using notifications 402
12.4 Managing Camel applications 405
Managing Camel application lifecycles 405 ■ Managing custom
Camel components 406
12.5 Summary and best practices 409
13 Running and deploying Camel 410
13.1 Starting Camel 411
How Camel starts 411 ■ Camel startup options 413 ■ Ordering
routes 416 ■ Disabling autostartup 418
13.2 Starting and stopping routes at runtime 419
Using CamelContext to start and stop routes at runtime 420
Using RoutePolicy to start and stop routes at runtime 422
xvi CONTENTS
13.3 Shutting down Camel 424
Graceful shutdown 425
13.4 Deploying Camel 428
Embedded in a Java application 428 ■ Embedded in a web
application 430 ■ Embedded in JBoss Application Server 436
13.5 Camel and OSGi 437
Setting up Maven to generate an OSGi bundle 438 ■ Installing
and running Apache Karaf 439 ■ Deploying the example 440
13.6 Summary and best practices 441
14 Bean routing and remoting 443
14.1 Using beans for routing 444
Inventory update at Rider Auto Parts 444 ■ Receiving messages
with @Consume 445 ■ Sending messages with @Produce 448
When to use beans for routing 450
14.2 Hiding middleware 451
Introducing the starter kit 453 ■ Using Spring remoting and
Camel proxies 456
14.3 Summary and best practices 460
appendix A Simple, the expression language 461
appendix B Expressions and predicates 471
appendix C The producer and consumer templates 477
appendix D The Camel community 483
appendix E Akka and Camel 487
index 501
xvii

camel in action相关推荐

  1. Camel In Action 读书笔记 (1)

    2019独角兽企业重金招聘Python工程师标准>>> <h2 align="center">Camel's message model --- Ca ...

  2. 关于Camel In Action 的理解

    为什么80%的码农都做不了架构师?>>>    写在前面,前提,最近用公司的平台开发一个应用系统用到了Camel就对此做了一些了解.把一些理解的概念或者用法 拿出来给大家分享.希望对 ...

  3. Camel In Action 读书笔记 (8)

    2019独角兽企业重金招聘Python工程师标准>>> 第8章Enterprise integration patterns是core Camel的最后一章了,第二章已经介绍了一部分 ...

  4. java camel from uri_java – 如何将Camel属性加载到Bean中?

    我一直在阅读关于Camel属性的以下页面: http://camel.apache.org/using-propertyplaceholder.html并且还阅读了"Camel In Act ...

  5. Apache Camel框架之事务控制

    http://blog.csdn.net/kkdelta/article/details/7249122 本文简单介绍一下Apache Camel如何对route进行事务控制,首先介绍整个route只 ...

  6. apache camel_REST端点,可使用Apache Camel进行集成

    apache camel REST是一种用于组织资源的体系结构样式,当应用于基于HTTP的服务时,REST可以构建无状态,分离的可伸缩服务. HTTP方法,HTTP标头和mime类型都允许开发人员实现 ...

  7. camel eip_Apache Camel教程– EIP,路由,组件,测试和其他概念的简介

    camel eip 公司之间的数据交换增加了很多. 必须集成的应用程序数量也增加了. 这些接口使用不同的技术,协议和数据格式. 但是,这些应用程序的集成应以标准化的方式建模,有效实现并由自动测试支持. ...

  8. Apache Camel教程– EIP,路由,组件,测试和其他概念的简介

    公司之间的数据交换增加了很多. 必须集成的应用程序数量也增加了. 这些接口使用不同的技术,协议和数据格式. 但是,这些应用程序的集成应以标准化的方式建模,有效实现并由自动测试支持. 企业集成模式(EI ...

  9. REST端点,可使用Apache Camel进行集成

    REST是一种用于组织资源的体系结构样式,当应用于基于HTTP的服务时,REST可以构建无状态的,解耦的,可伸缩的服务. HTTP方法,HTTP标头和mime类型都允许开发人员实现REST样式. 诸如 ...

最新文章

  1. 没有“好的”数据,AI就没有未来?听听云测数据怎么说
  2. LeetCode 669. Trim a Binary Search Tree修剪二叉搜索树 (C++)
  3. CTF——MISC——流量分析
  4. oracle删错表了怎么办,Oracle中表被删除或数据被错误修改后的恢复方法
  5. java数组二分查找的简单例题_Java基础-练习 数组元素二分查找(折半查找)
  6. Java内存管理:深入Java内存区域
  7. 【2017年第1期】智慧城市多源异构大数据处理框架
  8. c语言规范标准c99中文版下载,c99标准找到了,中文HTML页面
  9. VS2013/2012 下无法打开 源 文件“stdafx.h”的解决方法
  10. 继英伟达、三星后,育碧也遭攻击,员工密码重置
  11. linux raid
  12. 关于命令行启动MySQL服务的相关问题
  13. 上海计算机二级考c语言真题及答案,上海市二级考C语言真题.doc
  14. 两台电脑之间大文件怎么传输用什么软件?
  15. python中如何判断词性_Python自然语言处理 5 分类和标注词汇
  16. 学到了林海峰,武沛齐讲的Day16完
  17. 解决import cv2找不到指定模块问题
  18. 《数字图像处理(第三版)》 第二章 数字图像基础 笔记1(视觉与电磁波谱)
  19. linux 符号执行,[原创]符号执行Symcc与模糊测试AFL结合实践
  20. 【学习笔记】狄利克雷卷积

热门文章

  1. 【数据结构与算法】之深入解析“TinyURL加密与解密”的求解思路与算法示例
  2. PyTorch tensorboard报错:TensorBoard logging requires TensorBoard version 1.15 or above
  3. 2019第十届蓝桥杯C/C++ B组省赛 —— 第二题:年号字串
  4. 《信息学奥赛一本通》 高精除以低精。输入两个正整数,求它们的商(做整除)。
  5. 【Linux】一步一步学Linux——gcc命令(249)
  6. 【Android】Android中WIFI开发总结(一)
  7. php简单的mysql类_一个简单的php mysql操作类
  8. python lambda函数加法_python lambda的使用详解
  9. pythonasyncio在哪个版本好_什么情况下需要使用 Python 的 asyncio 模块?
  10. MySQL的MyISAM和InnoDB存储引擎表结构