Cooking with Camel: New Cookbook with Recipes for Apache Camel!
Join the DZone community and get the full member experience.Join For Free
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.
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.
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.
Published at DZone with permission of Christian Posta, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.