Mastering Apache Camel

Book description

An advanced guide to Enterprise Integration using Apache Camel

  • Integrate your applications with Apache Camel and enhance efficiency and scalability

  • Master all the EIPs supported by Apache Camel as well as advanced features like error handling and testing

  • Packed with practical examples and use cases that will help you excel in enterprise integration

  • In Detail

    This book will provide you with the skills you need to efficiently create routes using Apache Camel.

    After briefly introducing the key features and core concepts of Camel, the book will take you through all the important features and components, starting with routing and processors. You will learn how to use beans in Camel routes, covering everything from supported registries and annotations, to the creation of an OSGi bundle and writing route definitions with Blueprint DSL. Leverage the Enterprise Integration Patterns (EIPs) supported by Camel and implement them in your routes. You will then see how components and endpoints handle exchanges in Camel, and how you can use them to create a complete and powerful mediation framework. You will finally learn how to tackle errors and perform testing to ensure that your integration projects are working successfully.

    What You Will Learn

  • Walk through the key features and core concepts of Apache Camel

  • Implement routing with Processor, using Camel Java DSL and Camel Blueprint DSL

  • Use beans with Camel to access to the POJO model, and leverage IoC frameworks like Spring or Blueprint

  • Get to grips with the EIPs supported by Camel and implement them in your projects

  • Create polling and event-driven components, and learn how Camel uses components to create endpoints

  • Identify and deal with errors in your routing logic

  • Conduct unit tests and integration tests on your Camel routes

  • Publisher resources

    Download Example Code

    Table of contents

    1. Mastering Apache Camel
      1. Table of Contents
      2. Mastering Apache Camel
      3. Credits
      4. About the Author
      5. About the Reviewers
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
          3. Instant updates on new Packt books
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Key Features
        1. What is Apache Camel?
        2. Components and bean support
        3. Predicates and expressions
        4. Data format and type conversion
        5. Easy configuration and URI
        6. Lightweight and different deployment topologies
        7. Quick prototyping and testing support
        8. Management and monitoring using JMX
        9. Active community
        10. Summary
      9. 2. Core Concepts
        1. Messages
        2. Exchange
        3. Camel context
        4. Processor
        5. Routes
        6. Channels
        7. Domain Specific Languages (DSL)
        8. Component, endpoint, producer, and consumer
        9. Data format
        10. Type converter
        11. Summary
      10. 3. Routing and Processors
        1. What is a processor?
        2. An example of Camel routes containing processors
          1. Prefixer processor
          2. Creating a route using Java DSL
          3. Route using Camel Blueprint DSL
        3. Summary
      11. 4. Beans
        1. Registry
          1. SimpleRegistry
          2. JndiRegistry
          3. ApplicationContextRegistry
          4. OsgiServiceRegistry
        2. Creating CompositeRegistry
        3. Service activator
        4. Bean and method bindings
        5. Annotations
          1. Annotations for expression languages
        6. Example – creating an OSGi bundle with a bean
          1. Creating the MyBean class
          2. Writing a route definition using the Camel Blueprint DSL
        7. Building and deploying
        8. Summary
      12. 5. Enterprise Integration Patterns
        1. EIP processors
        2. Messaging systems EIPs
          1. Message Channel
          2. Message
          3. Pipeline
            1. The implicit pipeline
            2. The explicit pipeline
            3. Message router
          4. Message Translator
            1. The transform notation
            2. Using processor or bean
            3. Marshalling/umarshalling
          5. Message Endpoint
        3. Messaging channels EIPs
          1. Point To Point Channel
          2. Publish Subscribe Channel
          3. Dead Letter Channel
          4. Guaranteed Delivery
          5. Message Bus
        4. Message Construction EIPs
          1. The Event Message EIP
          2. The Request Reply EIP
          3. The Correlation Identifier EIP
          4. The Return Address EIP
        5. Message Routing
          1. The Content Based Router EIP
          2. The Message Filter EIP
          3. The Dynamic Router EIP
          4. Multicast and Recipient List EIPs
            1. The Multicast EIP
            2. The Recipient List EIP
          5. The Splitter and Aggregator EIPs
            1. The Splitter EIP
            2. Aggregator
          6. The Resequencer EIP
          7. The Composed Message Processor EIP
          8. The Scatter-Gather EIP
          9. The Routing Slip EIP
          10. The Throttler and Sampling EIPs
            1. The Throttler EIP
            2. The Sampling EIP
          11. The Delayer EIP
          12. The Load Balancer EIP
          13. The Loop EIP
        6. Message Transformation EIPs
          1. The Content Enricher EIP
          2. The Content Filter EIP
          3. The Claim Check EIP
          4. The Normalizer EIP
          5. The Sort EIP
          6. The Validate EIP
        7. The Messaging Endpoints EIPs
          1. The Messaging Mapper EIP
          2. The Event Driven Consumer EIP
          3. The Polling Consumer EIP
          4. The Competing Consumer EIP
          5. The Message Dispatcher EIP
          6. The Selective Consumer EIP
          7. The Durable Subscriber EIP
          8. The Idempotent Consumer EIP
          9. The Transactional Client EIP
          10. The Message Gateway and Service Activator EIPs
        8. System Management EIPs
          1. The ControlBus EIP
          2. The Detour EIP
          3. The Wire Tap EIP
          4. The Message History EIP
          5. The Log EIP
        9. Summary
      13. 6. Components and Endpoints
        1. Components
          1. Bootstrapping a component
        2. Endpoint
        3. A custom component example
        4. Summary
      14. 7. Error Handling
        1. Types of errors
          1. Recoverable errors
          2. Irrecoverable errors
        2. Camel error handlers
          1. Non-transacted error handlers
            1. DefaultErrorHandler
            2. DeadLetterChannel
            3. LoggingErrorHandler
            4. NoErrorHandler
          2. TransactedErrorHandler
        3. Error handlers scopes
        4. Error handler features
          1. Redelivery
          2. Exception policy
          3. Handling and ignoring exceptions
          4. A failover solution
          5. onWhen
          6. onRedeliver
          7. retryWhile
        5. Try, Catch, and Finally
        6. Summary
      15. 8. Testing
        1. Unit test approach with the Camel test kit
          1. ProducerTemplate
          2. JUnit extensions
            1. CamelTestSupport
            2. CamelSpringTestSupport
            3. CamelBlueprintTestSupport
          3. The mock component
            1. Using MockComponent
        2. A complete example
        3. Additional annotations
        4. Mocking OSGi services
        5. Summary
      16. Index

    Product information

    • Title: Mastering Apache Camel
    • Author(s): Jean-Baptiste Onofré
    • Release date: June 2015
    • Publisher(s): Packt Publishing
    • ISBN: 9781782173151