Apache Camel K

supersonic subatomic integrations
on Kubernetes and Knative

 

Peter Palaga

@ppalaga

Peter Palaga

Agenda

  • Apache Camel intro
  • Apache Camel Quarkus
  • Apache Camel K

What is Apache Camel?

http://camel.apache.org/

Since 2007

Huge community


Follow @ApacheCamel (new) on Twitter!

Apache Camel is...

An integration library



Systems integration
Apache Camel is based on

Enterprise Integration Patterns (EIP)

EIPs
https://www.enterpriseintegrationpatterns.com/
Apache Camel can...

integrate anything

through its

~300 components

Filetypes:

  • Plaintext, XML, HTML, CSV, JSON, ZIP, ...
  • Apache Tika (MS Office, OpenDocument, ...)

Protocols:

  • AMQP, DNS, FTP, HTTP, IRC, SSH, TCP/UDP, ...
  • REST, GRPC, git, ...
  • IoT: CoAP, MQTT, PubNub

Public Clouds:   

  • AWS: S3, SQS, Kinesis, ...
  • Azure: Blob, Queue, ...
  • Google: BigQuery, PubSub

Enterprise:

  • Caches: Hazelcast, Infinispan, Redis, ...
  • Cassandra, MongoDB, Kafka
  • JDBC, SQL, JPA, CDI, EJB, JMS, JMX, OpenTracing, OptaPlanner, Syslog,

APIs:

  • Social: Facebook, Twitter, LinkedIn
  • Box, Dropbox, Google Calendar/Drive/Mail/Docs
  • Salesforce, SAP, ServiceNow, FHIR
  • GitHub, Jira, Telegram

Misc:

  • Barcode
  • Base64, JsonPath, Freemarker, Groovy, Mustache, Ruby
  • Docker, etcd, Kubernetes, OpenShift,
Routes defined via

Domain Specific Languages (DSL)

Java XML
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/spring">
  <route id="my-route">
    <from uri="twitter-search:word1,word2"/>
    <log message="Got a tweet: ${body}"/>
    <to uri="telegram:bots"/>
  </route>
</routes>

Groovy, Scala, Kotlin, ...

Apache Camel is...

Runnable on


Spring Boot Spring Boot Apache Karaf WildFly
Standalone WildFly

Apache Camel 3

  • ~November 2019
  • Tidy up APIs & cleanup of technical debt
  • Light-weight & modular camel-core
  • Camel Main
  • Reactive Routing Engine
  • Backwards compatible (for most users)
  • Fluent Builder Endpoint configuration (Java & XML)
  • Java 11 support
  • New website
  • Camel Quarkus and Camel-K

What is

?

Supersonic, subatomic Java!

Why do we need
Quarkus in Camel?

  • Java sucks in containers
  • Serverless functions need fast startup

Camel Quarkus

Camel Quarkus Demo

Apache Camel K

Camel K

Motivations

  • Low code/no code integrations: Syndesis
  • A "glue" for Serverless Functions (read: Knative)


⮤ characterized by:

  • Fast prototyping
  • Simple or no business logic
  • Low memory and CPU usage esp. during startup
  • Web UI
  • For "Citizen integrators"
  • Integrations (Camel)
  • API design (Apicur.io)
  • API managemtent (3scale)

New areas of interest

  • Low code/no code integrations: Syndesis
  • A "glue" for Serverless Functions (read: Knative)


⮤ characterized by:

  • Fast prototyping
  • Simple or no business logic
  • Fast startup, low memory footprint

Camel K demo

Camel K internals

What is Kubernetes Operator?

  • An Application Management concept
  • Does what a human operator would have to do
    • Based on declarative input

  • A pattern
  • (Ex-)CoreOS Operator Framework
A Kubernetes Operator

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
Kubernetes

Custom Resource Definitions (CRD)

Built-in resources
  • pods, services, ...
  • oc create, oc get, oc delete
CRDs
  • Extend the cluster model
  • oc create, oc get, oc delete
  • Declarative input for operators

Camel K Operator

Camel K internals
Apache Camel K

Image resolution (1/2)

Collect Maven dependencies based on

  • DSL used (Groovy, XML, Java, Kotlin, JavaScript, YAML)
  • Camel components used in the routes
Apache Camel K

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

Camel K on Knative

What is Knative?

  • Building blocks for Serverless applications
  • CRDs and operators

https://knative.dev

Camel K

Knative Serving (1/2)

Camel K

Knative Serving (2/2)

Camel K

Knative Serving (2/2)

Camel K

Knative Serving (2/2)

Knative Eventing

https://cloudevents.io
Camel K as Knative

Event Consumer

Camel K as Knative

Event Consumer

Camel K as Knative

Event Consumer

Camel K as Knative

Event Consumer

Camel K as Knative

Event Consumer

Camel K as Knative

Event Source

Camel K

Roles in Knative Eventing

Apache Camel K

What comes next

  • Camel K 1.0.0 after Knative 1.0 and Camel 3.0.0 GA
  • Quarkus as integration runtime
  • Tekton builds
  • BDD testing
  • IDE plugins


Feedback and contributions are welcome!