SlideShare una empresa de Scribd logo
1 de 45
APACHE CAMEL:
SWISS KNIFE OF INTEGRATIONS
Justinas Šlekas
Agenda
• Integrations and Integration Patterns
• What is Apache Camel?
• Why Apache Camel?
• Camel basics
• Demo
• Questions
Why do we need integration?
Where does complexity come from?
Much of the complexity comes from two issues:
• dealing with the specifics of applications and transports
• coming up with good solutions to integration problems
Integrations patterns
- Visual pattern language for message-based enterprise
integration solutions
- Pattern language comprises of 65 patterns in 6 categories
Enterprise Integration Patterns
Why the name Camel?
Camel’s parents
What is Apache Camel?
• Java framework for integration and mediation
• Enterprise Integration Patterns
• Domain Specific Languages:
• Fluent Java
• Spring XML
• Blueprint XML
• Scala
• Runs in any container (or stand alone)
• Over > 150 out-of-box components
• Active community
Why Apache Camel?
• Why Integration Framework?
• Framework do the heavy lifting
• You can focus on business problem
• Not "reinventing the wheel"
Why Apache Camel?
• Integration can be messy - variety of protocols and data
formats
• Framework hides all complexity so you can focus on your
business logic
Apache Camel Deployment
Known ContainersDeployment Strategy
• No container dependency
• Lightweight
• Embeddable
Deployment Options
• Standalone
• WAR
• Spring
• J2EE
• JBI
• OSGi
• Cloud
• Apache ServiceMix
• Apache ActiveMQ
• Apache Tomcat
• Jetty
• JBoss
• IBM WebSphere
• Oracle WebLogic
• Oracle OC4j
• Glassfish
• Google App Engine
• ... others
Apache Camel Components
• Highly configurable
• Maximum interoperability
• Used to build “Adapters” to existing systems
• Don’t reinvent the wheel and end up with a box
(Some) Standard components
• AHC - Async HTTP client
• Atom
• AMPQ
• AWS-* - Amazon cloud services
• Bean - Bean binding
• DNS - DNS look-up
• Dropbox
• JPA
• File & FTP
• HBase
• HTTP
• LDAP
• MongoDB
• Mustache
• Netty
• POP3
• RabbitMQ
• Salesforce
• Servlet
• JMS & ActiveMQ
• SQL
• SSH
• Validation - XML validation
• Websocket
• XMPP
• Activiti BPMN
• Smooks
Why Camel? That’s why…
Apache Camel Concept
Camel is Message-oriented → Concept of
Message
Communication in Camel takes places via
Message
Message is included in Exchange
Apache Camel: Exchange
• Exchange = Wrapper
object
• encapsulates
Messages (IN and
OUT) and Metadata
Apache Camel: Endpoint
Endpoint defines the communication port of an application
from(“file://C:/data/in”)
to(“sftp://localhost:22/data/out”)
Apache Camel: Route
Route defines strategies for message manipulation
Camel Architecture
Working with Camel Messages
Camel Processor:
• Java interface used to implement message consumers or
Message Translator EIP
• you can create a Component from a Processor
Camel Processor
Apache Camel Bean
• Bean as Message Translator
Apache Camel Bean (2)
• Bean as Message Translator
Little Example
• File Copier Example
File Copier Example
Java DSL
File copier example
XML DSL route:
<route>
<from uri=“file://data/inbox”>
<to uri=“file://data/outbox”>
</route>
Java DSL route:
from(“file://data/inbox”).to(“file://data/outbox”)
What else is there?
• Error handling
• EIP annotations
• Test Kit
• Transactions
• Concurrency
• Interceptors
• Security
• Data Transformation
• Load Balancing
• ...
EIPAnnotations
Consumer Endpoint in Camel Bean
Producer Endpoint in Camel Bean
Transactions
Make client session with messaging system
transactional
• uses Spring transactions
• Transactional endpoints: JMS, ActiveMQ, AMPQ,
JPA
Error Handling
Two distinct types:
• transactional
• non-transactional
Can configure policies like:
• message redelivery
• dead-letter queue
Error Handling: Try - Catch
Load Balancer EIP
• delegate processing based on load balancing policies
• out-of-the-box-policies:
• Round robin
• Random
• Sticky
• Topic
• Failover
• Weighted Round-robin
• Weighted random ○ Custom
Load Balancer example
Camel as a Client
• Java Client Application (no routes)
• Example
• Upload a file to a FTP server
Testing
• Camel provides some very powerful Unit Testing
capabilities. Its MockEndpoint class supports complex
expressions to validate your routes.
Testing
Test Kit
• camel-test camel-test-spring
• camel-test-blueprint
Hawt.io - ultimate admin console
• lightweight html5 modular web-console
• open-source (JBoss Cummunity project)
• discovers what the JVM is running (JMX, other) and
exposes a web UI
• lots of plugins:
○ ActiveMQ
○ Camel
○ OSGi
○ Karaf
○ JMX
○ …..
Management with Hawt.io
• View/edit Camel Routes
• ActiveMQ - browse/send
• Monitor system resources
• Inspect JMX
When NOT to use Apache Camel?
• Integrating just one or two technologies (Could be simpler
to use other libraries)
• Very large integration projects (use ESB’s: Apache
ServiceMix, Mule ESB)
Summary
• Apache Camel: The Swiss Army Knife of Integration
• Lightweight
• Multiple container support
• Developer friendly
• Feature (a lot of components)
• Scalability
• Easy adoption in enterprises
• Development
• Testing
• Operations friendly
• License
DEMO
• Live demonstration
Speaker: Justinas Slekas
contacts: justas.slekas@gmail.com
Questions?

Más contenido relacionado

Último

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 

Último (20)

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 

Destacado

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Destacado (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Apache camel: Swiss Knife of Integrations

  • 1. APACHE CAMEL: SWISS KNIFE OF INTEGRATIONS Justinas Šlekas
  • 2. Agenda • Integrations and Integration Patterns • What is Apache Camel? • Why Apache Camel? • Camel basics • Demo • Questions
  • 3. Why do we need integration?
  • 4. Where does complexity come from? Much of the complexity comes from two issues: • dealing with the specifics of applications and transports • coming up with good solutions to integration problems
  • 5. Integrations patterns - Visual pattern language for message-based enterprise integration solutions - Pattern language comprises of 65 patterns in 6 categories
  • 7. Why the name Camel?
  • 9. What is Apache Camel? • Java framework for integration and mediation • Enterprise Integration Patterns • Domain Specific Languages: • Fluent Java • Spring XML • Blueprint XML • Scala • Runs in any container (or stand alone) • Over > 150 out-of-box components • Active community
  • 10. Why Apache Camel? • Why Integration Framework? • Framework do the heavy lifting • You can focus on business problem • Not "reinventing the wheel"
  • 11. Why Apache Camel? • Integration can be messy - variety of protocols and data formats • Framework hides all complexity so you can focus on your business logic
  • 12. Apache Camel Deployment Known ContainersDeployment Strategy • No container dependency • Lightweight • Embeddable Deployment Options • Standalone • WAR • Spring • J2EE • JBI • OSGi • Cloud • Apache ServiceMix • Apache ActiveMQ • Apache Tomcat • Jetty • JBoss • IBM WebSphere • Oracle WebLogic • Oracle OC4j • Glassfish • Google App Engine • ... others
  • 13. Apache Camel Components • Highly configurable • Maximum interoperability • Used to build “Adapters” to existing systems • Don’t reinvent the wheel and end up with a box
  • 14. (Some) Standard components • AHC - Async HTTP client • Atom • AMPQ • AWS-* - Amazon cloud services • Bean - Bean binding • DNS - DNS look-up • Dropbox • JPA • File & FTP • HBase • HTTP • LDAP • MongoDB • Mustache • Netty • POP3 • RabbitMQ • Salesforce • Servlet • JMS & ActiveMQ • SQL • SSH • Validation - XML validation • Websocket • XMPP • Activiti BPMN • Smooks
  • 16. Apache Camel Concept Camel is Message-oriented → Concept of Message Communication in Camel takes places via Message Message is included in Exchange
  • 17. Apache Camel: Exchange • Exchange = Wrapper object • encapsulates Messages (IN and OUT) and Metadata
  • 18. Apache Camel: Endpoint Endpoint defines the communication port of an application from(“file://C:/data/in”) to(“sftp://localhost:22/data/out”)
  • 19. Apache Camel: Route Route defines strategies for message manipulation
  • 21. Working with Camel Messages Camel Processor: • Java interface used to implement message consumers or Message Translator EIP • you can create a Component from a Processor
  • 23. Apache Camel Bean • Bean as Message Translator
  • 24. Apache Camel Bean (2) • Bean as Message Translator
  • 25. Little Example • File Copier Example
  • 27. File copier example XML DSL route: <route> <from uri=“file://data/inbox”> <to uri=“file://data/outbox”> </route> Java DSL route: from(“file://data/inbox”).to(“file://data/outbox”)
  • 28. What else is there? • Error handling • EIP annotations • Test Kit • Transactions • Concurrency • Interceptors • Security • Data Transformation • Load Balancing • ...
  • 30. Consumer Endpoint in Camel Bean
  • 31. Producer Endpoint in Camel Bean
  • 32. Transactions Make client session with messaging system transactional • uses Spring transactions • Transactional endpoints: JMS, ActiveMQ, AMPQ, JPA
  • 33. Error Handling Two distinct types: • transactional • non-transactional Can configure policies like: • message redelivery • dead-letter queue
  • 35. Load Balancer EIP • delegate processing based on load balancing policies • out-of-the-box-policies: • Round robin • Random • Sticky • Topic • Failover • Weighted Round-robin • Weighted random ○ Custom
  • 37. Camel as a Client • Java Client Application (no routes) • Example • Upload a file to a FTP server
  • 38. Testing • Camel provides some very powerful Unit Testing capabilities. Its MockEndpoint class supports complex expressions to validate your routes.
  • 39. Testing Test Kit • camel-test camel-test-spring • camel-test-blueprint
  • 40. Hawt.io - ultimate admin console • lightweight html5 modular web-console • open-source (JBoss Cummunity project) • discovers what the JVM is running (JMX, other) and exposes a web UI • lots of plugins: ○ ActiveMQ ○ Camel ○ OSGi ○ Karaf ○ JMX ○ …..
  • 41. Management with Hawt.io • View/edit Camel Routes • ActiveMQ - browse/send • Monitor system resources • Inspect JMX
  • 42. When NOT to use Apache Camel? • Integrating just one or two technologies (Could be simpler to use other libraries) • Very large integration projects (use ESB’s: Apache ServiceMix, Mule ESB)
  • 43. Summary • Apache Camel: The Swiss Army Knife of Integration • Lightweight • Multiple container support • Developer friendly • Feature (a lot of components) • Scalability • Easy adoption in enterprises • Development • Testing • Operations friendly • License
  • 45. Speaker: Justinas Slekas contacts: justas.slekas@gmail.com Questions?