Christian Posta bio photo

Christian Posta

Field CTO at solo.io, author Istio in Action and Microservices for Java Developers, open-source enthusiast, cloud application development, committer @ Apache, Serverless, Cloud, Integration, Kubernetes, Docker, Istio, Envoy #blogger

Twitter Google+ LinkedIn Github Stackoverflow

Word on the street is that Camel tastes good. Well, I can't vouch for that (as I haven't tried it...), but what I can vouch for is that working with Apache Camel for integration projects is awesome! If you haven't bridled this beast of burden for some integration work, then I bet you've been wasting a lot of time :) ... And if you're looking for tried-and-true patterns or recipes for working with this integration library, then I highly recommend Scott Cranton and Jakub Korab's excellent book: "Apache Camel Developer's Cookbook"

Lest you remind me you already have Claus and Jon's Camel in Action book (which everyone does...), I'd like to bring to your attention that the Camel Cookbook is actually a perfect complement to the Camel in Action book. So you don't have to pick one over the other! They go together...

Camel in Action is actually a gentle intro to Camel, followed by a deep exploration of its features, capabilities, and internal workings. Claus and Jon help bring their profoundly deep knowledge of the subject to the community and is the perfect place to start when you first pick up Apache Camel. Once you've finished reading that book, you should be able to understand what Camel is, where it fits in a distributed-integration architecture, and how to develop integrations with its rich capabilities.

But if you troll the Camel mailing lists, stack overflow, or even consider that some of us are in the business of providing enterprise support for this capable library, you quickly realize that there are "right" ways to use the library or even "best practices". If nothing else, there are accepted ways that the library is used to solve common integration problems, and this book brings all of those "best practice" or "accepted practices" to the community in a nicely catalogued set of "recipes". You could spend days/months/years of trial and error combined with scrounging the webs for this info... or you could consider getting this book. I like to "get shit done"(TM) and if you're in the same boat, this book gets you there quicker.

Chapter 1: Structuring Routes

How best to structure your routes for reusability, asynchronous communication, pros/cons of Java DSL, Spring DSL (keep in mind all examples are in both Java DSL and Spring DSL), and controlling route lifecycle.

Chapter 2: Message Routing

Recipes for common and often used EIPs for routing: Content Based Routing, Filter, WireTap, RecipientList/Multicast, Throttler, Dynamic Router and more!

Chapter 3: Routing to your code

What are some of the best ways to abstract your code (so it doesn't have hard dependencies on Camel framework code) and how to participate in translation/transformations. Why use Processor vs Bean? And other gold nuggets...

Chapter 4: Transformation

Expressions, XQuery/XSLT, JAXB, JSON, parsing fixed-format/fixed-length files, etc, etc

Chapter 5: Splitting and Aggregating

The Composed Message Pattern + tricks for splitting in parallel, splitting very large files, and things to keep in mind when doing aggregations, etc.

Chapter 6: Parallel Processing

Increase throughput and load-balancing by taking advantage of Camel's threading model, asynchronous APIs, and EIPs.

Chapter 7: Error Handling and Compensation

Often overlooked area of Camel, understand fine details about Dead Letter Channel, retry, dynamic completion actions, at more...

Chapter 8: Transactions and Idempotency

Transactions, XA, messaging, idempotent consumers, complete with great examples..

Chapter 9: Testing

Using the mock component, testing in Spring, testing in Blueprint/OSGI, auto mocks, using AOP, validation under heavy load...

Chapter 10: Monitoring and Debugging

Often overlooked aspects, different styles of logging you can take advantage of out of the box, tracing, JMX, breakpoints

Chapter 11: Security

Encrypting messages, parts of mesasges, authentication/authorization + Spring Security (same concepts for Apache Shiro)

Chapter 12: Web Services

The finer details of using contract-first webservices, CXF component, proxying services.

Source Code!

Last but not least, you can get a wealth of knowledge from the accompanying source code. To be honest, a lot of times I grab a book from Packt-pub, the source code that goes along with the book is thin, half the time doesn't even compile, and overall kinda shoddy. But the source code that goes along with the book is easily worth the price of the book... All examples and recipes have a maven subproject full with unit tests and both Java DSL and Spring DSL samples.

Conclusion?!

I was honored to be asked to be an official reviewer of the book, so you may even find a short blurb in there about me (ha! that's all I have these days... working on writing a book soon though!) I had intended to bring my own knowledge on the subject to improve the book... but these guys were spot on with the material and the market they were trying to serve... therefore I had little to add :)

The book is pure gold and worth every bit of its sticker price. If you have an option to pick it up, I recommend it.