<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="https://www.nicolaferraro.me/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.nicolaferraro.me/" rel="alternate" type="text/html" /><updated>2022-01-21T12:48:10+01:00</updated><id>https://www.nicolaferraro.me/feed.xml</id><title type="html">Nicola Ferraro</title><subtitle>Yet another software developer. Ideas are my own.</subtitle><author><name>Nicola Ferraro</name></author><entry><title type="html">Camel meets KEDA</title><link href="https://www.nicolaferraro.me/2022/01/21/camel-meets-keda/" rel="alternate" type="text/html" title="Camel meets KEDA" /><published>2022-01-21T00:00:00+01:00</published><updated>2022-01-21T01:00:00+01:00</updated><id>https://www.nicolaferraro.me/2022/01/21/camel-meets-keda</id><content type="html" xml:base="https://www.nicolaferraro.me/2022/01/21/camel-meets-keda/">&lt;p&gt;&lt;a href=&quot;https://keda.sh&quot;&gt;KEDA&lt;/a&gt; (Kubernetes Event Driven Autoscalers) is a fantastic project (currently &lt;a href=&quot;https://cncf.io&quot;&gt;CNCF&lt;/a&gt; incubating) that provides Kubernetes-based autoscalers to help applications to scale out according to the number of incoming events when they are listening to several kinds of event sources. In Camel K we’ve long supported &lt;a href=&quot;https://knative.dev&quot;&gt;Knative&lt;/a&gt; for providing a similar functionality for integrations that are triggered by HTTP calls, so supporting KEDA was something planned since long time, because it enables full autoscaling from a wider collection of sources. The KEDA integration has now been merged and it will be available in &lt;strong&gt;Camel K 1.8.0&lt;/strong&gt;. This post highlights some details of the solution. If you want to see it in action, you can just jump to the end to see the &lt;a href=&quot;#demo&quot;&gt;demo recording&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;why-keda-and-camel-k&quot;&gt;Why KEDA and Camel K?&lt;/h2&gt;

&lt;p&gt;Users may want to set up integrations that automatically scale, e.g. depending on the &lt;strong&gt;number of messages left in a Kafka topic&lt;/strong&gt; (for their consumer group). The integration code may do e.g. transformations, aggregations and send data do a destination and it would be great if the number of instances deployed to a Kubernetes cluster could increase when there’s work left behind, or they can &lt;strong&gt;scale to zero&lt;/strong&gt; when there’s no more data in the topic.
This is what KEDA does by itself with scalers (Kafka is &lt;a href=&quot;https://keda.sh/docs/2.5/scalers/&quot;&gt;one of the many scalers available in KEDA&lt;/a&gt;). What you have now is that KEDA is now automatically configured by Camel K when you run integrations, so you get the autoscaling features out of the box (you just need to turn a flag on).&lt;/p&gt;

&lt;h2 id=&quot;how-does-it-work&quot;&gt;How does it work?&lt;/h2&gt;

&lt;p&gt;In Camel K 1.8.0 a new &lt;a href=&quot;https://camel.apache.org/camel-k/next/traits/keda.html&quot;&gt;KEDA trait&lt;/a&gt; has been introduced. 
The trait allows to manually tweak the KEDA configuration to make sure that some &lt;em&gt;ScaledObjects&lt;/em&gt; (KEDA concept) are generated as part of the &lt;em&gt;Integration&lt;/em&gt; reconciliation, but this is mostly an internal detail. The interesting part about the KEDA trait is that it can recognize special KEDA markers in Kamelets and automatically create a KEDA valid configuration when those Kamelets are used as sources. So users can just use Kamelets to create bindings as usual and, if they &lt;strong&gt;enable a KEDA flag&lt;/strong&gt; via an annotation, they get an event driven autoscaler automatically configured.&lt;/p&gt;

&lt;p&gt;The Kamelet catalog embedded in next release (&lt;a href=&quot;https://github.com/apache/camel-kamelets/tree/v0.7.0&quot;&gt;v0.7.0&lt;/a&gt;) contains two Kamelets enhanced with KEDA metadata: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aws-sqs-source&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kafka-source&lt;/code&gt;. These are just two examples of the many Kamelets that can be augmented in the future. The metadata configuration system is open and Kamelets can be marked at any time to work with KEDA: this means that you don’t need to wait for a new Camel K release to enable KEDA on a different source and, more importantly, that you can mark your own Kamelets with KEDA metadata to enable autoscaling from your internal organization components.&lt;/p&gt;

&lt;p&gt;The Kamelet developer guide contains a new section on &lt;a href=&quot;https://camel.apache.org/camel-k/next/kamelets/kamelets-dev.html#_keda_integration&quot;&gt;how to mark a Kamelet with KEDA metadata&lt;/a&gt;, but essentially markers are used to map Kamelet properties into KEDA configuration options, so that when you provide a Kamelet configuration, the corresponding KEDA options can be generated from it (all the work is done under the cover by the Camel K operator).&lt;/p&gt;

&lt;h2 id=&quot;a-binding-example&quot;&gt;A binding example&lt;/h2&gt;

&lt;p&gt;Before looking at the demo, here’s an example of &lt;strong&gt;autoscaling binding&lt;/strong&gt; that you can create with the latest Camel K:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;camel.apache.org/v1alpha1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;KameletBinding&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;kafka-to-sink&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;annotations&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;trait.camel.apache.org/keda.enabled&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;true&quot;&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;camel.apache.org/v1alpha1&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Kamelet&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;kafka-source&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;bootstrapServers&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;--&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;bootstrap&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;servers&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--&amp;gt;&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;consumerGroup&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;my-group&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;topic&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;--&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;the&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;topic&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--&amp;gt;&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;--&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--&amp;gt;&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;password&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;--&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s&quot;&gt;--&amp;gt;&quot;&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;sink&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can notice that the only difference from a standard binding is the presence of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trait.camel.apache.org/keda.enabled=true&lt;/code&gt; annotation that enables the 
KEDA trait in Camel K. The information about how to map Kamelet properties into KEDA options is encoded in the Kamelet definition.&lt;/p&gt;

&lt;h2 id=&quot;demo&quot;&gt;Demo&lt;/h2&gt;

&lt;p&gt;Time for the demonstration. You’ll see both the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;aws-sqs-source&lt;/code&gt; and the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kafka-source&lt;/code&gt; in action with Camel K and KEDA.&lt;/p&gt;

&lt;p&gt;The code for the demo is in the &lt;a href=&quot;https://github.com/nicolaferraro/camel-k-keda-demo&quot;&gt;nicolaferraro/camel-k-keda-demo&lt;/a&gt; repository on GitHub.&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/z67ES6VAYV4&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;h2 id=&quot;next-steps&quot;&gt;Next steps&lt;/h2&gt;

&lt;p&gt;There are many other Kamelets to enhance in &lt;a href=&quot;https://github.com/apache/camel-kamelets&quot;&gt;apache/camel-kamelets&lt;/a&gt; and things to improve in Camel K that are listed in the &lt;a href=&quot;https://github.com/apache/camel-k/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2FKEDA&quot;&gt;area/KEDA&lt;/a&gt; section of the issue tracker.&lt;/p&gt;

&lt;p&gt;Contributions are always welcome!&lt;/p&gt;</content><author><name>Nicola Ferraro</name></author><category term="Dev" /><category term="Apache Camel" /><category term="Kamelets" /><category term="Camel K" /><category term="Kubernetes" /><category term="Openshift" /><category term="KEDA" /><category term="JBoss Fuse" /><summary type="html">Camel K integrations can leverage KEDA to scale based on the number of incoming events.</summary></entry><entry><title type="html">Low Code Camel</title><link href="https://www.nicolaferraro.me/2021/11/03/low-code-camel/" rel="alternate" type="text/html" title="Low Code Camel" /><published>2021-11-03T00:00:00+01:00</published><updated>2021-11-03T01:00:00+01:00</updated><id>https://www.nicolaferraro.me/2021/11/03/low-code-camel</id><content type="html" xml:base="https://www.nicolaferraro.me/2021/11/03/low-code-camel/">&lt;p&gt;Apache Camel is a project in constant transformation. Anyone knows that Camel has been able to adapt to any new kinds of protocols and systems that have emerged in the past 15 years. But it’s not only that: Camel is also able to adapt to any new ways of dealing with integration problems in the cloud era.
While Camel K represented a fundamental shift towards a new approach to cloud-native integration, &lt;a href=&quot;/2020/10/12/kamelets/&quot;&gt;“Kamelets”&lt;/a&gt; are driving a deeper transformation towards “low code” development.&lt;/p&gt;

&lt;p&gt;When I talk about &lt;strong&gt;“low code”&lt;/strong&gt;, I refer to a platform for &lt;em&gt;developers&lt;/em&gt; where you can achieve most of your goals without writing any code. But at the same time, a low code platform should be customizable enough to let you show your development skills when it’s time to solve critical issues. It needs to be abstract in order to easily deal with the most common problems, even using a UI. But it should not prevent a developer to play with the low level details in order to extend the capabilities of the platform itself.&lt;/p&gt;

&lt;p&gt;If you’re a bit familiar with how &lt;a href=&quot;/2020/10/12/kamelets/&quot;&gt;Kamelets&lt;/a&gt; work, I think you’ve already got my point here.&lt;/p&gt;

&lt;h2 id=&quot;bindings-and-karavans&quot;&gt;Bindings and Karavans&lt;/h2&gt;

&lt;p&gt;It’s really easy to use Kamelets, especially in combination with &lt;a href=&quot;https://github.com/apache/camel-k&quot;&gt;Camel K&lt;/a&gt;. I’ve shown in &lt;a href=&quot;https://www.youtube.com/watch?v=xVL1gJ5AJVg&quot;&gt;a recent presentation at ApacheCon @Home&lt;/a&gt; that moving data from Knative or Kafka into an S3 bucket using streaming upload is as simple as writing something like this:&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;camel.apache.org/v1alpha1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;KameletBinding&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;events-to-s3&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;messaging.knative.dev/v1&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Channel&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;messages&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# Or a Strimzi &quot;KafkaTopic&quot;, if you prefer&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;sink&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Kamelet&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;camel.apache.org/v1alpha1&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;aws-s3-streaming-upload-sink&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;bucketNameOrArn&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;my-bucket&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;accessKey&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;lt;your-key&amp;gt;&quot;&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(&lt;a href=&quot;https://github.com/nicolaferraro/apachecon-home-2021/blob/main/s3-sink-binding.yaml&quot;&gt;source&lt;/a&gt;, &lt;a href=&quot;&quot;&gt;S3 Kamelet Documentation&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;You write this file, apply it to a Kubernetes cluster where Camel K is installed: &lt;strong&gt;done!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And it’s &lt;strong&gt;completely declarative&lt;/strong&gt;. You just specify where you want to move data from and to: no need to care about lower level details.&lt;/p&gt;

&lt;p&gt;If writing YAML is not your favourite sport, you can also opt for a visual UI. I’ve shown in the &lt;a href=&quot;https://www.youtube.com/watch?v=xVL1gJ5AJVg&quot;&gt;previous video&lt;/a&gt; how the OpenShift dev console is already instructed to use Kamelets in combination with Knative. But there’s a new project in the horizon at Apache that will bring this model even further…&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/apache/camel-karavan&quot;&gt;&lt;strong&gt;Karavan&lt;/strong&gt;&lt;/a&gt; is a new project started at Apache by &lt;a href=&quot;https://github.com/mgubaidullin&quot;&gt;Marat Gubaidullin&lt;/a&gt;. It is a generic visual UI that can design integrations based
on Kamelets. If you either need to create a simple source/sink integration or a more complex one, Karavan can help designing it with ease. There’s also a &lt;a href=&quot;https://camel.apache.org/blog/2021/10/camel-karavan-preview-release/&quot;&gt;blog post about Karavan&lt;/a&gt; if you want to learn more.&lt;/p&gt;

&lt;p style=&quot;color:gray; font-size: 90%; text-align: center;&quot;&gt;&lt;img src=&quot;/images/karavan.png&quot; alt=&quot;Karavan&quot; /&gt;
&lt;em&gt;The Karavan UI&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After you finish to configure the integration, the output you get from the UI is an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Integration&lt;/code&gt; custom resource, that you can direcly apply to any Kubernetes cluster (having Camel K installed) and it will automatically run.&lt;/p&gt;

&lt;p&gt;We have now a wider &lt;a href=&quot;https://camel.apache.org/camel-kamelets/latest/&quot;&gt;catalog of Kamelets&lt;/a&gt; available upstream and it will cover many use cases that you may have in mind. They are the building blocks for letting you connect systems &lt;strong&gt;without writing any code&lt;/strong&gt;: just choose if you want to use the YAML configuration or let the Karavan UI create it for you.&lt;/p&gt;

&lt;h2 id=&quot;wheres-my-kamelet&quot;&gt;Where’s my Kamelet?&lt;/h2&gt;

&lt;p&gt;There’s no doubt you’ll find a use case which is not covered by a Kamelet. For example, what about moving data between parts of your organization?&lt;/p&gt;

&lt;p&gt;In traditional Camel the approach you would have taken to address this problem is to create one or more ad hoc integrations to 
fullfill any of your needs. You’d develop a custom integration route for each use case you have in mind.&lt;/p&gt;

&lt;p&gt;The Kamelet approach is completely different. You develop a reusable Kamelet that is responsible of taking specific data out of your system (a &lt;strong&gt;source&lt;/strong&gt;), or putting some data back into your system (a &lt;strong&gt;sink&lt;/strong&gt;).
Once you’ve done that, you can &lt;strong&gt;treat it as a high level connector in the Karavan UI&lt;/strong&gt; and use it, whenever you need, in multiple scenarios where you need to move data around, without having to code everything from scratch each time.&lt;/p&gt;

&lt;p&gt;Writing a Kamelet is easy, &lt;em&gt;much easier than writing a Camel component&lt;/em&gt;, if you’ve ever tried doing so. We’ve written 
an extended &lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets-dev.html&quot;&gt;Kamelet developer guide&lt;/a&gt; that covers
both easy and complex scenarios.&lt;/p&gt;

&lt;p&gt;We know that creating a source or a sink and also &lt;strong&gt;doing it right&lt;/strong&gt; may be difficult (integration is hard, that’s why we have Apache Camel) and involve multiple enterprise integration patterns. The
Kamelet developer guide contains a &lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets-dev.html#_step_5_wrap_it_into_a_kamelet&quot;&gt;section about an “Earthquake” source&lt;/a&gt; that is complicated on purpose, to mimic a Kamelet that may be developed for handling data inside an organization.&lt;/p&gt;

&lt;p&gt;When writing a new Kamelet, you can use plain YAML to describe a route template, add Java (or Groovy, or …) code snippets 
if you need them, or also link an external Maven project in case you want to add a more complex behavior to it (we did it in the &lt;a href=&quot;https://github.com/apache/camel-kamelets/blob/1480bd372d42df0a185b4980b465ec245f2de0c5/avro-serialize-action.kamelet.yaml#L34&quot;&gt;camel-kamelets&lt;/a&gt; repository, where we build the default catalog of Kamelets).&lt;/p&gt;

&lt;p&gt;What does not change is that, once a Kamelet is written, the logic inside it is &lt;strong&gt;well encapsulated&lt;/strong&gt; and you can treat it
as &lt;strong&gt;any other connector&lt;/strong&gt;, in a Binding or in the Karavan UI.&lt;/p&gt;

&lt;p&gt;A Kamelet is then the element that enables low code development: it’s easy to configure and embeddable in any UI (such as we’ve done in Karavan), and allows you to fully customize its behavior, even writing various degrees of custom code, up to the lowest level elements of a Camel integration route.&lt;/p&gt;

&lt;h2 id=&quot;where-to-go-next&quot;&gt;Where to go next&lt;/h2&gt;

&lt;p&gt;Check out the &lt;a href=&quot;https://github.com/apache/camel-karavan&quot;&gt;Karavan repository&lt;/a&gt;, where you can build an run the Karavan designer. There’s also a &lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=camel-karavan.karavan&quot;&gt;VSCode extension&lt;/a&gt; that will let you design integrations directly from the IDE.&lt;/p&gt;

&lt;p&gt;Then start playing with Karavan in combination with &lt;a href=&quot;https://camel.apache.org/camel-k/latest/&quot;&gt;Camel K&lt;/a&gt; and
the &lt;a href=&quot;https://camel.apache.org/camel-kamelets/latest/&quot;&gt;Kamelet catalog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And finally look at how easy is to &lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets-dev.html&quot;&gt;create and use your own Kamelets&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We’d love to hear your feedback!&lt;/p&gt;</content><author><name>Nicola Ferraro</name></author><category term="Dev" /><category term="Apache Camel" /><category term="Kamelets" /><category term="Camel K" /><category term="Kubernetes" /><category term="Openshift" /><category term="Knative" /><category term="JBoss Fuse" /><summary type="html">How Kamelets enable a low code integration experience.</summary></entry><entry><title type="html">From Camel to Kamelets: new connectors for event-driven applications</title><link href="https://www.nicolaferraro.me/2021/10/10/from-camel-to-kamelets/" rel="alternate" type="text/html" title="From Camel to Kamelets: new connectors for event-driven applications" /><published>2021-10-10T00:00:00+02:00</published><updated>2021-10-10T09:00:00+02:00</updated><id>https://www.nicolaferraro.me/2021/10/10/from-camel-to-kamelets</id><content type="html" xml:base="https://www.nicolaferraro.me/2021/10/10/from-camel-to-kamelets/">&lt;p&gt;I’ve done two similar talks this year at ApacheCon @Home and Asia, both on the ease of use of the new Kamelet paradigm when building event-driven applications.&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/xVL1gJ5AJVg&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;</content><author><name>Nicola Ferraro</name></author><category term="Talks" /><category term="Apache Camel" /><category term="Camel K" /><category term="Knative" /><category term="Openshift" /><category term="Kubernetes" /><category term="Serverless" /><category term="JBoss Fuse" /><summary type="html">I’ve done two similar talks this year at ApacheCon @Home and Asia, both on the ease of use of the new Kamelet paradigm when building event-driven applications.</summary></entry><entry><title type="html">Camel K 1.4.0 Released</title><link href="https://www.nicolaferraro.me/2021/04/20/camel-k-1-4/" rel="alternate" type="text/html" title="Camel K 1.4.0 Released" /><published>2021-04-20T00:00:00+02:00</published><updated>2021-04-20T02:00:00+02:00</updated><id>https://www.nicolaferraro.me/2021/04/20/camel-k-1-4</id><content type="html" xml:base="https://www.nicolaferraro.me/2021/04/20/camel-k-1-4/">&lt;blockquote&gt;
  &lt;p&gt;Note: this post has been published also in the &lt;a href=&quot;https://camel.apache.org/blog/2021/04/camel-k-140-Whatsnew/&quot;&gt;Apache Camel blog&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;/images/camel-featured.png&quot; alt=&quot;Camel K 1.4.0&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Apache Camel K 1.4.0 has just been released!&lt;/p&gt;

&lt;p&gt;This is a new major release of Camel K with an improved stability over previous versions, but also adding new features
that simplify the overall user experience.&lt;/p&gt;

&lt;p&gt;It is based on Camel 3.9.0 and Camel-Quarkus 1.8.1, providing all improvements that they bring, plus much more. In this blog post, we’re going to describe the most important changes.&lt;/p&gt;

&lt;h2 id=&quot;embedded-kamelet-catalog&quot;&gt;Embedded Kamelet catalog&lt;/h2&gt;

&lt;p&gt;Camel K 1.4.0 comes with an embedded &lt;a href=&quot;https://camel.apache.org/camel-kamelets/latest/&quot;&gt;Kamelet catalog&lt;/a&gt; containing multiple connectors ready for use.&lt;/p&gt;

&lt;p&gt;When installing the operator into a namespace (but also globally in the cluster), the operator installs all the kamelets from the catalog (&lt;a href=&quot;https://github.com/apache/camel-kamelets/tree/v0.2.1&quot;&gt;version 0.2.1&lt;/a&gt;), so that any integration can use them directly.&lt;/p&gt;

&lt;p&gt;Users can bind them to a specific destination by writing a YAML binding file, as explained in the &lt;a href=&quot;https://camel.apache.org/camel-kamelets/latest/aws-sqs-source.html#_knative_source&quot;&gt;specific documentation related to each Kamelet&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Or, you can use the new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel bind&lt;/code&gt; command (see below).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; it’s easy to write your own Kamelet and publish it to the Apache Catalog. Take a look at the &lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets-dev.html&quot;&gt;Kamelets developer guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;kamel-bind-command&quot;&gt;Kamel bind command&lt;/h2&gt;

&lt;p&gt;We’ve added a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bind&lt;/code&gt; subcommand to the  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel&lt;/code&gt; CLI that provides a new way to use Kamelets directly when you need to connect them to Knative channels, Kafka topics and any other endpoint.&lt;/p&gt;

&lt;p&gt;E.g. Suppose that you want to get events of earthquakes happening around the world, as JSON objects, in your Knative channel named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;earthquakes&lt;/code&gt;. All you need to do is to install Camel K on your cluster and then execute the following command:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel bind earthquake-source channel:earthquakes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This command creates the KameletBinding resource for you and the Camel K operator does the rest to bring that data into your channel.
Data is produced using the &lt;a href=&quot;https://camel.apache.org/camel-kamelets/latest/earthquake-source.html&quot;&gt;Earthquake Source&lt;/a&gt; Kamelet available in the embedded Katalog.&lt;/p&gt;

&lt;p&gt;You can use any other Kamelet from the catalog using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel bind&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;You can also target any other Kubernetes reference that is supported by Camel K, for example, sink into a &lt;a href=&quot;https://strimzi.io/&quot;&gt;Strimzi KafkaTopic&lt;/a&gt;, using a fully qualified reference, for example:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel bind earthquake-source kafka.strimzi.io/v1beta1:KafkaTopic:mytopic
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Of course, the command also supports plain Camel URIs, which are useful especially when you’re developing a new Kamelet. For example, you can write:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel bind earthquake-source log:info?showHeaders=true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And the command will create a binding that just prints to the log the JSON data produced by the source.&lt;/p&gt;

&lt;h2 id=&quot;kamel-dump-command&quot;&gt;Kamel dump command&lt;/h2&gt;

&lt;p&gt;When users have issues understanding why Camel K is not behaving as expected, they often need to provide useful information 
about the current state of their cluster, to let Camel K developers investigate the issue and provide a solution or a quick workaround (e.g. in a Github issue, or in the Zulip chat).&lt;/p&gt;

&lt;p&gt;Usually, to identify the root cause of an issue, developers need to know things like:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;What routes the user is trying to run&lt;/li&gt;
  &lt;li&gt;What the Camel K operator is doing&lt;/li&gt;
  &lt;li&gt;What images have been built, which versions of all libraries are they using&lt;/li&gt;
  &lt;li&gt;What’s the state of the Camel K custom resources&lt;/li&gt;
  &lt;li&gt;What errors do Camel K integration throw when they start&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Providing such information has always been hard, but we now have a quick way to obtain all that.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel dump status.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This simple command will store in a text file all the information needed to investigate a possible issue in the cluster.
The user can now &lt;em&gt;edit the file to remove sensitive information&lt;/em&gt; (which the command may not be able to tell apart), then 
share it with developers to have much better insights.&lt;/p&gt;

&lt;h2 id=&quot;stability-and-compatibility&quot;&gt;Stability and compatibility&lt;/h2&gt;

&lt;p&gt;We focused a lot on stability and improved compatibility with other tools of the ecosystem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Knative support&lt;/strong&gt; (0.22.0) has been improved by fixing compatibility issues that sometimes caused multiple revisions
to be present for the same service. We’ve also changed the way channels and brokers are bound to the integrations. Now it’s possible
to bind integrations to multiple channels and even create sequences of integrations attached to channels without any issue (e.g. &lt;a href=&quot;https://github.com/apache/camel-k/pull/2190&quot;&gt;#2190&lt;/a&gt;, &lt;a href=&quot;https://github.com/apache/camel-k/pull/2115&quot;&gt;#2115&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;We’ve improved &lt;strong&gt;installation options&lt;/strong&gt;, letting you configure things that may be important in a production environment, like &lt;a href=&quot;https://github.com/apache/camel-k/pull/2114&quot;&gt;setting toleration&lt;/a&gt; or using a &lt;a href=&quot;https://github.com/apache/camel-k/pull/2180&quot;&gt;secured maven repository&lt;/a&gt;.
At the same time, we’ve fixed compatibility with recent dev environments, e.g. letting you &lt;a href=&quot;https://camel.apache.org/camel-k/latest/installation/registry/k3s.html&quot;&gt;smoothly install Camel K in K3S&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We also kept doing changes to continuously improve speed. On the runtime side of Camel K, we now use the &lt;a href=&quot;https://github.com/apache/camel-k/pull/1931&quot;&gt;Quarkus fast-jar format&lt;/a&gt; to reduce boot times. And last but not least on the operator side, it’s possible to install Camel K globally in a cluster and have much faster build times by &lt;a href=&quot;https://github.com/apache/camel-k/pull/2058&quot;&gt;sharing base images across the cluster&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The list of important changes in the &lt;a href=&quot;https://github.com/apache/camel-k/releases/tag/v1.4.0&quot;&gt;1.4.0 release&lt;/a&gt; is too long for this blog post. There have &lt;strong&gt;never been so many contributors&lt;/strong&gt; as in this release and we &lt;strong&gt;thank them all for their awesome work!&lt;/strong&gt;&lt;/p&gt;</content><author><name>Nicola Ferraro</name></author><category term="Dev" /><category term="Apache Camel" /><category term="Camel K" /><category term="Kamelets" /><category term="Knative" /><category term="Openshift" /><category term="Kubernetes" /><category term="Serverless" /><category term="JBoss Fuse" /><summary type="html">Details of what we have done in the Camel K 1.4.0 release.</summary></entry><entry><title type="html">Kamelet Catalog</title><link href="https://www.nicolaferraro.me/2021/02/24/kamelet-catalog/" rel="alternate" type="text/html" title="Kamelet Catalog" /><published>2021-02-24T00:00:00+01:00</published><updated>2021-02-24T01:00:00+01:00</updated><id>https://www.nicolaferraro.me/2021/02/24/kamelet-catalog</id><content type="html" xml:base="https://www.nicolaferraro.me/2021/02/24/kamelet-catalog/">&lt;blockquote&gt;
  &lt;p&gt;Note: this post has been published also in the &lt;a href=&quot;https://camel.apache.org/blog/2021/02/Kamelet-Catalog/&quot;&gt;Apache Camel blog&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;/images/post-kamelet-catalog-featured.png&quot; alt=&quot;Kamelet Catalog&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We’re starting a new initiative at Apache Camel to create a community-driven catalog of reusable Kamelets (&lt;em&gt;Camel&lt;/em&gt; route snipp&lt;em&gt;ets&lt;/em&gt;, i.e. connectors) that can be used to stream data from/to external systems into any platform powered by Apache Camel.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://camel.apache.org/camel-kamelets/latest&quot;&gt;“Apache Camel Kamelet catalog” is available here&lt;/a&gt; and it already contains a collection of useful Kamelets: we would like to extend it with help of the community.&lt;/p&gt;

&lt;p&gt;Kamelets are currently supported out-of-the-box by the &lt;a href=&quot;https://camel.apache.org/camel-k/latest&quot;&gt;Apache Camel K&lt;/a&gt; project and we’re working to support them also in Camel core, so that they can run eventually in any Apache Camel subproject, like &lt;a href=&quot;https://camel.apache.org/camel-kafka-connector/latest/&quot;&gt;Camel Kafka Connector&lt;/a&gt; (but also camel-quarkus, camel-spring-boot, …).&lt;/p&gt;

&lt;h2 id=&quot;why-are-they-useful&quot;&gt;Why are they useful?&lt;/h2&gt;

&lt;p&gt;The most important reason why the new Kamelet catalog is so useful is that it provides a collection of connectors that are not tied to a particular platform, but they can be reused in multiple contexts. The new &lt;strong&gt;OpenShift 4.7 developer console&lt;/strong&gt; is a clear evidence of this pattern. You can look at what it provides in the following animation:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/kamelet-catalog-source-demo.gif&quot; alt=&quot;Kamelet Catalog demo in Openshift 4.7 Developer Console&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The console shows a serverless environment where a Knative channel has been created and it’s ready to receive and dispatch events to a registered subscribing service.
From the console, the user can add a new “Event Source” and the UI displays a collection of possibilities: well, starting from Camel K 1.4.0, that collection of sources will display &lt;strong&gt;the official Apache Camel Kamelet catalog&lt;/strong&gt;. This means that &lt;a href=&quot;#contributing&quot;&gt;contributing&lt;/a&gt; new Kamelets to the catalog will allow you to enhance the OpenShift catalog of Knative sources, for instance.&lt;/p&gt;

&lt;p&gt;But there’s nothing in the Kamelet catalog specifically related to OpenShift: &lt;strong&gt;we show this to encourage people to take the same approach&lt;/strong&gt; for other platforms (in-house or open source, especially Kubernetes-based) and use cases. One of the advantages of this approach is that, since Kamelets provide a &lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets-user.html#kamelets-example&quot;&gt;well defined JSON-schema interface&lt;/a&gt; for their configuration, they can be made available for any kind of users, including those who don’t even know anything about Apache Camel.&lt;/p&gt;

&lt;p&gt;So, no matter if you need ingress/egress for a specific destination (like in the Knative example above) or you’re working on an event orchestration/workflow tool, or you’re just creating a IFTTT clone: &lt;strong&gt;if you need connectors, look at Kamelets&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Kamelets are not only useful in Web/UI projects, they can be also used from a CLI. For instance, there’s a &lt;a href=&quot;https://github.com/knative-sandbox/kn-plugin-source-kamelet&quot;&gt;plugin in the making in the Knative sandbox&lt;/a&gt; that will allow users to easily create Knative sources from Kamelets using the Knative &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kn&lt;/code&gt; CLI.&lt;/p&gt;

&lt;p&gt;Leaving the Kubernetes world, you can also imagine how the Kamelet Catalog can improve the user experience in Camel Kafka Connectors. As of today, A Camel Kafka connector can be created from a single Camel component: this is a quite powerful model, since components have a high degree of configurability, but it has severe limitations because complex use cases cannot be fulfilled by configuring a single Camel component. The Kamelet model will allow Camel Kafka Connector users to develop more complex use cases (because a Kamelet is a route template that can use multiple components and enterprise integration patterns) and share their connectors with other users via the Kamelet catalog.&lt;/p&gt;

&lt;h2 id=&quot;kamelet-vs-component&quot;&gt;Kamelet vs. Component&lt;/h2&gt;

&lt;p&gt;There’s a question that often arises and it relates to the difference between a Camel component and a Kamelet.&lt;/p&gt;

&lt;p&gt;From a pure user perspective, the main difference between them is that the Camel component is a highly configurable resource that is intended to be used in 
a Camel development environment. Components contain lots of properties that allow to customize every aspect of their behavior and how they interact with the Camel context, the registry and so on. Additionally, a single Camel component can serve multiple purposes: e.g. the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camel-facebook&lt;/code&gt; component allows receiving any kind of event or execute any action on Facebook; the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camel-http&lt;/code&gt; component allows to contact any external &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;http&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;https&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;p&gt;By contrast, Kamelets are tailored around actual use cases. A &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;todo-sink&lt;/code&gt; Kamelet may be created in the catalog to transform an event into an entry of a “To-Do Application” (I refer here to that kind of applications where you add the things you need to, and later mark them as resolved). It may use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camel-http&lt;/code&gt; component under the hood, but that will be an implementation detail. The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;todo-sink&lt;/code&gt; Kamelet will also expose to the end user not the full list of parameters available in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camel-http&lt;/code&gt; component, but a reduced set of configuration properties that are relevant for the business purpose (i.e. adding an entry into a “To-Do Application”).
Similarly, when the Kamelet model will evolve with the help of the community, there won’t be a single &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;facebook-source&lt;/code&gt; Kamelet, but there will be probably many facebook-related sources, one for each use case that the community finds relevant.&lt;/p&gt;

&lt;p&gt;An important corollary of all this is that we’re not going to auto-generate the Kamelet catalog from the components, instead, we’ll follow a more opinionated approach taking into consideration the user needs rather than what the components already provide.&lt;/p&gt;

&lt;h2 id=&quot;contributing&quot;&gt;Contributing&lt;/h2&gt;

&lt;p&gt;Contributions are welcome for the Kamelet catalog. All you need to do is to follow the guidelines in the &lt;a href=&quot;https://github.com/apache/camel-kamelets&quot;&gt;official repository for the Kamelet catalog on Github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here’s a list of relevant resources that you may want to learn before starting creating your own Kamelets:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets.html&quot;&gt;Introduction to Kamelets in Camel K documentation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.nicolaferraro.me/2020/10/12/kamelets/&quot;&gt;Kamelets by Nicola Ferraro&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Nicola Ferraro</name></author><category term="Dev" /><category term="Apache Camel" /><category term="Kamelets" /><category term="Camel K" /><category term="Knative" /><category term="Openshift" /><category term="Kubernetes" /><category term="Serverless" /><category term="JBoss Fuse" /><summary type="html">We're starting a new initiative at Apache Camel to create a community-driven catalog of reusable Kamelets</summary></entry><entry><title type="html">Debugging Camel K</title><link href="https://www.nicolaferraro.me/2020/11/30/debugging-camel-k/" rel="alternate" type="text/html" title="Debugging Camel K" /><published>2020-11-30T00:00:00+01:00</published><updated>2020-11-30T01:00:00+01:00</updated><id>https://www.nicolaferraro.me/2020/11/30/debugging-camel-k</id><content type="html" xml:base="https://www.nicolaferraro.me/2020/11/30/debugging-camel-k/">&lt;p&gt;Camel K introduces new ways of dealing with integration problems by letting you develop and run routes in the cloud, where the services that you need to connect live.
This has many advantages, since it makes it easy to use all the features available in the cloud environment from the very beginning. For example, you can leverage service discovery, you can make your integration passive and let it receive push notifications from Knative with real data… But this comes with a cost.&lt;/p&gt;

&lt;p&gt;When something goes wrong while you’re developing a new integration, you’d like to easily understand what’s going on and fix your code.
Since the integration is not running locally, it’s not easy to leverage all your IDE tools to troubleshoot. 
But we’re working to improve the experience on many fronts. I’m describing here the new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel debug&lt;/code&gt; command.&lt;/p&gt;

&lt;h2 id=&quot;debug-command&quot;&gt;Debug command&lt;/h2&gt;

&lt;p&gt;Suppose you’re working on an integration problem and you’ve designed your route as:&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.apache.camel.Header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;org.apache.camel.builder.RouteBuilder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Flaky&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RouteBuilder&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nd&quot;&gt;@Override&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;configure&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;throws&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;timer:clock?period=5000&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;bean&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;createPayload&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;https://postman-echo.com/post&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;sent!&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;createPayload&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;@Header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;CamelTimerCounter&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Integer&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tick&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tick&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I’m writing the “createPayload” method directly in the route file, but likely you’ll put it in a separate library.&lt;/p&gt;

&lt;p&gt;This is a simple route that every 5 seconds builds a payload and sends it to a HTTPS destination.&lt;/p&gt;

&lt;p&gt;You can run it with:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel run Flaky.java
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once it starts, you notice that there’s an issue in the way the payload is built, 
since the output signals an error in the first exchange.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[1] 2020-11-30 09:22:02,377 WARN  [org.apa.cam.com.tim.TimerConsumer] (Camel (camel-1) thread #0 - timer://clock) Error processing exchange. Exchange[746A22E1144A36D-0000000000000000]. Caused by: [java.lang.ArithmeticException - / by zero]: java.lang.ArithmeticException: / by zero
[1]     at Flaky.createPayload(Flaky.java:18)
[1]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[1]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[1]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[1]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[1]     at org.apache.camel.support.ObjectHelper.invokeMethodSafe(ObjectHelper.java:208)
[1]     at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:425)
[1]     at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:247)
[1]     at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:217)
[1]     at org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:154)
[1]     at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:56)
[1]     at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:404)
[1]     at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
[1]     at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
[1]     at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
[1]     at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:287)
[1]     at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:207)
[1]     at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
[1]     at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
[1]     at java.base/java.util.TimerThread.run(Timer.java:506)
[1] 
[1] 2020-11-30 09:22:08,088 INFO  [route1] (Camel (camel-1) thread #0 - timer://clock) sent!
[1] 2020-11-30 09:22:13,236 INFO  [route1] (Camel (camel-1) thread #0 - timer://clock) sent!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It’s easy to understand what’s wrong here, because this is a hand crafted example, but in a real integration case, your business logic may be 
much more complex and it won’t be easy to understand the problem, until you actually look into the running code.&lt;/p&gt;

&lt;p&gt;There’s a new command in Camel K 1.3.0 that allows you to &lt;strong&gt;switch a remote integration to “debug mode”&lt;/strong&gt;. This way the integration can be connected to
your IDE and you can use breakpoints to check specific sections of the code for bugs. The kamel CLI will take care of setting the right flags on the 
integration and also establishing a secure tunnel to let your IDE connect to the integration.&lt;/p&gt;

&lt;p&gt;To switch to the debug mode, just run:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel debug flaky
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;flaky&lt;/code&gt; is just the name of the integration. This is an example of output:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kamel debug flaky
Enabling debug mode on integration &quot;flaky&quot;...
Forwarding from 127.0.0.1:5005 -&amp;gt; 5005
Forwarding from [::1]:5005 -&amp;gt; 5005
[1] Monitoring pod flaky-76f67fb58-rk8g8
[1] exec java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005 -cp ./resources:[...] io.quarkus.runner.GeneratedMain
[1] Listening for transport dt_socket at address: 5005
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you see, the integration is waiting for you to connect your IDE on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;localhost&lt;/code&gt; on port &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;5005&lt;/code&gt; using the debug protocol.
You can configure your IDE to attach to the process via that host an port. This is IDE specific, but all modern IDEs support remote debugging.&lt;/p&gt;

&lt;p&gt;If you’re using VSCode, you can put a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;launch.json&lt;/code&gt; file in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.vscode&lt;/code&gt; dir at the root of your project, with the following content:&lt;/p&gt;

&lt;div class=&quot;language-json highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;version&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;0.2.0&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;configurations&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;java&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Debug Camel K Integration&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;request&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;attach&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;hostName&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;localhost&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;port&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5005&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is enough to connect. The final result is shown in the following image:&lt;/p&gt;

&lt;p style=&quot;text-align: center&quot;&gt;
    &lt;img src=&quot;/images/camel-k-debug.gif&quot; alt=&quot;IDE Debug&quot; /&gt;
    &lt;caption align=&quot;bottom&quot;&gt;&lt;i&gt;IDE Debug&lt;/i&gt;&lt;/caption&gt;
&lt;/p&gt;

&lt;p&gt;At the end of the debug session, the integration will be restored to its normal state.&lt;/p&gt;

&lt;p&gt;Have fun with Camel K!&lt;/p&gt;</content><author><name>Nicola Ferraro</name></author><category term="Dev" /><category term="Apache Camel" /><category term="Camel K" /><category term="Knative" /><category term="Openshift" /><category term="Kubernetes" /><category term="Serverless" /><category term="JBoss Fuse" /><summary type="html">What if your Camel K integration does not work as expected? How do you debug it? Well, there's a &quot;debug&quot; command now...</summary></entry><entry><title type="html">Kamelets</title><link href="https://www.nicolaferraro.me/2020/10/12/kamelets/" rel="alternate" type="text/html" title="Kamelets" /><published>2020-10-12T00:00:00+02:00</published><updated>2020-10-12T18:00:00+02:00</updated><id>https://www.nicolaferraro.me/2020/10/12/kamelets</id><content type="html" xml:base="https://www.nicolaferraro.me/2020/10/12/kamelets/">&lt;p&gt;Kamelets are the most important feature released with Apache Camel K 1.2.0. Apart from their cool name, Kamelets represent a significant change in the whole Camel ecosystem, because they introduce new ways of using Apache Camel in the cloud and a novel approach for contributing new connectors.&lt;/p&gt;

&lt;h2 id=&quot;what-is-a-kamelet&quot;&gt;What is a Kamelet?&lt;/h2&gt;

&lt;p&gt;A Kamelet is a “&lt;strong&gt;Kamel&lt;/strong&gt; Route Snipp&lt;strong&gt;et&lt;/strong&gt;”. Before going into the details of what this actually means, let’s make a step backward to add some background context.&lt;/p&gt;

&lt;p&gt;Traditionally, the building blocks of Apache Camel have always been the &lt;strong&gt;components&lt;/strong&gt;. Camel users can write complex routes by leveraging the 350+ components that are available in Apache Camel. It’s not a fixed pool: Camel developers and contributors are constantly increasing the collection of supported components at each new release.&lt;/p&gt;

&lt;p&gt;This model has worked very well for all these years and it will continue to work. But it &lt;strong&gt;misses an important feature&lt;/strong&gt; that we want to cover with Kamelets: the &lt;strong&gt;ability to abstract&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In Camel, if I want to publish a tweet in response to a Knative event, I’d do something like this:&lt;/p&gt;

&lt;div class=&quot;language-groovy highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'knative:event/public.post'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'twitter-timeline://user'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Every time some application sends an event of type “public.post” to the Knative broker, that event is published in my Twitter timeline.&lt;/p&gt;

&lt;p&gt;As a user, I don’t care about what the “twitter-timeline” component is doing under the covers: it may contact a single API, or more than one, or it may establish several connections to various systems using strange protocols. I’m only interested in the result.&lt;/p&gt;

&lt;p&gt;Now, being an enterprise user, I would like to do a similar thing with my own systems and create a new component to add an item to the inventory of my e-commerce application. I decide to create a new component named &lt;strong&gt;“company-inventory”&lt;/strong&gt; that provides an &lt;strong&gt;“add”&lt;/strong&gt; endpoint to implement such feature. So:&lt;/p&gt;

&lt;div class=&quot;language-groovy highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'knative:event/new.item'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'company-inventory://add'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// easy, but now try to implement it&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now it’s time to implement the “company-inventory” component. When adding an item to the inventory, &lt;em&gt;we need to call an HTTP API to get the ID of the actual item type, call another API if the ID is not already present, in order to create a new one, then a third API to add the item, then add another event to a third-party Kafka topic to synchronize downstream services&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Easy?&lt;/strong&gt; Of course, with Apache Camel. But guess what? &lt;strong&gt;You can’t use Apache Camel when writing a new component&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;True. Developers who contribute code to Apache Camel usually adapt existing libraries to the Camel APIs, but they can’t leverage existing components.
There’s been an attempt in Camel 2.x to bring such possibility with the &lt;a href=&quot;https://camel.apache.org/components/2.x/routebox-component.html&quot;&gt;Routebox component&lt;/a&gt;, 
but it was not intuitive in some parts and missed a good delivery model, so it wasn’t widely used and it was finally removed in 3.x in favor of this new idea of Kamelets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kamelets come to the rescue&lt;/strong&gt;. With Kamelets you can encapsulate the logic to connect to a specific system into &lt;a href=&quot;https://camel.apache.org/manual/latest/route-template.html&quot;&gt;&lt;strong&gt;route templates&lt;/strong&gt; (new feature of Camel 3.5.0)&lt;/a&gt;. And guess what? &lt;strong&gt;Kamelets are made of pure Camel DSL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Kamelets are Kubernetes resources. We’ll see shortly how to write them. As any Kubernetes resource, you can write a Kamelet into a file and install it on a cluster using Kubectl:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;company-inventory-add.kamelet.yaml&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;camel.apache.org/v1alpha1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Kamelet&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;company-inventory-add&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# The Kamelet will declare all accepted parameters&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# in JSON-schema format.&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# &lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# Skipping the details here.&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;flow&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# Here's the route&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;uri&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;kamelet:source&quot;&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;steps&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;http://first-endpoint&quot;&lt;/span&gt;
        &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;https://second-endpoint/{{itemType}}&quot;&lt;/span&gt;
        &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;choice&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
          &lt;span class=&quot;pi&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;kafka:downstream&quot;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’m not going into the details of how to write a Kamelet, that is &lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets.html&quot;&gt;covered in the Camel K user guide about Kamelets&lt;/a&gt;. We need just to know that:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A Kamelet exposes a well defined JSON-schema interface, that documents its purpose and defines the accepted parameters.&lt;/li&gt;
  &lt;li&gt;A Kamelet can be a source of data or a sink (consumer or producer, in the Camel jargon). The “company-inventory-add” Kamelet is a sink.&lt;/li&gt;
  &lt;li&gt;A Kamelet defines what Camel code should be executed when the Kamelet is used inside an integration: the code is expressed as route template that can use properties (e.g. “{{itemType}}”)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can install the Kamelet on a namespace by simply executing:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kubectl apply &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; company-inventory-add.kamelet.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once done so, the Kamelet becomes available in all integrations that are deployed in the same Kubernetes namespace. So you can write a route like this to use the Kamelet:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;example.groovy&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-groovy highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'knative:event/new.item'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'kamelet://company-inventory-add?itemType=grocery'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// implementing this is much simpler&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And run it with:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel run example.groovy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The logic about what it means to add an inventory item is encapsulated in the Kamelet (multiple HTTP calls, enterprise integration patterns and sync with Kafka), that can be shared among all other integrations. And it’s all &lt;strong&gt;Camel DSL&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is only a simple example of what a Kamelet can do, there are many more interesting use cases out there.&lt;/p&gt;

&lt;h2 id=&quot;what-about-knative-sources&quot;&gt;What about Knative sources?&lt;/h2&gt;

&lt;p&gt;The first time we thought about Kamelets was in the context of &lt;a href=&quot;https://knative.dev/docs/eventing/sources/&quot;&gt;Knative Eventing sources&lt;/a&gt;. It was the end of 2018, believe it or not.
We thought that they could really make the difference in that space, but we were not ready for the leap.&lt;/p&gt;

&lt;p&gt;We are currently providing &lt;a href=&quot;https://knative.dev/docs/eventing/samples/apache-camel-source/&quot;&gt;CamelSources&lt;/a&gt; in Knative, and they are really cool because they &lt;em&gt;allow users to write a small piece of Camel DSL&lt;/em&gt; to produce any kind of event, taking data from any system that Camel supports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So, what’s wrong with CamelSources?&lt;/strong&gt; They are really cool from my point of view. But the problem is that Knative users are usually &lt;strong&gt;not&lt;/strong&gt; Camel users.
As a Camel user, I can write a piece of Camel DSL in a few minutes and make it work. But people with a background in Go or Python… they don’t even know what Camel actually is.&lt;/p&gt;

&lt;p&gt;But that’s where a Kamelet can help.&lt;/p&gt;

&lt;p&gt;Camel developers and passionate contributors will write the Camel DSL, creating “connectors” for external sources using the language of Kamelets.
In future versions of Camel K, we’ll create a &lt;strong&gt;catalog of curated Kamelets&lt;/strong&gt; that will be installed together with Camel K.
Those Kamelets will be available to anyone who installs Camel K on a Kubernetes cluster.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/kamelets-binding.png&quot; alt=&quot;kamelet-binding&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Without any knowledge of Apache Camel, people can list the catalog of the available Kamelets with standard Kubernetes tools:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;kubectl get kamelets
NAME
inventory-source
twitter-source
slack-source
telegram-source
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Kamelets declare the list of expected parameters using a JSON-schema format, so it will be easy to check them and provide values.&lt;/p&gt;

&lt;p&gt;Users can then decide to use a Kamelet e.g. to push some twitter data into the Knative broker. To do so, they can create a &lt;strong&gt;KameletBinding&lt;/strong&gt;.&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;camel.apache.org/v1alpha1&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;KameletBinding&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;twitter-source-to-knative&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;spec&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;camel.apache.org/v1alpha1&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Kamelet&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;twitter-source&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;keywords&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Apache Camel&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;sink&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;ref&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;apiVersion&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;eventing.knative.dev/v1&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;kind&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Broker&lt;/span&gt;
      &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;default&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you see, the final user will not need to know anything about Camel, only use the source.&lt;/p&gt;

&lt;p&gt;Of course, the &lt;strong&gt;KameletBinding&lt;/strong&gt; resource is a wrapper for an Integration. I.e. under the hood the operator will create the Camel DSL corresponding to the binding, which is something like:&lt;/p&gt;

&lt;div class=&quot;language-groovy highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;only&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;demonstration&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;we&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;don&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;t&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;generate&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;groovy&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;code&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'kamelet:twitter-source?keywords=Apache+Camel'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'knative:event'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This makes Kamelets available to different kind of users: Camel users and Knative users, with a different interface.&lt;/p&gt;

&lt;h2 id=&quot;so-is-it-only-about-knative&quot;&gt;So, is it only about Knative?&lt;/h2&gt;

&lt;p&gt;Of course not: Kamelets are general purpose connectors, not directly linked to Knative.&lt;/p&gt;

&lt;p&gt;If I want to send data from my Twitter Kamelet to a Kafka topic, I just need to create the following code and run it:&lt;/p&gt;

&lt;div class=&quot;language-groovy highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'kamelet:twitter-source?keywords=Apache+Camel'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'kafka:topic'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;All Kamelets can be used to feed Kafka instead of Knative with the same exact approach. In fact, we’ve also extended the &lt;strong&gt;KameletBinding&lt;/strong&gt; mechanism to Kafka via &lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets.html#_binding_to_a_kafka_topic&quot;&gt;Strimzi&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;what-makes-kamelets-great&quot;&gt;What makes Kamelets great?&lt;/h2&gt;

&lt;p&gt;The main difference between a Kamelet and a Camel component is its purpose. While a component can serve several purposes
by specifying different combinations of the parameters, &lt;strong&gt;Kamelets are driven by use cases&lt;/strong&gt;. A Kamelet can let you perform
a specific action on a system or gather data from another system, with a limited degree of flexibility.&lt;/p&gt;

&lt;p&gt;Reducing the scope helps designing CLI or &lt;strong&gt;UI tools&lt;/strong&gt; around them.&lt;/p&gt;

&lt;p&gt;A Kamelet contains (see the &lt;a href=&quot;https://camel.apache.org/camel-k/latest/kamelets/kamelets.html#kamelets-specification&quot;&gt;Kamelet specification&lt;/a&gt; for more details):&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Title and description of the purpose of the Kamelet and how to use it&lt;/li&gt;
  &lt;li&gt;A nice icon&lt;/li&gt;
  &lt;li&gt;The set of expected parameters in JSON-schema format&lt;/li&gt;
  &lt;li&gt;The schema of the output they produce (or the input they require)&lt;/li&gt;
  &lt;li&gt;Implementation (Camel DSL)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Writing a UI that allows browsing the available Kamelets, configure them and bind them to a destination should be pretty easy.&lt;/p&gt;

&lt;p&gt;There are many possible use cases:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A specialized UI, e.g. in the OpenShift dev console, can let the user browse the available Kamelets and configure them via a graphical form to send data to a particular Knative destination&lt;/li&gt;
  &lt;li&gt;A second specialized UI about Kafka can include a section where the users can instantiate the Kamelets to bring data to a particular topic&lt;/li&gt;
  &lt;li&gt;Another platform, e.g. like &lt;a href=&quot;https://syndesis.io/&quot;&gt;Syndesis&lt;/a&gt; can use the Kamelets to provide additional connectors for creating end-to-end integrations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The great thing about Kamelets is that they are not bound to a spcific technology: they are reusable connectors.&lt;/p&gt;

&lt;h2 id=&quot;try-them-out&quot;&gt;Try them out!&lt;/h2&gt;

&lt;p&gt;Camel K 1.2.0 has already been released, so, why don’t you try this new feature?&lt;/p&gt;

&lt;p&gt;Feedback is welcome, as well as any kind of contribution!&lt;/p&gt;

&lt;p&gt;Meet us on &lt;a href=&quot;https://camel.zulipchat.com/&quot;&gt;Zulip&lt;/a&gt;!&lt;/p&gt;</content><author><name>Nicola Ferraro</name></author><category term="Dev" /><category term="Apache Camel" /><category term="Kamelets" /><category term="Camel K" /><category term="Knative" /><category term="Openshift" /><category term="Kubernetes" /><category term="Serverless" /><category term="JBoss Fuse" /><summary type="html">Kamelets are the most important feature released with Apache Camel K 1.2.0. Apart from their cool name, Kamelets represent a significant change in the whole Camel ecosystem, because they introduce new ways of using Apache Camel in the cloud and a novel approach for contributing new connectors.</summary></entry><entry><title type="html">Serverless Integration on Kubernetes with Apache Camel K</title><link href="https://www.nicolaferraro.me/2020/09/08/serverless-integration-kubecon/" rel="alternate" type="text/html" title="Serverless Integration on Kubernetes with Apache Camel K" /><published>2020-09-08T00:00:00+02:00</published><updated>2020-09-08T09:00:00+02:00</updated><id>https://www.nicolaferraro.me/2020/09/08/serverless-integration-kubecon</id><content type="html" xml:base="https://www.nicolaferraro.me/2020/09/08/serverless-integration-kubecon/">&lt;p&gt;I’ve presented Apache Camel at the last Kubecon EU conference that took place on August 19th, 2020.&lt;/p&gt;

&lt;p&gt;As for many conferences this year, Kubecon EU was held online, not in the sunny Amsterdam as it was planned. No time to meet in person the developers that are making really good things in the Knative and Kubernetes space, but the 
talks were pretty awesome, and now everybody can &lt;a href=&quot;https://www.youtube.com/playlist?list=PLj6h78yzYM2O1wlsM-Ma-RYhfT5LKq0XC&quot;&gt;watch them for free on YouTube&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I’m proud that Apache Camel was there, thanks to the hard work that all the team has been doing over the last two years, with the new Camel 3.x releases, Camel Quarkus and especially &lt;strong&gt;Camel K&lt;/strong&gt; that bring all those features to Kubernetes.&lt;/p&gt;

&lt;p&gt;The serverless space is an area where Camel K can make the difference. Camel K integration with Knative really rocks and we’re working every day on improving it.&lt;/p&gt;

&lt;p&gt;If you want to know what I’m talking about, why don’t you listen it from myself?&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/beJOCndVfaU&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;As you’ll learn from the video, many cool features are cooking in the pot. So, stay tuned!&lt;/p&gt;</content><author><name>Nicola Ferraro</name></author><category term="Talks" /><category term="Apache Camel" /><category term="Camel K" /><category term="Knative" /><category term="Openshift" /><category term="Kubernetes" /><category term="Serverless" /><category term="JBoss Fuse" /><summary type="html">I’ve presented Apache Camel at the last Kubecon EU conference that took place on August 19th, 2020.</summary></entry><entry><title type="html">Event-driven serverless applications with Camel K</title><link href="https://www.nicolaferraro.me/2020/07/09/event-driven-serverless-applications-with-camel-k/" rel="alternate" type="text/html" title="Event-driven serverless applications with Camel K" /><published>2020-07-09T00:00:00+02:00</published><updated>2020-07-09T09:00:00+02:00</updated><id>https://www.nicolaferraro.me/2020/07/09/event-driven-serverless-applications-with-camel-k</id><content type="html" xml:base="https://www.nicolaferraro.me/2020/07/09/event-driven-serverless-applications-with-camel-k/">&lt;p&gt;One of the talks I’ve most enjoyed doing in 2020. A DevNation Tech Talk explaining where do we see Camel K in the context of event-driven applications.&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/hlUzLC71nAM&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;</content><author><name>Nicola Ferraro</name></author><category term="Talks" /><category term="Apache Camel" /><category term="Camel K" /><category term="Knative" /><category term="Openshift" /><category term="Kubernetes" /><category term="Serverless" /><category term="JBoss Fuse" /><summary type="html">One of the talks I’ve most enjoyed doing in 2020. A DevNation Tech Talk explaining where do we see Camel K in the context of event-driven applications.</summary></entry><entry><title type="html">Camel K 1.0 is here</title><link href="https://www.nicolaferraro.me/2020/06/08/camel-k-is-here/" rel="alternate" type="text/html" title="Camel K 1.0 is here" /><published>2020-06-08T00:00:00+02:00</published><updated>2020-06-08T17:00:00+02:00</updated><id>https://www.nicolaferraro.me/2020/06/08/camel-k-is-here</id><content type="html" xml:base="https://www.nicolaferraro.me/2020/06/08/camel-k-is-here/">&lt;p&gt;Apache Camel K has made a lot of progress since its inception and we’re now proud to &lt;strong&gt;announce the 1.0 release&lt;/strong&gt;.
We’ve been working hard in the past months to add more awesome features to Camel K, but also to improve stability
and performance. This post contains a list of cool stuff that you’ll find in the 1.0 GA release.&lt;/p&gt;

&lt;p class=&quot;notice--info&quot;&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; this article has been first published on the &lt;a href=&quot;https://camel.apache.org/blog/2020/06/camel-k-release-1.0.0/&quot;&gt;Apache Camel’s Blog&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;First of all, if you’re living under a rock and it’s the first time you hear about Camel K, 
you can read some introductory blog posts here (&lt;a href=&quot;https://nicolaferraro.me/2018/10/15/introducing-camel-k/&quot;&gt;1 - introducing camel k&lt;/a&gt;, &lt;a href=&quot;https://www.nicolaferraro.me/2018/12/10/camel-k-on-knative/&quot;&gt;2 - camel k on knative&lt;/a&gt;)
or look at the Apache Camel website that contains a &lt;a href=&quot;/camel-k/latest/&quot;&gt;Camel K section&lt;/a&gt;
with a lot of material that is automatically generated from the &lt;a href=&quot;https://github.com/apache/camel-k&quot;&gt;Github repository&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;user-experience&quot;&gt;User experience&lt;/h2&gt;

&lt;p&gt;Camel K development style is minimalistic: you need just to write a single file with your integration routes and you can immediately 
run them on any Kubernetes cluster. This way of defining things is common to many FaaS platforms (although Camel K is not a proper FaaS platform, 
but a lightweight &lt;em&gt;integration&lt;/em&gt; platform) and it’s technically difficult to provide IDE support, such as code completion and other utilities, 
to developers.&lt;/p&gt;

&lt;p&gt;But now we’ve done it. The integration tooling team has created some cool extensions for VS Code that make the development experience
with Camel K even more exciting.
You don’t need to remember the Camel DSL syntax, the IDE will give you suggestions and error highlighting.&lt;/p&gt;

&lt;p style=&quot;text-align: center&quot;&gt;
    &lt;img src=&quot;/images/ide-autocompletion.gif&quot; alt=&quot;IDE Autocompletion&quot; /&gt;
    &lt;caption align=&quot;bottom&quot;&gt;&lt;i&gt;IDE Autocompletion&lt;/i&gt;&lt;/caption&gt;
&lt;/p&gt;

&lt;p&gt;Code completion works with Java code, but it’s not only limited to it: you also have suggestions and documentation out of the box when writing the Camel URIs and property files.
And you also have many options to run integrations and interact with them, all integrated in the IDE.&lt;/p&gt;

&lt;p&gt;Just install the VS Code &lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=redhat.apache-camel-extension-pack&quot;&gt;Extension Pack for Apache Camel&lt;/a&gt; to have all these features available.&lt;/p&gt;

&lt;h2 id=&quot;getting-started-tutorials&quot;&gt;Getting started tutorials&lt;/h2&gt;

&lt;p&gt;Good tools are fundamental to have a great development experience with Camel K, but then you need to learn what you can do with such a great power.
We’ve created a new repository in the Apache organization that hosts getting started examples: the &lt;a href=&quot;https://github.com/apache/camel-k-examples&quot;&gt;camel-k-examples&lt;/a&gt; repository.&lt;/p&gt;

&lt;p&gt;So far we’ve added guides that drive you through:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/apache/camel-k-examples/tree/master/01-basic&quot;&gt;01 Basic&lt;/a&gt;: Learn the basics of Camel K and some interesting use cases&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/apache/camel-k-examples/tree/master/02-serverless-api&quot;&gt;02 Serverless APIs&lt;/a&gt;: How to design a serverless (i.e. auto-scaling, scaling to zero) API and run it in a few minutes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;strong&gt;basic quickstart is &lt;a href=&quot;https://learn.openshift.com/middleware/courses/middleware-camelk/camel-k-basic&quot;&gt;also available online&lt;/a&gt;&lt;/strong&gt;, so you can have a look at how camel k works &lt;strong&gt;without installing anything on your laptop&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;More tutorials are expected to come in the following months. You are also welcome if you want to help us by &lt;strong&gt;contributing your own&lt;/strong&gt;.
They are based on the &lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=redhat.vscode-didact&quot;&gt;VSCode Didact&lt;/a&gt; project, that provides an
awesome user experience.&lt;/p&gt;

&lt;p&gt;If you are looking for Camel K code samples that you can just pick and run using the CLI, the &lt;a href=&quot;https://github.com/apache/camel-k/tree/master/examples&quot;&gt;examples directory&lt;/a&gt; of the Camel K main repository contains a lot of them. You can also run them directly from Github:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel run https://raw.githubusercontent.com/apache/camel-k/master/examples/Sample.java
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can find ready-to-use examples written in different languages (e.g. &lt;a href=&quot;https://github.com/apache/camel-k/blob/5fb589090c2f45b28aef586118df48fad8838b3f/examples/hello.xml&quot;&gt;XML&lt;/a&gt;, &lt;a href=&quot;https://github.com/apache/camel-k/blob/5fb589090c2f45b28aef586118df48fad8838b3f/examples/simple.js&quot;&gt;JavaScript&lt;/a&gt; and others).&lt;/p&gt;

&lt;h2 id=&quot;serverless&quot;&gt;Serverless&lt;/h2&gt;

&lt;p&gt;Serverless is the most important area where we’re focusing the new developments in Apache Camel K, although, you should remember, 
you can have a wonderful Camel K experience even without serverless features.
To enable the serverless profile in Camel K, you just need to have &lt;strong&gt;&lt;a href=&quot;https://knative.dev&quot;&gt;Knative&lt;/a&gt; installed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In recent releases, we have added support for the most recent advancements in Knative, for example, Camel K is very well integrated 
with the &lt;strong&gt;Knative event broker&lt;/strong&gt; and you can easily produce or consume events from it.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;2 lines of code&lt;/strong&gt; you can transfer events (e.g. generated by IoT devices) &lt;strong&gt;from your MQTT broker to the mesh&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;bridge.groovy&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-groovy highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'paho:mytopic?brokerUrl=tcp://broker-address:1883&amp;amp;clientId=knative-bridge'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'knative:event/device-event'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;No kidding, you just need to write those two lines of code in a file and run it with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel run bridge.groovy&lt;/code&gt; to 
push data into the Knative broker.&lt;/p&gt;

&lt;p&gt;And you can also scale the Integration out (&lt;em&gt;Integration&lt;/em&gt; is a Kubernetes custom resource, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl get integrations&lt;/code&gt; to see all of them)
to have a higher throughput. Scaling here is manual because the source of events is a MQTT broker (but we’ve plans to put &lt;a href=&quot;https://github.com/apache/camel-k/issues/1107&quot;&gt;auto-scaling also in this scenario&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The Camel K embedded auto-scaling feature works really well when you want to react to some Knative events:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;listener.groovy&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-groovy highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'knative:event/device-event'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'http://myhost/webhook/random-id'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This integration is configured to receive all events with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type=device-event&lt;/code&gt; and &lt;strong&gt;scales automatically with the load&lt;/strong&gt; because it is materialized into a &lt;a href=&quot;https://knative.dev/docs/serving/spec/knative-api-specification-1.0/#service&quot;&gt;Knative Serving Service&lt;/a&gt;
and automatically &lt;a href=&quot;https://knative.dev/docs/eventing/broker/&quot;&gt;subscribed to the Eventing Broker via a Trigger&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It then receives a &lt;a href=&quot;https://cloudevents.io/&quot;&gt;CloudEvent&lt;/a&gt; when your IoT devices produce something and scales down to zero if there’s no data coming.
You just need to create it (as before, just &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel run listener.groovy&lt;/code&gt;), all the remaining configuration is 
done &lt;strong&gt;automatically by the Camel K operator&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We’ve added much more features for having a better integration with the Knative ecosystem and we’ve also fixed some compatibility and performance issues that were present in previous versions. The user experience is now much smoother.&lt;/p&gt;

&lt;p&gt;If you are a Knative YAML developer (!), instead of using Camel K directly, you also have the option to use &lt;strong&gt;&lt;a href=&quot;https://knative.dev/docs/eventing/samples/apache-camel-source/&quot;&gt;Knative Camel Sources&lt;/a&gt;&lt;/strong&gt; which are part of the Knative release. They are wrappers for Camel K integrations that are compatible with all the tools used by Knative developers (such as the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kn&lt;/code&gt; CLI or the OpenShift serverless console).
Sources in Knative can only push data into the various Knative endpoints, but not the other way around (i.e. they cannot be used to publish data from Knative to the outside).
In Camel K you don’t have this limitation: the Route is the fundamental building block of a Camel integration and you can do whatever you want with it.&lt;/p&gt;

&lt;h2 id=&quot;fast-startup-and-low-memory&quot;&gt;Fast startup and low memory&lt;/h2&gt;

&lt;p&gt;We cannot say we’re serverless without mentioning the work that we’ve been doing in improving the performance of Camel K integrations.&lt;/p&gt;

&lt;p&gt;Starting from &lt;strong&gt;Camel 3.3.0&lt;/strong&gt; which is the default version used by Camel K 1.0.0, you can benefit from all improvements that have been made directly in the Camel core to make it much more lightweight. More in depth details of the Camel core improvements can be found the following blog series that highlights what has been changed in the 3.x Camel timeline to reduce memory footprint and speedup the startup time, which is foundamental when running integrations in a serverless environment: &lt;a href=&quot;http://www.davsclaus.com/2020/01/apache-camel-31-more-camel-core.html?m=1&quot;&gt;part 1&lt;/a&gt;, &lt;a href=&quot;http://www.davsclaus.com/2020/01/apache-camel-31-more-camel-core_30.html?m=1&quot;&gt;part 2&lt;/a&gt;, &lt;a href=&quot;http://www.davsclaus.com/2020/02/apache-camel-31-more-camel-core.html?m=1&quot;&gt;part 3&lt;/a&gt;, &lt;a href=&quot;http://www.davsclaus.com/2020/03/apache-camel-32-reflection-free.html?m=1&quot;&gt;part 4&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But improvements are not only limited to the Camel core: we’re doing much more. Several months ago we’ve started a new subproject of Apache Camel named &lt;a href=&quot;https://github.com/apache/camel-quarkus&quot;&gt;“Camel Quarkus”&lt;/a&gt; with the goal of seamlessly running integrations on top of the Quarkus framework. As you probably know, Quarkus is able to reduce the memory footprint of Java applications and improve the startup time, because it moves much startup logic to the build phase. And Quarkus applications can also be compiled to a native binary, allowing a dramatic improvements in startup performance and very low memory footprint.&lt;/p&gt;

&lt;p&gt;In Camel K 1.0.0 we support &lt;strong&gt;Camel Quarkus in JVM mode&lt;/strong&gt;. A goal is to have also the in-cluster native compilation soon (for some DSL languages, such as YAML), in one of next releases!&lt;/p&gt;

&lt;p&gt;To use Quarkus as underlying runtime, you just need to enable the &lt;strong&gt;&lt;a href=&quot;https://camel.apache.org/camel-k/latest/traits/quarkus.html&quot;&gt;Quarkus trait&lt;/a&gt;&lt;/strong&gt; when running an integration:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel run myintegration.groovy -t quarkus.enabled=true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Quarkus is expected to be the default underlying runtime in the next release, and support for Standalone mode (via camel-main) will be deprecated and removed.
This means that you won’t need to enable Quarkus manually in the next releases, but you still need to do it in 1.0.&lt;/p&gt;

&lt;h2 id=&quot;fast-build-time&quot;&gt;Fast build time&lt;/h2&gt;

&lt;p&gt;Every application running on Kubernetes needs to be packaged in a container image, but &lt;strong&gt;in Camel K you only provide the integration DSL and the operator does what it takes to run it&lt;/strong&gt;, including building images directly in the cluster.&lt;/p&gt;

&lt;p&gt;The operator manages a pool of reusable container images and if you redeploy your integration code, it does try to reuse existing images from the pool rather than building a new one at each change, because it takes some time to build a new one. &lt;strong&gt;It was 1 minute at the beginning…&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But Kubernetes is moving so fast that you cannot solve a problem once and forget about it, you need to take care of it continuously. It happened that some of our third party dependencies that we used for doing builds in “vanilla Kube” has slowly degraded in performance up to a point where Camel K user experience was highly affected.&lt;/p&gt;

&lt;p&gt;We decided to work harder on the build system in order to dramatically improve (again!) the build phase of Camel K integrations.&lt;/p&gt;

&lt;p&gt;Build time can be be now measured in seconds in dev environments such as Minikube. &lt;strong&gt;A bunch of seconds&lt;/strong&gt;, most of the times. This is more than a simple improvement!&lt;/p&gt;

&lt;h2 id=&quot;better-cli&quot;&gt;Better CLI&lt;/h2&gt;

&lt;p&gt;The ‘kamel’ CLI is the main tool we provide to developers to run integrations. It’s not a mandatory requirement: at the end, an Integration is a Kubernetes custom resources and you can manage it with any Kubernetes standard tool (e.g. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kubectl&lt;/code&gt;). But the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel&lt;/code&gt; CLI adds a lot of value for integration developers.&lt;/p&gt;

&lt;p&gt;For example, if you’re a Camel Java developer it’s not super easy to remember the boilerplate that you have to write in order to instantiate a Camel route builder. Now you don’t have to remember that:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel init Handler.java
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You get a Java file with &lt;strong&gt;all the boilerplate written for you&lt;/strong&gt; and you just have to write your integration routes.&lt;/p&gt;

&lt;p&gt;It works also with all other languages: Groovy, XML, YAML, Kotlin and JavaScript.
For example you can write:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel init foo.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This way you get a simple route written in JavaScript.&lt;/p&gt;

&lt;p&gt;It’s not just that. Often Camel K developers need to add a lot of command line options to configure the final behavior of their integration. For example, you may want to add a custom library with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-d&lt;/code&gt; option or configure a trait with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-t&lt;/code&gt;. E.g.:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel run -d mvn:org.my:lib:1.0.0 -d mvn:org.my:otherlib:2.0.0 -t quarkus.enabled=true Handler.java
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Sometimes the number of command line parameters you’ve to add &lt;strong&gt;can become too many&lt;/strong&gt;. For this reason we’ve added the possibility to specify them as &lt;strong&gt;modeline options&lt;/strong&gt; in the integration file (done by adding a comment line with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;camel-k:&lt;/code&gt; as prefix).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Handler.java&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// camel-k: dependency=mvn:org.my:lib:1.0.0 dependency=mvn:org.my:otherlib:2.0.0 trait=quarkus.enabled=true

// ...
// your routes here
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once the options are written in the file, you can run the routes with just:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// simply this, additional args are read from the file
kamel run Handler.java
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The other options are taken automatically from the file modeline. The CLI also displays the full command to let you know what’s running.&lt;/p&gt;

&lt;p&gt;This kind of configuration is extremely useful in CI/CD scenarios because it allows you to have self-contained integration files and you don’t need to change the pipeline to setup additional options. If you’re curious about the CI/CD configurations, you can follow the &lt;a href=&quot;https://camel.apache.org/camel-k/latest/tutorials/tekton/tekton.html&quot;&gt;tutorial about Tekton pipelines&lt;/a&gt; to have more information.&lt;/p&gt;

&lt;h2 id=&quot;monitoring-and-tracing&quot;&gt;Monitoring and Tracing&lt;/h2&gt;

&lt;p&gt;Ok, you’ve finished level 1 of Camel K development and you want to make serious things. You’re in a very good position because Camel K provides a lot of 
useful tools to add visibility on &lt;strong&gt;what your integration routes are doing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Let’s suppose you’ve a &lt;strong&gt;&lt;a href=&quot;https://prometheus.io/&quot;&gt;Prometheus&lt;/a&gt;&lt;/strong&gt; instance in your namespace and you want to &lt;strong&gt;publish your integration metrics&lt;/strong&gt;:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel run Routes.java -t prometheus.enabled=true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it. No need to setup services and labels to enable scraping. A default prometheus configuration file is also provided for the integration, with sensible defaults. Of course you also have the option to provide &lt;a href=&quot;https://camel.apache.org/camel-k/latest/traits/prometheus.html&quot;&gt;your own configuration&lt;/a&gt; for advanced use cases.&lt;/p&gt;

&lt;p&gt;Now, let’s suppose you want to see what your routes are doing and trace the execution flow of an integration. What you need to do is to install an opentracing compatible application in the namespace, such as &lt;strong&gt;&lt;a href=&quot;https://www.jaegertracing.io/&quot;&gt;Jaeger&lt;/a&gt;&lt;/strong&gt;, and run the integration as:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kamel run Routes.java -t prometheus.enabled=true -t tracing.enabled=true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;That’s it again. The Camel K operator will add the &lt;a href=&quot;https://camel.apache.org/components/latest/others/opentracing.html&quot;&gt;camel-opentracing library&lt;/a&gt; and &lt;strong&gt;connect it to the Jaeger collector that is available in the namespace&lt;/strong&gt;.
Here again, &lt;a href=&quot;https://camel.apache.org/camel-k/latest/traits/tracing.html&quot;&gt;advanced use cases&lt;/a&gt; are supported.&lt;/p&gt;

&lt;h2 id=&quot;master-routes&quot;&gt;Master routes&lt;/h2&gt;

&lt;p&gt;Good old Camel users know why and when master routes are useful, but for those who are not familiar with the term, I’m going to provide a brief explanation.&lt;/p&gt;

&lt;p&gt;Whenever you have an integration route that must be running, at any point in time, in at most one single Camel instance, you need to use a master route. Master routes can be declared by simply prefixing the consumer endpoint by the ‘master’ keyword and a name that will be used to create a named lock, e.g.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;from('master:mylock:telegram:bots')
  .to('log:info')
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It can be used to print all messages that are sent to your Telegram bot. Since the Telegram API support a single consumer only, you can guard the route with a master prefix to have the guarantee that there will be at most only one consumer at any given time.&lt;/p&gt;

&lt;p&gt;If you’re wondering how there can be two instances running of you deploy one, well, think just to when you change your code and need to do a rolling update: for some time there’ll be two pods running in parallel. In some cases, you may decide to scale your service out but keep only one instance of a particular route among all the pods of your service. Or you may want to embed a master route in a Knative autoscaling service: in this case, the service can scale autonomously based on the load, but there’ll be only one telegram consumer at any time.&lt;/p&gt;

&lt;p&gt;Master routes &lt;strong&gt;work out of the box&lt;/strong&gt; in Camel K, you just need to put a prefix in your endpoint uri. &lt;strong&gt;A leader election protocol&lt;/strong&gt; based on Kubernetes APIs resource locks will be &lt;strong&gt;automatically configured&lt;/strong&gt; for you!&lt;/p&gt;

&lt;h2 id=&quot;cronjobs&quot;&gt;CronJobs&lt;/h2&gt;

&lt;p&gt;All complex enough systems contain several scheduled jobs. This is especially true for that part of the system that handles integration with the outside.&lt;/p&gt;

&lt;p&gt;Ideally, if you need to execute a quick periodic task, say, every two seconds, you would startup an integration with a route based on timer to execute the periodic task. E.g.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;from(&quot;timer:task?period=2000&quot;)
  .to(this, &quot;businessLogic&quot;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But if the period between two executions, instead of 2 seconds (“2000” in the Camel URI, which is measured in milliseconds) is 2 minutes (“120000”) or 2 hours (“7200000”)?&lt;/p&gt;

&lt;p&gt;You can see that keeping a container with a JVM running for a task that should be executed once every two minutes may be overkill (it is overkill for sure when the period is 2 hours). We live in a time where resources such as &lt;strong&gt;memory and CPU are really valuable&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So the Camel K operator automatically handles this situation by deploying your integration not as a Kubernetes deployment, but as a &lt;strong&gt;Kubernetes CronJob&lt;/strong&gt;. This saves a lot of resources, especially when the period between executions is high. When it’s time to run your integration code, a container starts, triggers the execution and then gracefully terminates. Everything is handled automatically by Camel K and Kubernetes.&lt;/p&gt;

&lt;p&gt;There are cases when you don’t want this feature to be enabled, for example, when your code makes use of in memory caches that is better to keep between executions. In these cases, you can safely turn off the feature by passing the flag &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-t cron.enabled=false&lt;/code&gt; to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel run&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;The Cron feature does not only work with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;timer&lt;/code&gt; component. We’ve also added a &lt;a href=&quot;https://camel.apache.org/components/latest/cron-component.html&quot;&gt;cron component&lt;/a&gt; since Camel 3.1 that works really well in combination with the &lt;a href=&quot;https://camel.apache.org/camel-k/latest/traits/cron.html&quot;&gt;cron trait&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So you can also write the cron expression in the route directly:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;from(&quot;cron:job?schedule=0/5+*+*+*+?&quot;)
  .to(this, &quot;businessLogic&quot;)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In this case, a new pod with a JVM is started every 5 minutes to execute your scheduled task. For the remaining 4+ minutes you don’t use any resource.&lt;/p&gt;

&lt;h2 id=&quot;transparency&quot;&gt;Transparency&lt;/h2&gt;

&lt;p&gt;Camel K does a lot of work for you when you run your integration code in the cluster and it’s possible that you put some errors in the code that can block the deployment process. We’ve added a lot of visibility on the deployment process that now communicates with the users via Kubernetes events that are printed to the console when you use the CLI.&lt;/p&gt;

&lt;p&gt;This way you’re always notified of problems in the code and you can better understand what to fix to make your integration run.&lt;/p&gt;

&lt;h2 id=&quot;how-to-try-camel-k-10&quot;&gt;How to try Camel K 1.0&lt;/h2&gt;

&lt;p&gt;The first step is to go to the &lt;a href=&quot;https://github.com/apache/camel-k/releases&quot;&gt;Camel K release page&lt;/a&gt; on Github (or the official &lt;a href=&quot;https://dist.apache.org/repos/dist/release/camel/camel-k/1.0.0/&quot;&gt;Apache release repository&lt;/a&gt;), &lt;strong&gt;download the kamel CLI&lt;/strong&gt; for your OS and put it in your system path.&lt;/p&gt;

&lt;p&gt;Installation is done usually using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;kamel install&lt;/code&gt; command, but, depending on the kind of Kubernetes cluster you’re using, 
you may need to execute additional configuration steps.
The Camel K documentation contains a section about &lt;strong&gt;&lt;a href=&quot;https://camel.apache.org/camel-k/latest/installation/installation.html&quot;&gt;installing it on various types of Kubernetes clusters&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you have trouble or you need to install it on a particular cluster that is not listed, just reach out in the &lt;a href=&quot;https://gitter.im/apache/camel-k&quot;&gt;Gitter chat&lt;/a&gt; and
we’ll do our best to help you.&lt;/p&gt;

&lt;h2 id=&quot;future&quot;&gt;Future&lt;/h2&gt;

&lt;p&gt;We’ve reached version 1.0.0 and this is a great milestone for us. But we are not going to stop now: we’ve big plans for the future and we’ll continue to develop awesome new features.&lt;/p&gt;

&lt;p&gt;We need your help to improve Camel K and &lt;strong&gt;we love contributions!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Join us on:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Gitter: &lt;a href=&quot;https://gitter.im/apache/camel-k&quot;&gt;https://gitter.im/apache/camel-k&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;GitHub: &lt;a href=&quot;https://github.com/apache/camel-k&quot;&gt;https://github.com/apache/camel-k&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Nicola Ferraro</name></author><category term="Dev" /><category term="Apache Camel" /><category term="Camel K" /><category term="Knative" /><category term="Openshift" /><category term="Kubernetes" /><category term="Serverless" /><category term="JBoss Fuse" /><summary type="html">Apache Camel K has made a lot of progress since its inception and we’re now proud to announce the 1.0 release. We’ve been working hard in the past months to add more awesome features to Camel K, but also to improve stability and performance. This post contains a list of cool stuff that you’ll find in the 1.0 GA release.</summary></entry></feed>