Book description
For Apache Camel developers, this is the book you’ll always want to have handy. It’s stuffed full of great recipes that are designed for quick practical application. Expands your Apache Camel abilities immediately.
- A practical guide to using Apache Camel delivered in dozens of small, useful recipes
- Written in a Cookbook format that allows you to quickly look up the features you need, delivering the most important steps to perform with a brief follow-on explanation of what’s happening under the covers
- The recipes cover the full range of Apache Camel usage from creating initial integrations, transformations and routing, debugging, monitoring, security, and more
In Detail
Apache Camel is a de-facto standard for developing integrations in Java, and is based on well-understood Enterprise Integration Patterns. It is used within many commercial and open source integration products. Camel makes common integration tasks easy while still providing the developer with the means to customize the framework when the situation demands it. Tasks such as protocol mediation, message routing and transformation, and auditing are common usages of Camel.
Apache Camel Developer's Cookbook provides hundreds of best practice tips for using Apache Camel in a format that helps you build your Camel projects. Each tip or recipe provides you with the most important steps to perform along with a summary of how it works, with references to further reading if you need more information. This book is intended to be a reliable information source that is quicker to use than an Internet search.
Apache Camel Developer's Cookbook is a quick lookup guide that can also be read from cover to cover if you want to get a sense of the full power of Apache Camel. This book provides coverage of the full lifecycle of creating Apache Camel-based integration projects, including the structure of your Camel code and using the most common Enterprise Integration patterns. Patterns like Split/Join and Aggregation are covered in depth in this book.
Throughout this book, you will be learning steps to transform your data. You will also learn how to perform unit and integration testing of your code using Camel's extensive testing framework, and also strategies for debugging and monitoring your code. Advanced topics like Error Handling, Parallel Processing, Transactions, and Security will also be covered in this book.
This book provides you with practical tips on using Apache Camel based on years of hands-on experience from hundreds of integration projects.
Table of contents
-
Apache Camel Developer's Cookbook
- Table of Contents
- Apache Camel Developer's Cookbook
- Credits
- About the Authors
- Acknowledgments
- About the Reviewers
- www.PacktPub.com
- Preface
-
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
-
2. Message Routing
- Introduction
- 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
- 3. Routing to Your Code
-
4. Transformation
- Introduction
- 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
-
5. Splitting and Aggregating
- Introduction
- 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
- 6. Parallel Processing
-
7. Error Handling and Compensation
- Introduction
- 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
-
8. Transactions and Idempotency
- Introduction
- Preventing duplicate invocation of routing logic
- Transactional file consumption
- Using transactions with a database
- Limiting the scope of a transaction
- Rolling back a transaction
- Using transactions with messaging
- Idempotency inside transactions
- Setting up XA transactions over multiple transactional resources
-
9. Testing
- Introduction
- Testing routes defined in Java
- Using mock endpoints to verify routing logic
- Replying from mock endpoints
- Testing routes defined in Spring
- Testing routes defined in OSGi Blueprint
- Auto-mocking of endpoints
- Validating route behavior under heavy load
- Unit testing processors and Bean Bindings
- Testing routes with fixed endpoints using AOP
- Testing routes with fixed endpoints using conditional events
-
10. Monitoring and Debugging
- Introduction
- Logging meaningful steps within your route
- Debugging using logging
- Throughput logging
- Enabling step-by-step tracing in code
- Disabling JMX
- Configuring JMX
- Naming your routes to make it easier to monitor
- Adding JMX attributes and operations
- Monitoring other systems using the Camel JMX Component
- Setting breakpoints in your routes
- 11. Security
- 12. Web Services
- Index
Product information
- Title: Apache Camel Developer's Cookbook
- Author(s):
- Release date: December 2013
- Publisher(s): Packt Publishing
- ISBN: 9781782170303
You might also like
book
Mastering Apache Camel
An advanced guide to Enterprise Integration using Apache Camel Integrate your applications with Apache Camel and …
book
Cloud Native Integration with Apache Camel: Building Agile and Scalable Integrations for Kubernetes Platforms
Address the most common integration challenges, by understanding the ins and outs of the choices and …
book
Microservices for Java Developers, 2nd Edition
Is microservice architecture right for your organization? Microservices have many benefits, but they also come with …
book
Camel in Action
NEWER EDITION AVAILABLE Camel in Action, Second Edition is now available. An eBook of this older …