更新时间:2021-07-19 18:46:57
coverpage
Apache Camel Developer's Cookbook
Credits
About the Authors
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What is Camel?
Camel Concepts
The Camel DSL
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Structuring Routes
Introduction
Using Camel in a Java application
Embedding Camel in a Spring application
Using Camel components
Reusing routing logic by connecting routes
Asynchronously connecting routes
Spanning Camel contexts within a single Java process
Using external properties in Camel routes
Reusing endpoints
Reusing routing logic through template routes
Controlling route startup and shutdown
Chapter 2. Message Routing
Content Based Routing
Filtering out unwanted messages
Wire Tap – sending a copy of the message elsewhere
Multicast – routing the same message to many endpoints
Recipient List – routing a message to a list of endpoints
Throttler – restricting the number of messages flowing to an endpoint
Request-response route sending a one-way message
One-way route waiting on a request-response endpoint
Dynamic Routing – making routing decisions at runtime
Load balancing across a number of endpoints
Routing Slip – routing a message to a fixed list of endpoints
Chapter 3. Routing to Your Code
Routing messages directly to a Java method
Sending messages directly to a Camel endpoint
Using a Java method as a Predicate
Writing a custom Camel Processor
Mapping the message to method parameters
Writing a custom data marshaller
Writing a custom data type converter
Chapter 4. Transformation
Transforming using a Simple Expression
Transforming inline with XQuery
Transforming with XSLT
Transforming from Java to XML with JAXB
Transforming from Java to JSON
Transforming from XML to JSON
Parsing comma-separated values (CSV)
Enriching your content with some help from other endpoints
Normalizing messages into a common XML format
Chapter 5. Splitting and Aggregating
Splitting a message into fragments
Splitting XML messages
Processing split messages in parallel
Aggregating related messages
Aggregating with timeouts
Aggregating with intervals
Processing aggregated messages in parallel
Splitting a message and processing and gathering responses
Splitting messages and re-aggregating them using different criteria
Chapter 6. Parallel Processing
Increasing message consumption through multiple endpoint consumers
Spreading the load within a route using a set of threads
Routing a request asynchronously
Using custom thread pools
Using thread pool profiles
Working with asynchronous APIs
Chapter 7. Error Handling and Compensation
Logging errors
Dead Letter Channel – handling errors later
Retrying an operation
Conditional retry
Customizing each redelivery attempt
Catching exceptions
Marking exceptions as handled
Fine-grained error handling using doTry…doCatch
Defining completion actions
Defining completion actions dynamically
Chapter 8. Transactions and Idempotency
Preventing duplicate invocation of routing logic
Transactional file consumption
Using transactions with a database
Limiting the scope of a transaction