Atnaujinkite slapukų nuostatas

Camel in Action, Second Edition 2nd edition [Minkštas viršelis]

4.11/5 (207 ratings by Goodreads)
  • Formatas: Paperback / softback, 912 pages, aukštis x plotis x storis: 235x188x48 mm, weight: 1520 g, Illustrations
  • Išleidimo metai: 17-Apr-2018
  • Leidėjas: Manning Publications
  • ISBN-10: 1617292931
  • ISBN-13: 9781617292934
  • Formatas: Paperback / softback, 912 pages, aukštis x plotis x storis: 235x188x48 mm, weight: 1520 g, Illustrations
  • Išleidimo metai: 17-Apr-2018
  • Leidėjas: Manning Publications
  • ISBN-10: 1617292931
  • ISBN-13: 9781617292934
DESCRIPTION

Apache Camel is a Java library that lets users implement the standard





enterprise integration patterns in a few lines of code.

Camel in Action, Second Edition is the most complete Camel book on the market. It starts with core concepts like sending, receiving, routing,

and transforming data and then shows readers the entire lifecycle. The

book goes in depth on how to test, deal with errors, scale, deploy, and

monitor apps and even how to build custom tooling. Written by core

developers of Camel and the authors of the first edition, this book distills their experience and practical insights so that readers can tackle integration tasks like a pro.









RETAIL SELLING POINTS

Uses the most up to date version of Camel.

New chapters on security, clustering, cloud integration, Docker, and Kubernetes.

Valuable examples in Java and XML.

Written by core developers of Camel.

Practical, insightful and comprehensive. AUDIENCE

Readers should have basic Java skills.

ABOUT THE TECHNOLOGY

Camel is an integration framework that aims to make users integration

projects productive and fun. One of the fundamental principles of Camel is

that it makes no assumptions about the type of data you need to process.

Camels focus is on simplifying integration.
Foreword xxiii
James Strachan
Foreword xxv
Mark Little
Foreword To The First Edition xxvii
Preface xxix
Acknowledgments xxxi
About This Book xxxiii
About The Authors xxxvii
About The Cover Illustration xxxix
Part 1 First Steps
1 Meeting Camel
3(24)
1.1 Introducing Camel
4(6)
What is Camel?
4(1)
Why use Camel?
5(5)
1.2 Getting started
10(8)
Getting Camel
10(1)
Your first Camel ride
11(4)
Camel's message model
15(1)
Message
15(1)
Exchange
16(2)
1.4 Camel's architecture
18(6)
Architecture from 10,000 feet
18(1)
Camel concepts
19(5)
1.5 Your first Camel ride, revisited
24(1)
1.6 Summary
25(2)
2 Routing with Camel
27(46)
2.1 Introducing Rider Auto Parts
28(1)
2.2 Understanding endpoints
29(4)
Consuming from an FTP endpoint
30(1)
Sending to a JMS endpoint
31(2)
2.3 Creating routes in Java
33(6)
Using RouteBuilder
34(1)
Using the Java DSL
35(4)
2.4 Defining routes in XML
39(10)
Bean injection and Spring
40(3)
The XML DSL
43(3)
Using Camel and Spring
46(3)
2.5 Endpoints revisited
49(6)
Sending to dynamic endpoints
49(1)
Using property placeholders in endpoint URIs
50(4)
Using raw values in endpoint URIs
54(1)
Referencing registry beans in endpoint URIs
54(1)
2.6 Routing and EIPs
55(16)
Using a content-based router
55(6)
Using message filters
61(1)
Using multicasting
62(4)
Using recipient lists
66(3)
Using the wireTap method
69(2)
2.7 Summary and best practices
71(2)
Part 2 Core Camel 73(166)
3 Transforming data with Camel
75(31)
3.1 Data transformation overview
76(1)
3.2 Transforming data by using EIPs and Java
77(10)
Using the Message Translator EIP
78(6)
Using the Content Enricher EIP
84(3)
3.3 Transforming XML
87(4)
Transforming XML with XSLT
87(1)
Transforming XML with object marshaling
88(3)
3.4 Transforming with data formats
91(8)
Data formats provided with Camel
92(1)
Using Camel's CSV data format
93(1)
Using Camel's Bindy data format
94(3)
Using Camel's JSON data format
97(1)
Configuring Camel data formats
98(1)
3.5 Transforming with templates
99(1)
Using Apache Velocity
99(1)
3.6 Understanding Camel type converters
100(5)
How the Camel type-converter mechanism works
101(1)
Using Camel type converters
102(1)
Writing your own type converter
103(2)
3.7 Summary and best practices
105(1)
4 Using beans with Camel
106(40)
4.1 Using beans the hard way and the easy way
107(4)
Invoking a bean from pureJava
108(1)
Invoking a bean defined in XML DSL
108(1)
Using beans the easy way
109(2)
4.2 Understanding the Service Activator pattern
111(2)
4.3 Using Camel's bean registries
113(6)
JndiRegistry
114(1)
SimpleRegistry
115(1)
ApplicationContextRegistry
116(1)
OsgiServiceRegistry and BlueprintContainerRegistry
116(1)
CdiBeanRegistry
117(2)
4.4 Selecting bean methods
119(9)
How Camel selects bean methods
120(1)
Camel's method-selection algorithm
121(2)
Some method-selection examples
123(2)
Potential method-selection problems
125(2)
Method selection using type matching
127(1)
4.5 Performing bean parameter binding
128(10)
Binding with multiple parameters
129(1)
Binding using built-in types
130(1)
Binding using Camel annotations
131(1)
Binding using Camel language annotations
132(4)
Parameter binding using method name with signature
136(2)
4.6 Using beans as predicates and expressions
138(6)
Using beans as predicates in routes
139(2)
Using beans as expressions in routes
141(3)
4.7 Summary and best practices
144(2)
5 Enterprise integration patterns
146(48)
5.1 Introducing enterprise integration patterns
146(2)
The Aggregator and Splitter EIPs
147(1)
The Routing Slip and Dynamic Router EIPs
148(1)
The Load Balancer EIP
148(1)
5.2 The Aggregator EIP
148(19)
Using the Aggregator EIP
149(3)
Completion conditions for the Aggregator
152(7)
Using persistence with the Aggregator
159(4)
Using recovery with the Aggregator
163(4)
5.3 The Splitter EIP
167(11)
Using the Splitter
167(3)
Using beans for splitting
170(2)
Splitting big messages
172(2)
Aggregating split messages
174(2)
When errors occur during splitting
176(2)
5.4 The Routing Slip EIP
178(4)
Using the Routing Slip EIP
179(1)
Using a bean to compute the routing slip header
179(1)
Using an Expression as the routing slip
180(1)
Using @RoutingSlip annotation
180(2)
5.5 The Dynamic Router EIP
182(2)
Using the Dynamic Router
182(1)
Using the ODynamicRouter annotation
183(1)
5.6 The Load Balancer EIP
184(8)
Introducing the Load Balancer EIP
184(2)
Using load-balancing strategies
186(2)
Using the failover load balancer
188(2)
Using a custom load balancer
190(2)
5.7 Summary and best practices
192(2)
6 Using components
194(45)
6.1 Overview of Camel components
195(4)
Manually adding components
196(1)
Autodiscovering components
196(3)
6.2 Working with files: File and FTP components
199(5)
Reading and writing files with the File component
200(3)
Accessing remote files with the FTP component
203(1)
6.3 Asynchronous messaging: JMS component
204(9)
Sending and receiving messages
208(1)
Request-reply messaging
209(1)
Message mappings
210(3)
6.4 Networking: Netty4 component
213(5)
Using Netty for network programming
214(2)
Using custom codecs
216(2)
6.5 Working with databases: JDBC and JPA components
218(8)
Accessing data with the JDBC component
218(3)
Persisting objects with the JPA component
221(5)
6.6 In-memory messaging: Direct, Direct-VM, SEDA, and VM components
226(4)
Synchronous messaging with Direct and Direct-VM
227(1)
Asynchronous messaging with SEDA and VM
228(2)
6.7 Automating tasks: Scheduler and Quartz2 components
230(3)
Using the Scheduler component
230(1)
Enterprise scheduling with Quartz
231(2)
6.8 Working with email
233(3)
Sending mail with SMTP
234(1)
Receiving mail with IMAP
235(1)
6.9 Summary and best practices
236(3)
Part 3 Developing And Testing 239(228)
7 Microservices
241(65)
7.1 Microservices overview
242(3)
Small in size
242(1)
Observable
243(1)
Designed for failure
243(1)
Highly configurable
244(1)
Smart endpoints and dumb pipes
244(1)
Testable
245(1)
7.2 Running Camel microservices
245(17)
Standalone Camel as microservice
245(2)
CDI Camel as microservice
247(5)
WildFly Swarm with Camel as microservice
252(4)
Spring Boot with Camel as microservice
256(6)
7.3 Calling other microservices
262(15)
Recommendation prototype
264(2)
Shopping cart prototype
266(4)
Rules and inventory prototypes
270(3)
Rating prototype
273(2)
Putting all the microservices together
275(2)
7.4 Designing for failures
277(27)
Using the Retry pattern to handle failures
277(2)
Using the Retry pattern without Camel
279(1)
Using Circuit Breaker to handle failures
280(2)
Netflix Hystrix
282(2)
Using Hystrix with Camel
284(3)
Configuring Hystrix
287(2)
Bulkhead pattern
289(3)
Calling other microservices with fault-tolerance
292(6)
Using Camel Hystrix with Spring Boot
298(3)
The Hystrix dashboard
301(3)
7.5 Summary and best practices
304(2)
8 Developing Camel projects
306(37)
8.1 Managing projects with Maven
307(6)
Using Camel Maven archetypes
307(4)
Using Maven to add Camel dependencies
311(2)
8.2 Using Camel in Eclipse
313(3)
Creating a new Camel project
313(3)
8.3 Debugging an issue with your new Camel project
316(2)
8.4 Developing custom components
318(8)
Setting up a new Camel component
318(2)
Diving into the implementation
320(6)
8.5 Generating components with the API component framework
326(12)
Generating the skeleton API project
326(2)
Configuring the camel-api-component-maven-plugin
328(3)
Setting advanced configuration options
331(4)
Implementing remaining functionality
335(3)
8.6 Developing data formats
338(3)
Generating the skeleton data format project
338(1)
Writing the custom data format
339(2)
8.7 Summary and best practices
341(2)
9 Testing
343(65)
9.1 Introducing the Camel Test Kit
345(4)
Using the Camel JUnit extensions
346(1)
Using camel-test to test Java Camel routes
346(3)
Unit testing an existing RouteBuilder class
349(1)
9.2 Testing Camel with Spring, OSGi, and CDI
349(19)
Camel testing with Spring XML
350(2)
Camel testing with Spring Java Config
352(4)
Camel testing with Spring Boot
356(2)
Camel testing with OSGi Blueprint XML
358(3)
Camel testing with CDI
361(2)
Camel testing with WildFly Swarm
363(1)
Camel testing with WildFly
364(4)
9.3 Using the mock component
368(10)
Introducing the mock component
369(1)
Unit-testing with the mock component
369(2)
Verifying that the correct message arrives
371(1)
Using expressions with mocks
372(4)
Using mocks to simulate real components
376(2)
9.4 Simulating errors
378(12)
Simulating errors using a processor
378(2)
Simulating errors using mocks
380(1)
Simulating errors using interceptors
381(1)
Using advice With to add interceptors to an existing route
382(1)
Using advice With to manipulate routes for testing
383(4)
Using weave with adviceWith to amend routes
387(3)
9.5 Camel integration testing
390(5)
Performing integration testing
391(2)
Using NotifiBuilder
393(2)
9.6 Using third-party testing libraries
395(10)
Using Arquillian to test Camel applications
395(4)
Using Pax Exam to test Camel applications
399(5)
Using other testing libraries
404(1)
9.7 Summary and best practices
405(3)
10 RESTful web services
408(59)
10.1 RESTful services
409(16)
Understanding the principles of a RESTful API
409(1)
Using JAX-RS with REST services
410(4)
Using Camel in an existing JAX-PS application
414(3)
Using camel-restlet with REST services
417(3)
Using camel-cxf with REST services
420(5)
10.2 The Camel Rest DSL
425(19)
Exploring a quick example of the Rest DSL
426(1)
Understanding how the Rest DSL works
427(2)
Using supported components for the Rest DSL
429(1)
Configuring Rest DSL
429(5)
Using XML and JSON data formats with Rest DSL
434(9)
Calling RESTful services using Rest DSL
443(1)
10.3 API documentation using Swagger
444(21)
Using Swagger with JAX-RS REST services
446(5)
Using Swagger with Rest DSL
451(1)
Documenting Rest DSL services
452(2)
Documenting input, output, and error codes
454(5)
Configuring API documentation
459(2)
Using COPS and the Swagger web console
461(4)
10.4 Summary and best practices
465(2)
Part 4 Going Further With Camel 467(156)
11 Error handling
469(45)
11.1 Understanding error handling
470(3)
Recoverable and irrecoverable errors
470(3)
Where Camel's error handling applies
473(1)
11.2 Using error handlers in Camel
473(8)
Using the default error handler
474(1)
The dead letter channel error handler
475(5)
The transaction error handler
480(1)
The no error handler
480(1)
The logging error handler
481(1)
Features of the el or handlers
481(1)
11.3 Using error handlers with redelivery
481(11)
An error-handling use case
482(1)
Using redelivery
482(2)
Using DefaultErrorHandler with redelivery
484(3)
Error handlers and scopes
487(3)
Reusing context-scoped error handlers
490(2)
11.4 Using exception policies
492(17)
Understanding how onException catches exceptions
492(4)
Understanding how onException works with redelivery
496(1)
Understanding how onException can handle exceptions
497(3)
Custom exception handling
500(2)
New exception while handling exception
502(1)
Ignoring exceptions
503(1)
Implementing an error-handler solution
504(1)
Bridging the consumer with Camel's error handler
505(4)
11.5 Working with other error-handling features
509(3)
Using onWhen
509(1)
Using onExceptionOccurred
510(1)
Using onRedeliver
511(1)
Using retryWhile
512(1)
11.6 Summary and best practices
512(2)
12 Transactions and idempotency
514(48)
12.1 Why use transactions?
515(6)
The Rider Auto Parts partner integration application
516(2)
Setting up the JMS broker and the database
518(2)
The story of the lost message
520(1)
Transaction basics
521(1)
Understanding Spring's transaction support
522(2)
Adding transactions
524(2)
Testing transactions
526
12.2 Transaction basics
521(8)
Understanding Spring's transaction support
522(2)
Adding transactions
524(2)
Testing transactions
526(3)
12.3 The Transactional Client EIP
529(15)
Using local transactions
530(1)
Using global transactions
531(3)
Transaction starting from a database resource
534(2)
Transaction redeliveries
536(3)
Using different transaction propagations
539(3)
Returning a custom response when a transaction fails
542(2)
12.4 Compensating for unsupported transactions
544(7)
Introducing UnitOfWork
545(1)
Using synchronization callbacks
546(2)
Using onCompletion
548(3)
12.5 Idempotency
551(9)
Idempotent Consumer EIP
552(3)
Idempotent repositories
555(1)
Clustered idempotent repository
556(4)
12.6 Summary and best practices
560(2)
13 Parallel processing
562(33)
13.1 Introducing concurrency
563(8)
Running the example without concurrency
565(1)
Using concurrency
565(6)
13.2 Using thread pools
571(7)
Understanding thread pools in Java
571(2)
Using Camel thread pool profiles
573(2)
Creating custom thread pools
575(1)
Using ExecutorServiceManager
576(2)
13.3 Parallel processing with EIPs
578(8)
Using concurrency with the Threads EIP
579(2)
Using concurrency with the Multicast EIP
581(2)
Using concurrency with the Wire Tap EIP
583(3)
13.4 Using the asynchronous routing engine
586(8)
Hitting the scalability limit
586(2)
Scalability in Camel
588(1)
Components supporting asynchronous processing
589(1)
Asynchronous API
590(1)
Writing a custom asynchronous component
591(2)
Potential issues when using an asynchronous component
593(1)
13.5 Summary and best practices
594(1)
14 Securing Camel
595(28)
14.1 Securing your configuration
596(3)
Encrypting configuration
596(1)
Decrypting configuration
597(2)
14.2 Web service security
599(9)
Authentication in web services
600(4)
Authenticating web services usingJAAS
604(4)
14.3 Payload security
608(6)
Digital signatures
608(4)
Payload encryption
612(2)
14.4 Transport security
614(4)
Defining global SSL configuration
617(1)
14.5 Route authentication and authorization
618(3)
Configuring Spring Security
619(2)
14.6 Summary and best practices
621(2)
Part 5 Running And Managing Camel 623(92)
15 Running and deploying Camel
625(46)
15.1 Starting Camel
626(9)
How Camel starts
626(3)
Camel startup options
629(2)
Ordering routes
631(3)
Disabling autostartup
634(1)
15.2 Starting and stopping routes at runtime
635(6)
Using CamelContext to start and stop routes at runtime
635(3)
Using the Control Bus EIP to start and stop routes at runtime
638(1)
Using RoutePolicy to start and stop routes at runtime
639(2)
15.3 Shutting down Camel
641(4)
Graceful shutdown
642(3)
15.4 Deploying Camel
645(13)
Embedded in a Java application
645(3)
Embedded in a web application
648(6)
Embedded in WildFly
654(4)
15.5 Camel and OSGi
658(8)
Setting up Maven to generate an OSGi bundle
659(1)
Installing and running Apache Karaf
660(1)
Using an OSGi Blueprint-based Camel route
661(1)
Deploying the example
661(2)
Using a managed service factory to spin up route instances
663(3)
15.6 Camel and CDI
666(4)
15.7 Summary and best practices
670(1)
16 Management and monitoring
671(44)
16.1 Monitoring Camel
672(4)
Checking health at the network level
672(3)
Checking health level at the JVM level
675(1)
Checking health at the application level
675(1)
16.2 Using JMX with Camel
676(8)
UsingJConsole to manage Camel
676(2)
UsingJConsole to remotely manage Camel
678(2)
UsingJolokia to manage Camel
680(4)
16.3 Tracking application activity
684(10)
Using log files
685(1)
Using core logs
685(1)
Using custom logging
685(4)
Using Tracer
689(2)
Using notifications
691(3)
16.4 Managing Camel applications
694(4)
Managing Camel application lifecycles
694(1)
UsingJolokia and hawtio to manage Camel lifecycles
695(2)
Using Control Bus to manage Camel
697(1)
16.5 The Camel management API
698(15)
Accessing the Camel management API usingJava
699(4)
Using Camel management API from within Camel
703(2)
Performance statistics
705(3)
Management-enable custom Camel components
708(3)
Management-enable custom Java beans
711(2)
16.6 Summary and best practices
713(2)
Part 6 Out In The Wild 715(108)
17 Clustering
717(35)
17.1 Clustered HTTP
718(2)
17.2 Clustered Camel routes
720(6)
Active/passive mode
720(1)
Active/active mode
720(1)
Clustered active/passive mode using Hazelcast
721(2)
Clustered active/ passive mode using Consul
723(1)
Clustered active/passive mode using ZooKeeper
724(2)
17.3 Clustered JMS
726(1)
Client-side clustering with JMS and ActiveMQ
726(1)
17.4 Clustered Kafka
727(6)
Kafka consumer offset
730(1)
Crashing a JVM with a running Kafka consumer
731(2)
17.5 Clustering caches
733(4)
Clustered cache using Hazekast
733(3)
Clustered cache using JCache and Infinispan
736(1)
17.6 Using clustered scheduling
737(2)
Clustered scheduling using Quartz
737(2)
17.7 Calling clustered services using the Service Call EIP
739(11)
How the Service Call EIP works
740(1)
Service Call using static service registry
741(3)
Service Call with failover
744(1)
Configuring Service Call EIP
745(2)
Service Call URI templating
747(1)
Service Call using Spring Boot Cloud and Consul
748(2)
17.8 Summary and best practices
750(2)
18 Microservices with Docker and Kubernetes
752(51)
18.1 Getting started with Camel on Docker
753(9)
Building and running Camel microservices locally
754(2)
Building and running Camel microservices using Docker
756(2)
Building a Docker image using the Docker Maven plugin
758(1)
RunningJava microservices on Docker
759(3)
18.2 Getting started with Kubernetes
762(2)
Installing Minikube
762(1)
Starting Minikube
763(1)
18.3 Running Camel and other applications in Kubernetes
764(12)
Running applications using kubectl
765(1)
Calling a service running inside a Kubernetes cluster
766(2)
RunningJava applications in Kubernetes using Maven tooling
768(3)
Java microservices calling each other in the cluster
771(3)
Debugging Java applications in Kubernetes
774(2)
18.4 Understanding Kubernetes
776(7)
Introducing Kubernetes
776(2)
Kubernetes architecture
778(1)
Essential Kubernetes concepts
778(5)
18.5 Building resilient Camel microservices on Kubernetes
783(9)
Scaling up microservices
784(2)
Using readiness and liveness probes
786(3)
Dealing with failures by calling services in Kubernetes
789(3)
18.6 Testing Camel microservices on Kubernetes
792(4)
Setting up Arquillian Cube
792(1)
Writing a basic unit test using Arquillian Cube
793(1)
Running Arquillian Cube tests on Kubernetes
793(1)
Writing a unit test that calls a Kubernetes service
794(2)
18.7 Introducing fabric8, Helm, and OpenShift
796(4)
fabric8
796(1)
Kubernetes Helm
796(2)
OpenShift
798(2)
18.8 Summary and best practices
800(3)
19 Camel tooling
803(20)
19.1 Camel editors
804(9)
JBoss Fuse Tooling
804(4)
Apache Camel IDEA plugin
808(3)
Camel validation using Maven
811(2)
19.2 Camel Catalog: the information goldmine
813(3)
19.3 hawtio: a web console for Camel and Java applications
816(5)
Understanding hawtio functionality
817(1)
Debugging Camel routes using hawtio
818(3)
19.4 Summary and best practices
821(2)
Appendix A Simple, the expression language 823(12)
Appendix B The Camel community 835(4)
Index 839
AUTHOR BIO





Claus Ibsen is a principal engineer working for Red Hat specializing in

cloud and integration. He has worked on Apache Camel for the last seven

years where he heads the project. He is also heavily involved with fabric8

and hawtio projects, especially with functionality that involves Camel.

Claus lives in Sweden near Malmo with his wife and dog.





Jonathan Anstey is a principal engineer at Red Hat working on open

source integration technologies. One of the many projects Jon contributes to

is Apache Camel. When he is not hacking on open source he likes to spend

time with his wife and two kids in Paradise, Newfoundland.