Apache Camel Developer's Cookbook: Solve Common Integration
Total Page:16
File Type:pdf, Size:1020Kb
Apache Camel Developer's Cookbook Solve common integration tasks with over 100 easily accessible Apache Camel recipes Scott Cranton Jakub Korab BIRMINGHAM - MUMBAI Apache Camel Developer's Cookbook Copyright © 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: December 2013 Production Reference: 1181213 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78217-030-3 www.packtpub.com Cover Image by VisitRenoTahoe.com and Reno-Sparks Convention and Visitors Authority (RSCVA) Credits Authors Project Coordinator Scott Cranton Anugya Khurana Jakub Korab Proofreaders Reviewers Simran Bhogal Bilgin Ibryam Maria Gould Claus Ibsen Christian Posta Indexers Hemangini Bari Phil Wilkins Tejal R. Soni Acquisition Editors Saleem Ahmed Graphics Ronak Dhruv Sam Wood Abhinash Sahu Lead Technical Editor Ankita Shashi Production Coordinator Arvindkumar Gupta Technical Editors Dipika Gaonkar Cover Work Arvindkumar Gupta Pramod Kumavat Tarunveer Shetty About the Authors Scott Cranton is an open source software contributor and evangelist. He has been working with Apache Camel since the release of version 1.5 almost 5 years ago, and has over 20 years of commercial experience in middleware software as a developer, architect, and consultant. During his time at FuseSource, and now Red Hat, he has worked closely with many core committers for Apache Camel, ActiveMQ, ServiceMix, Karaf, and CXF. He has also helped many companies successfully create and deploy large and complex integration and messaging systems using Camel and other open source projects. He divides his professional time between hacking code, delivering webinars on using Camel and open source, and helping companies to learn how to use Camel to solve their integration problems. I want to thank my amazing wife, Mary Elizabeth, for putting up with me these many years, and always answering the phone when I'd call late at night from the office while I've got a compile going. This book would not have been possible without her always being there for me no matter what. To my three wonderful children, Gilbert, Eliza, and Lucy, who always make me smile especially during crazy weekend writing sessions when they'd want me to take a break, "… but Dad, it's the weekend…" I love you all! Jakub Korab is a consulting software engineer specializing in integration and messaging. With a formal background in software engineering and distributed systems, in the 14 years that he has worked in software across the telecoms, financial services, and banking industries, he naturally gravitated from web development towards systems integration. When he discovered Apache Camel, it became apparent to him how much time and effort it could have saved him in the past compared to writing bespoke integration code, and he has not looked back since. Over the years, working as a consultant, he has helped dozens of clients build scalable, fault-tolerant, and performant systems integrations. He currently runs his own specialist consultancy, Ameliant, which focuses on systems integration and messaging using a stack of integration products from the Apache Software Foundation, of which Camel is a corner stone. When not gluing systems together, you will find him spending time with his young family, and far too infrequently kitesurfing or skiing—neither of which he gets much chance to do in his adopted home, London. The writing of this book has taken place against the background of starting a new company, a huge amount of work travel, a quickly growing baby, house move, and hundreds of little distractions that get in the way of sitting down in what is left of the day to put pen to paper. It could never have happened without the love, support, and understanding of my wife, Anne-Marie. It has been a team effort. Thank you. Also to my little girl, Alex, for helping me keep it all in perspective. Acknowledgments We would like to thank the Apache Camel community for being so awesome. Very welcoming and vibrant, they have always been willing to answer questions and accept code contributions. Big thanks to the many, many Camel community members. We would like to also thank all the reviewers, editors, and unseen people in the background. Getting a book out is a substantial project of which the writing is only one part, and it could not have happened without you. Thanks to Rob Davies, Claus Ibsen, and the whole Fuse team for showing us how much fun open source is by always being there to answer questions, geek out about some new project, and drinking beer on those rare occasions when we could get together. It's been a real pleasure working with you all, and we hope it continues for a long time. Special thanks to James Strachan for being so James; your infectious enthusiasm and love of writing code makes you truly inspirational to all those who meet you. We hope to keep playing with you on any and all of your latest new projects. About the Reviewers Bilgin Ibryam is a software engineer with master's degree in Computer Science and he currently works for Red Hat as Middleware Consultant. His passions include distributed applications, message-oriented middleware, and application integration. He is the author of a book about Apache Camel and Enterprise Integration Patterns called Instant Apache Camel Message Routing. He is also heavily involved with open source and is a committer to Apache OFBiz, and other Apache Camel projects. In his spare time, he enjoys contributing to open source projects and blogging at http://ofbizian.com. He can be contacted via his Twitter handle @bibryam. Claus Ibsen has worked as a software engineer, architect, and consultant for more than 15 years. For the past five years he has been working full time as an open source developer at FuseSource and Red Hat in the middleware team, on the Fuse products. He has worked extensively on the Apache Camel project for over six years, being the top contributor, and has given talks at conferences about integration using Apache Camel. He is author of Camel in Action, Manning Publications, 2011. I would like to congratulate Scott and Jakub for stepping up and writing this fantastic book. It is great to see the Camel community grow from strength to strength. This book will help new users to become more successful with "riding" Apache Camel, and experienced users can find valuable information from many of its recipes. Christian Posta is based in Phoenix, AZ, and is a Principal Consultant and Architect. He specializes in messaging-based enterprise integrations with high scalability and throughput demands. He has been in development for over 10 years covering a wide range of domains; from embedded systems to UI and UX design and lots of integration in between. He's passionate about software development, loves solving tough technical problems, and enjoys learning new languages and programing paradigms. His favorite languages are Python and Scala, but he spends a lot of time writing Java too. He is a committer on Apache Camel, Apache ActiveMQ, and Apache Apollo projects as well as PMC on ActiveMQ. He blogs about Camel, ActiveMQ, and integration at http://www.christianposta.com/blog as well as tweets about interesting technology on his Twitter handle @christianposta. Thanks to Scott and Jakub for asking me to review the book. I think this work is the ultimate complement to the other Camel book. The material cuts right to the chase and shows you how to accomplish otherwise challenging integrations using this wonderful library. Phil Wilkins has spent nearly 25 years in the software industry working with both multinationals and software startups. He started out as a developer and has worked his way up through technical and development management roles. The last 12 years have been primarily in Java-based environments. He now works as an enterprise technical architect within the IT group for a global optical healthcare manufacturer and retailer. Outside of his work commitments, he has contributed his technical capabilities to supporting others in a wide range of activities from the development of community websites to providing input and support to people authoring books, and developing software ideas and businesses. When not immersed in work and technology, he spends his free time pursuing his passion for music and time with his wife and two boys. I'd like to take this opportunity to thank my wife Catherine and our two sons Christopher and Aaron for their tolerance for the innumerable hours that I've spent in front of a computer contributing to both my employer and the many other IT related activities that I've supported over the years. www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy.