SLIDE 1 INTEGRATING SYSTEMS INTEGRATING SYSTEMS
IN THE AGE OF IN THE AGE OF
QUARKUS, KNATIVE AND KAFKA CONNECT QUARKUS, KNATIVE AND KAFKA CONNECT Peter Palaga
Sponsorslides
@ppalaga
SLIDE 2
The original reveal.js presentation this PDF was created from is available online: http://ppalaga.github.io/presentations/200108-camel
SLIDE 3
PETER PALAGA PETER PALAGA
SLIDE 4
PETER PALAGA PETER PALAGA
SLIDE 5
PETER PALAGA PETER PALAGA
SLIDE 6
PETER PALAGA PETER PALAGA
SLIDE 7
PETER PALAGA PETER PALAGA
SLIDE 8 AGENDA AGENDA
Apache Camel intro
- Camel on Quarkus
- Camel on Knative/Kubernetes
- Camel on Kafka Connect
SLIDE 9
WHAT IS APACHE CAMEL? WHAT IS APACHE CAMEL?
http://camel.apache.org/
SLIDE 10
WHAT IS APACHE CAMEL? WHAT IS APACHE CAMEL?
Since 2007 http://camel.apache.org/
SLIDE 11
HUGE COMMUNITY HUGE COMMUNITY
Follow (new) on Twitter! ~500 contributors ~3k stars on Github ~3.9k forks on Github ~1k subscribers on the Users mailing list ~9.3k questions on StackOverFlow @ApacheCamel
SLIDE 12 Apache Camel is...
AN INTEGRATION LIBRARY AN INTEGRATION LIBRARY
System A System B Data
“Route”
Transport A Transport B
SLIDE 13 Apache Camel is based on
ENTERPRISE INTEGRATION PATTERNS (EIP) ENTERPRISE INTEGRATION PATTERNS (EIP)
Content Based Router Message Filter Dynamic Router Recipient List Splitter Aggergator Resequencer Content Enricher Content Filter Normalizer https://www.enterpriseintegrationpatterns.com/
SLIDE 14
Apache Camel can...
INTEGRATE ANYTHING INTEGRATE ANYTHING
through its
~300 COMPONENTS ~300 COMPONENTS
SLIDE 15
SLIDE 16 Filetypes:
Plaintext, XML, HTML, CSV, JSON, ZIP , ...
OpenDocument, ...)
SLIDE 17 Filetypes: Protocols:
Plaintext, XML, HTML, CSV, JSON, ZIP , ...
OpenDocument, ...)
, DNS, FTP , HTTP , IRC, SSH, TCP/UDP , ...
- REST, GRPC, git, ...
- IoT: CoAP
, MQTT, PubNub
SLIDE 18 Filetypes: Protocols: Public Clouds:
Plaintext, XML, HTML, CSV, JSON, ZIP , ...
OpenDocument, ...)
, DNS, FTP , HTTP , IRC, SSH, TCP/UDP , ...
- REST, GRPC, git, ...
- IoT: CoAP
, MQTT, PubNub
- AWS: S3, SQS, Kinesis, ...
- Azure: Blob, Queue, ...
- Google: BigQuery, PubSub
SLIDE 19 Filetypes: Protocols: Public Clouds: Enterprise:
Plaintext, XML, HTML, CSV, JSON, ZIP , ...
OpenDocument, ...)
, DNS, FTP , HTTP , IRC, SSH, TCP/UDP , ...
- REST, GRPC, git, ...
- IoT: CoAP
, MQTT, PubNub
- AWS: S3, SQS, Kinesis, ...
- Azure: Blob, Queue, ...
- Google: BigQuery, PubSub
- Caches: Hazelcast,
Infinispan, Redis, ...
Kafka
- JDBC, SQL, JPA, CDI, EJB,
JMS, JMX, OpenTracing, OptaPlanner, Syslog,
SLIDE 20 Filetypes: Protocols: Public Clouds: Enterprise: APIs:
Plaintext, XML, HTML, CSV, JSON, ZIP , ...
OpenDocument, ...)
, DNS, FTP , HTTP , IRC, SSH, TCP/UDP , ...
- REST, GRPC, git, ...
- IoT: CoAP
, MQTT, PubNub
- AWS: S3, SQS, Kinesis, ...
- Azure: Blob, Queue, ...
- Google: BigQuery, PubSub
- Caches: Hazelcast,
Infinispan, Redis, ...
Kafka
- JDBC, SQL, JPA, CDI, EJB,
JMS, JMX, OpenTracing, OptaPlanner, Syslog,
- Social: Facebook, Twitter,
LinkedIn
Calendar/Drive/Mail/Docs
, ServiceNow, FHIR
SLIDE 21 Filetypes: Protocols: Public Clouds: Enterprise: APIs: Misc:
Plaintext, XML, HTML, CSV, JSON, ZIP , ...
OpenDocument, ...)
, DNS, FTP , HTTP , IRC, SSH, TCP/UDP , ...
- REST, GRPC, git, ...
- IoT: CoAP
, MQTT, PubNub
- AWS: S3, SQS, Kinesis, ...
- Azure: Blob, Queue, ...
- Google: BigQuery, PubSub
- Caches: Hazelcast,
Infinispan, Redis, ...
Kafka
- JDBC, SQL, JPA, CDI, EJB,
JMS, JMX, OpenTracing, OptaPlanner, Syslog,
- Social: Facebook, Twitter,
LinkedIn
Calendar/Drive/Mail/Docs
, ServiceNow, FHIR
- GitHub, Jira, Telegram
- Barcode
- Base64, JsonPath,
Freemarker, Groovy, Mustache, Ruby
- Docker, etcd, Kubernetes,
OpenShift,
SLIDE 22 Routes defined via
DOMAIN SPECIFIC LANGUAGES (DSL) DOMAIN SPECIFIC LANGUAGES (DSL)
Java XML Groovy, Scala, Kotlin, ...
class MyCamelRouter extends RouteBuilder { @Override public void configure() throws Exception { from("twitter-search:" + "word1,word2") .log("Got a tweet: ${body}") .to("telegram:bots"); } } <routes xmlns="http://camel.apache.org/schema/sprin <route id="my-route"> <from uri="twitter-search:word1,word2"/> <log message="Got a tweet: ${body}"/> <to uri="telegram:bots"/> </route> </routes>
SLIDE 23
Apache Camel is...
RUNNABLE ON RUNNABLE ON
SLIDE 24
Apache Camel is...
RUNNABLE ON RUNNABLE ON
Standalone
SLIDE 25
Apache Camel is...
RUNNABLE ON RUNNABLE ON
Standalone Spring Boot
SLIDE 26 Apache Camel is...
RUNNABLE ON RUNNABLE ON
Standalone Spring Boot
Knative/Kubernetes
connect
SLIDE 27
WHY CAMEL ON QUARKUS? WHY CAMEL ON QUARKUS?
Java slow to boot and memory intensive for containers and serverless
SLIDE 28
WHAT IS WHAT IS ?
SLIDE 29
Supersonic, subatomic Java! An intro
SLIDE 30 CAMEL QUARKUS CAMEL QUARKUS
Incubated inside
Now
- https://github.com/apache/camel-quarkus
~50 components as of v1.0.0-M2
Available via
SLIDE 31
CAMEL QUARKUS DEMO CAMEL QUARKUS DEMO
Demo code: github.com/ppalaga/camel-quarkus-cnorris-demo
SLIDE 32 CAMEL QUARKUS LINKS CAMEL QUARKUS LINKS
Project starter
- code.quarkus.io
- User guide
- Examples
SLIDE 33
CAMEL ON KUBERNETES CAMEL ON KUBERNETES AND KNATIVE AND KNATIVE
SLIDE 34
HOW FAST CAN YOU (RE-)DEPLOY HOW FAST CAN YOU (RE-)DEPLOY
ON KUBERNETES? ON KUBERNETES?
SLIDE 35
SLIDE 36
Web UI for "Citizen integrators" Fast feedback required
SLIDE 37
CAMEL K DEMO CAMEL K DEMO
SLIDE 38 CAMEL K INTERNALS CAMEL K INTERNALS
kamel client side binary
- ▪ github.com/apache/camel-k/releases
Camel K Operator
SLIDE 39 WHAT IS KUBERNETES WHAT IS KUBERNETES OPERATOR? OPERATOR?
An Application Management concept
- Does what a human operator would have to do
- Based on declarative input
▪
SLIDE 40 WHAT IS KUBERNETES WHAT IS KUBERNETES OPERATOR? OPERATOR?
An Application Management concept
- Does what a human operator would have to do
- Based on declarative input
▪
A pattern
SLIDE 41 WHAT IS KUBERNETES WHAT IS KUBERNETES OPERATOR? OPERATOR?
An Application Management concept
- Does what a human operator would have to do
- Based on declarative input
▪
A pattern
- (Ex-)CoreOS
- Operator Framework
SLIDE 42
A Kubernetes Operator
HOW IT WORKS HOW IT WORKS
SLIDE 43
A Kubernetes Operator
HOW IT WORKS HOW IT WORKS
A running container
SLIDE 44
A Kubernetes Operator
HOW IT WORKS HOW IT WORKS
A running container Monitors the cluster via Kubernetes API
SLIDE 45 A Kubernetes Operator
HOW IT WORKS HOW IT WORKS
A running container Monitors the cluster via Kubernetes API
- Reacts:
- Add/remove/modify resources
(pods/services/custom CRDs)
▪
Scale up/down
▪
Call endpoints of the running applications
▪
SLIDE 46 A Kubernetes Operator
HOW IT WORKS HOW IT WORKS
A running container Monitors the cluster via Kubernetes API
- Reacts:
- Add/remove/modify resources
(pods/services/custom CRDs)
▪
Scale up/down
▪
Call endpoints of the running applications
▪
Implements custom logic
SLIDE 47 Kubernetes
CUSTOM RESOURCE CUSTOM RESOURCE DEFINITIONS (CRD) DEFINITIONS (CRD)
Built-in resources CRDs pods, services, ...
- c create,
- c get,
- c delete
- Extend the cluster model
- c create, oc get,
- c delete
- Declarative input for
- perators
SLIDE 48 CAMEL K OPERATOR CAMEL K OPERATOR
from("twitter-search:" + "word1,word2") .log('Got a tweet: ${body}') .to("telegram:bots");
routes.groovy
CRDs Integration Integration Platform
Camel K Operator
Built-in Resources Image ConfigMap Deployment
kamel
~4 seconds for the simplest routes
Integration Kit
SLIDE 49 Apache Camel K
IMAGE RESOLUTION (1/2) IMAGE RESOLUTION (1/2)
Collect Maven dependencies based on DSL used (Groovy, XML, Java, Kotlin, JavaScript, YAML)
- Camel components used in the routes
SLIDE 50 Camel K
IMAGE RESOLUTION (2/2) IMAGE RESOLUTION (2/2)
Based on the found dependency set
- Either take an available Image (buildless deploy)
▪
Or build a new image
▪
SLIDE 51 Camel K
IMAGE RESOLUTION (2/2) IMAGE RESOLUTION (2/2)
Based on the found dependency set
- Either take an available Image (buildless deploy)
▪
Or build a new image
▪
Route definition not a part of the image
- Mounted to the container as a ConfigMap
▪
SLIDE 52
CAMEL ON KNATIVE CAMEL ON KNATIVE
SLIDE 53
WHAT IS KNATIVE? WHAT IS KNATIVE?
https://knative.dev
SLIDE 54 WHAT IS KNATIVE? WHAT IS KNATIVE?
Building blocks for Serverless applications
SLIDE 55 WHAT IS KNATIVE? WHAT IS KNATIVE?
Building blocks for Serverless applications
- CRDs and operators
- https://knative.dev
SLIDE 56 WHAT IS KNATIVE? WHAT IS KNATIVE?
Building blocks for Serverless applications
- CRDs and operators
- https://knative.dev
SLIDE 57 WHAT IS KNATIVE? WHAT IS KNATIVE?
Building blocks for Serverless applications
- CRDs and operators
- https://knative.dev
SLIDE 58 Camel
KNATIVE SERVING (1/2) KNATIVE SERVING (1/2)
routes.groovy
Integration Service (Knative)
kamel
Camel K Operator
from("knative:/channel/a") .to("http:my-host/path")
On Knative ?
Deployment (Kubernetes)
yes no
SLIDE 59 Camel
KNATIVE SERVING (2/2) KNATIVE SERVING (2/2)
No requests → no pods
SLIDE 60 Camel
KNATIVE SERVING (2/2) KNATIVE SERVING (2/2)
Pod created upon a request
SLIDE 61 Camel
KNATIVE SERVING (2/2) KNATIVE SERVING (2/2)
High load → many pods
SLIDE 62
KNATIVE EVENTING KNATIVE EVENTING
https://cloudevents.io
SLIDE 63 Camel as
KNATIVE EVENT CONSUMER KNATIVE EVENT CONSUMER
SLIDE 64 Camel as
KNATIVE EVENT CONSUMER KNATIVE EVENT CONSUMER
SLIDE 65 Camel as
KNATIVE EVENT CONSUMER KNATIVE EVENT CONSUMER
SLIDE 66 Camel as
KNATIVE EVENT CONSUMER KNATIVE EVENT CONSUMER
SLIDE 67 Camel as
KNATIVE EVENT CONSUMER KNATIVE EVENT CONSUMER
SLIDE 68 Camel as
KNATIVE EVENT SOURCE KNATIVE EVENT SOURCE
Knative Event Source
kamel run routes.groovy
SLIDE 69 Camel as
KNATIVE EVENT SOURCE KNATIVE EVENT SOURCE
Knative Event Source
kamel run routes.groovy
New: a pure kubectl / oc variant
apiVersion: sources.eventing.knative.dev/v1alpha1 kind: CamelSource metadata: name: bot-source spec: source: flow: from: uri: telegram:bots parameters: authorizationToken: xxx sink: apiVersion: messaging.knative.dev/v1alpha1 kind: InMemoryChannel name: mychannel
SLIDE 70 Camel
ROLES IN KNATIVE EVENTING ROLES IN KNATIVE EVENTING
SLIDE 71
CAMEL KAFKA CONNECTOR CAMEL KAFKA CONNECTOR
SLIDE 72 WHAT IS WHAT IS
APACHE KAFKA? APACHE KAFKA?
A stream-processing platform
- Distributed, scalable, fault-tolerant, fast
SLIDE 73 Apache Kafka offers
SEVERAL API SEVERAL APIs
SLIDE 74 Apache Kafka offers
SEVERAL API SEVERAL APIs
Producer API - publish records to topics
SLIDE 75 Apache Kafka offers
SEVERAL API SEVERAL APIs
Producer API - publish records to topics
- Consumer API - subscribe to topics to consume
records
SLIDE 76 Apache Kafka offers
SEVERAL API SEVERAL APIs
Producer API - publish records to topics
- Consumer API - subscribe to topics to consume
records
- Streams API - act as a stream
processor/transformer
SLIDE 77 Apache Kafka offers
SEVERAL API SEVERAL APIs
Producer API - publish records to topics
- Consumer API - subscribe to topics to consume
records
- Streams API - act as a stream
processor/transformer
- Connector API - for streaming data between Apache
Kafka and other systems
SLIDE 78
SLIDE 79 Apache Kafka
CONNECTOR API CONNECTOR API
a.k.a. Kafka Connect
SLIDE 80 Apache Kafka
CONNECTOR API CONNECTOR API
a.k.a. Kafka Connect
A framework to write Connectors
SLIDE 81 Apache Kafka
CONNECTOR API CONNECTOR API
a.k.a. Kafka Connect
A framework to write Connectors
SLIDE 82
CAMEL KAFKA CONNECTOR CAMEL KAFKA CONNECTOR
SLIDE 83
CAMEL KAFKA CONNECTOR CAMEL KAFKA CONNECTOR
Sink
SLIDE 84 CAMEL KAFKA CONNECTOR CAMEL KAFKA CONNECTOR
Sink
SLIDE 85 CAMEL KAFKA CONNECTOR CAMEL KAFKA CONNECTOR
to exchange data with 300+ Camel components Sink
SLIDE 86 CAMEL KAFKA CONNECTOR CAMEL KAFKA CONNECTOR
to exchange data with 300+ Camel components with minimal config Sink
SLIDE 87
CAMEL KAFKA CONNECTOR CAMEL KAFKA CONNECTOR
DEMO DEMO
SLIDE 88
WRAP UP WRAP UP
SLIDE 89
WRAP UP WRAP UP
Apache Camel - an integration lib with 300+ connectors
SLIDE 90 WRAP UP WRAP UP
Apache Camel - an integration lib with 300+ connectors
- Supersonic subatomic on Quarkus
SLIDE 91 WRAP UP WRAP UP
Apache Camel - an integration lib with 300+ connectors
- Supersonic subatomic on Quarkus
- Producer/Consumer/Router, scale to zero on Knative
SLIDE 92 WRAP UP WRAP UP
Apache Camel - an integration lib with 300+ connectors
- Supersonic subatomic on Quarkus
- Producer/Consumer/Router, scale to zero on Knative
- Streaming data from/to Kafka using Camel Kafka
Connect
SLIDE 93 Feedback and contributions are welcome!
Chat:
- https://gitter.im/apache/camel
Mailing list:
Follow