Kaoto: Integrate without limits

I would like to present you with an ETL and integration editor Rachel and I have been working on for the past year with the initial help of Zineb: Kaoto.

What is Kaoto?

Kaoto is an integration editor to create and deploy integrations in a low-code way and no-code way based on Apache Camel. It combines a source code editor and a drag and drop graphical space synchronized with each other. It can be run both as standalone and as a service (SaaS).

With the no-code mode, the user can build the entire integration orchestration with the drag and drop function. Kaoto has a step catalog with a list of all available building blocks that the users may want to transform data or integrate with services.

The source code will be available for users curious to know what they are going to deploy. But in no case they have to understand or even see that code.

Example of building block drag and drop

With the low code mode, users can learn how to create integrations and, at the same time, control what they are deploying. They can use both the drag and drop and the source code editor, that will autocomplete what the user won’t or don’t know how to write. Meanwhile the graphical space will show the integration being built and the drag and drop will still be available for them to complete or accelerate the development.

Example of low code integrations.

Kaoto can help users start with Apache Camel and slowly build their knowledge. All the source code generated is clean and viewable in any IDE.

Customizing Kaoto

Each building block type can have its own microfrontend. This is useful when you add your own building blocks to your Kaoto instance. But it can also help adapt Kaoto to different kinds of users, hiding or extending certain details important for each use-case. Extensions can be manuals and helpers for Kaoto.

When used as a service, the extensions and the list of available building blocks are settings that can be stored in the cloud. Therefore, administrator users can modify this configuration, which will refresh live in the users playgrounds. In addition, as this configuration can be in the cloud, different users can share the configuration. This can help organizations accommodate different groups of users, offering different configurations depending on the profile.

What is on the roadmap?

We started the development focused on Kamelet Bindings, but we soon realized we could add more languages. Edition of Apache Camel routes (in yaml form) and Kamelet definitions are next in development queue. We are also working on translating from other integration languages to Camel DSL. This can help users migrate to Apache Camel.

We will soon have one-click support for cloud-native Apache Camel deployments via Camel-K. Matej is close to having an operator for Kubernetes clusters which will simplify even more the installation of Kaoto in the cloud.

You can quickly test it via docker as described on the quickstart. Make sure your docker images have access to internet to be able to access the default remote configuration!

You can find more information on the webpage of the project.

Are online events the new normal?

Some people have just (re-)discovered that we don’t have to meet in person to run an event. They are very enthusiastic about it. They are even asking to replace all conferences as online events. But, are they right?

Some of you may know I am going to co-chair the next FOSS4G. (Come Hell or High Water, but we are going to have a FOSS4G next year!) I have also participated on the organization of the last ApacheCON and some other minor online events. I have also spoken on many online events by now.

And, let me tell you, I am not as optimistic as those people. I really hope this post ages badly and in the following years we get better options for online events.

But as of today, I don’t feel we are anywhere close to replace face to face events with online ones. Delivering the talks as streaming is something good but we will be losing most of what makes a conference an amazing experience.

Let me tell you why.

Online Events Drawbacks

Online events allow people from all over the world to attend without having to travel. People with hard conciliation and people that can’t afford or are not able to travel will be on your event. It’s true, you will get attendees you wouldn’t have if it was a face to face event. And that’s good!

But that’s where the advantages of an online event end. And where a lot of new issues are created.

Read more: Are online events the new normal?

Timezones

Have you ever tried to find a good time slot for a simple one hour meeting between an Australian and someone living in Los Angeles? Exactly.

Now imagine allocating at least six good hours for streaming and interactions and trying to have at least everybody awake, no matter if it is early or late. Spoiler: you can’t.

Of course you can always find some arbitrary schedule that fits your biggest group of potential attendees and force the rest of your attendees adapt to it. Just make them imagine they are traveling and live on a different timezone, waking up at 3am to watch your talks, having lunch instead of breakfast and sleeping during the day. Seriously: is your event worth it?

Do you remember those people that couldn’t travel to your face to face event but can attend your online event? A good percentage of them will not attend your online event if it doesn’t fit their timezone. It doesn’t matter if they have the means to do it.

Hacking timezones

Of course, there are patches for this. Like having a 24/7 event so at all times there’s something happening for the people that are awake at that time. Which, in summary, just means having like separated events that overlap a bit between regions of the world. You will end up interacting mostly with people on your time zone region.

Some events are replaying their talks at different time zones so everyone has the opportunity to attend all sessions. But what’s the fun of watching some past talk, when even the speaker is no longer available for questions? I can watch it next month and it will be the same.

Bandwidth

I just mentioned those people that couldn’t travel to your face to face event but can attend your online event. If only that was as truthful as it sounds.

Not everyone has a good internet connection at home. We can even say not everyone has an internet connection at hand to watch and participate on your event. Thinking otherwise just shows your privilege and how you forget not everyone has access to a good and stable bandwidth. Specially at home.

For some people it is easier to travel to your face to face event than to get a good bandwidth to watch the streamed talks.

So this group of people that wouldn’t travel to your event but would attend your online event just keep shrinking. Your real potential attendees are those in the right time zone and the right technological requirements.

Shadow Audience on Online Events

This one is for speakers. There’s no way your talk will be the same if you can’t see, hear and feel the audience as in face to face. Online events, no matter if the audience has their cameras on, are isolating. It is never the same.

Not having feedback on how well your talk is being received (or even worse: seeing a lot of cameras of distracted attendees doing something else) is a huge handicap that even the most experienced speaker will suffer. Not knowing if you should speed up or slow down to adapt to your audience is weird. Not knowing if your audience is laughing at your jokes or thinking you are a weirdo.

And probably your speakers are not familiar with your platform, which means they will be extra nervous of messing up. If the mic fails on a room full of people, you notice immediately and you can even just talk louder while it gets fixed. If the mic fails on an online event, you may not even notice until several minutes have already passed.

All these issues lead to talks not as good as those made face to face.

Disengagement

Let’s be fair: attendees will not be physically disconnected from their daily routines as they are when traveling to your event. Most of them will keep going to work, passing time with their families and even skipping some talks to do house work. These changes of context means losing attention.

Your event is just the side dish of their day to day, an extra appendix. They will never be as engaged as if they had to travel to a venue and be there physically.

Language Barrier on Online Events

I know, I know what you are thinking. No, María, this problem is the same, no matter if you are face to face or online. Let me guess: you are an English native speaker.

Even when having reliable broadband and enjoying high quality smooth 60fps video, understanding a foreign speaker over video is harder than in person. Maybe because the audience is shadowed and the speaker has no feedback on how well it is being received. Or maybe it is just because we speak differently face to face than online. Maybe we are missing corporal language. But it happens.

This could be fixed with subtitles on most cases. But, what kind of subtitles? The ones that run on the fly and so frequently confuse technical terms making the subtitle confusing? Or the ones that are attached to a pre-recorded video so the speaker is not really there?

No random meetings

As you don’t have to move from one room to the next, sit next to someone on a room or even mingle during the coffee breaks, you just lose all those opportunities to meet both friends and strangers.

Your event will be missing a space where attendees can meet more or less randomly. Some events are matching random attendees on private rooms or have general room halls for random chatting. And that’s a good idea, but still, it doesn’t replace introducing yourself to someone specific you feel is a good match when you see that person talking to someone you know or having a break and being open to engage in conversation.

Do you want to have an Ice Breaker or a Gala Dinner? Maybe you can try Mozilla hub for that. Too over complicated? High hardware requirements? But what other social platforms could be there that go beyond a chat and are not a simple video conference? How can we mimic this walking over the venue and saying hi to old friends or asking someone about their shirt drawing?

Financial Side

Contrary to popular belief, if you really want to have an online event that can compete with a face to face event, the cost will not be cheap. The proper software stack with the proper bandwidth can be as costly as the venue. And whatever you may be saving on catering you will spend in making the event more social and engaging.

It’s true that a basic online event can be done very cheaply, as I demonstrate on the next section. But still, it will be a cheap event and will not patch many of the social drawbacks exposed.

If you want to make the conference online, you have to work towards more lines of economic viability than in traditional face to face events. Because there are many things you can’t offer now (being the merchandise placement the most obvious one).

Sponsorship of Online Events

Obviously you will try to keep sponsors on board. But it would be insane to think sponsors will be willing to pay the same prices as in traditional events if you don’t offer anything above and beyond.

If your conference has some kind of sponsorship booth area, you need some kind of replacement. How do you plan to do that? And how are you going to make attendees go through it? Now you don’t have halls where the booths are showing fancy stuff.

If you host some kind of Business to Business slot, are you just going to run it as a normal online video session? How are you going to help them interact?

Tickets

Most face to face events reconverted to online events are “in panic” offering free tickets, which will make it difficult for any online event to sell tickets at a reasonable price in the near future.

To make sure people would want to pay for your specific event, you must prepare some extras besides the streaming. You have to offer some kind of exclusive content to paid attendees besides the basic chats on the streamings to make sure the ticket price is worth it.

Maybe promote more panels where only paid users can participate and ask questions? Adding prizes or badges to users that participate more or attend more sessions?

Some events are offering open price donation tickets. Which means, you can have the ticket for the price you deem it worth. I have seen (from the inside) a number of events doing this. I won’t share actual numbers but trust me: don’t count with this money.

Goodies

Have you thought of an online shop to sell goodies branded as the conference? Difficult to estimate if this will work if you haven’t sell goodies before, but tech conference attendees are well known for collecting branded shirts. This is worth a try.

Dare Donations

This was an idea that popped out watching the Games Done Quick events. They keep people engaged and donating money through a whole week. They propose “dares” and people donate to vote what to do. You have to find something that make attendees engage and control somehow the type of content they are going to see.

For example: If between 9:00 and 10:00 we get a minimum amount in donations, then some speaker will run a live demo on their presentation instead of a video. Or vote with donations what question to ask on a panel. Maybe even choose between two different talks.

This works awesomely well on the GDC but the GDC is a fun event with no consequence and that’s not the tone with most tech conferences. I have no way to estimate if this will work on our case. It may work if you choose the right “dares” and speakers are willing to collaborate.

Probably easier on FOSS conferences, where the camaraderie is a common denominator. Weirder in other types of conferences, specially academic ones.

Software Stack of Online Events

There are many valid software stacks to use for your online events. Here is a summary of what I have experimented with and what I am comfortable with.

Let’s start with a basic stack that covers minimum functionality for a cheap price and then proceed to more wholesome solutions.

The Basic Stack

This is the basic stack I have found that covers the minimum needed to offer a proper online conference: talk streaming and access to a VIP chat. The price would be ridiculously cheap if you use one of the popular free streamings like Twitch or YouTube. And remember that you can organize a full online conference using only free and open source software.

OBS Studio

OBS Studio is an old friend of streamers. And also FOSS. No matter what streaming platform you are going to use (something free or some custom server), it works. You can have combined screens and cams and different audio sources to get a beautifully orchestrated output.

If you follow gamer streamers, you will probably be familiar with OBS already.

If OBS Studio is too complex to use for you, your moderators or even your speakers, you can always try StreamYard. It offers a similar functionality on a web browser friendly interface. It will allow you to easily stream to popular free platforms too. Personally I am very satisfied with this tool, even if it is not FOSS. It is really easy to use and the hardware and knowledge requirements are low.

Mattermost

To cover the social side, Mattermost is my preferred option. It is a Slack-like messaging platform where you can offer special channels to your attendees according to their ticket (free or paid). There, you can have access to all social interactions; like asking the speakers, meeting other attendees or discussing on common rooms.

Website

Although this stack covers all the minimal requirements for an online conference, it is messy and with decoupled parts. Your attendees may feel lost.

Attendees will have two windows or tabs in the browser: Mattermost and the streaming. The links to each streaming talk may be on some schedule in some webpage. It will be worth adding some developing time to create a website that contains everything on an usable format and gives some sense of being a single component.

Offline Talks for Online Events

If you are afraid your software stack may fail at the worst moment, you can ask your speakers to send their recorded presentations before the online event. You can even ask them for optional subtitles to overcome any language barrier.

Asking for recordings in advance gives you time to test if the video is right and schedule the release at the proper time and date. This reduces a lot the possibility of real time failures. Also, this way you make sure all videos have the proper duration, making the schedule more stable.

This gives the speakers also the opportunity to edit their videos on a fancy friendly way, adding special effects or anything that may be too risky to run on real time.

The speakers can also be asked to be at that proper time and date on the chat to interact with the attendees so the Q&A can run as usual.

But the event will probably look less dynamic, with all these pre-recorded talks. No cross-referencing talks you just watched, no possible change mid talk because someone made a good point.

Promising Software Stacks

If you don’t want to use the free streaming options and/or you are looking for a more holistic solution, there are some platforms and software stacks you can check. Take into account that these options require you to have the proper bandwidth, which means, they are going to be more expensive than the previously described minimum viable plan.

So the first thing you have to ask yourself before jumping into any of these platforms is: is it worth the risk of using our own/rented streaming servers instead of something like YouTube or Twitch?

The most attractive (to me) alternatives right now are the following.

BigBlueButton

BBB is a FOSS Conferencing System for online learning. Not designed as a conference software, it provides the users with class-like rooms and a chat per room. As a tool for teachers I felt it was very complete. As a tool for an online event, I felt things missing. It felt like many disconnected talks, not like a full schedule.

Venueless

From the creators of Pretix and Pretalx, Venueless aspires to be the FOSS option for conferences. It is built on top of Big Blue Button, offering a wrapper that should make the experience more “conference-like”. I have to confess I haven’t tried it yet, but seeing how Pretix and Pretalx work, I’m confident this is going to be a big one. If you are considering using BBB, you should take a look at this one. If only because it provides features on top of it.

Both options have the huge advantage of being FOSS, which means, if you don’t like or need something in particular, you can dedicate your own developers into contributing for it. Even if you use a third party hosting, with proper care your contributions will make it to the main release so any third party hosting will offer them for you.

Yet Another Browser Mud

Based on traditional text-based online game spaces such as MUDs and MOOs, this FOSS platform for online events could be at least a nice secondary interface for your event.

Hopin

Hopin.to was used on ApacheCON. It is not FOSS, which means you are completely dependent on what the company behind it wants to implement. For me, that’s a big red flag, specially on online events, which is something the software stacks are not yet mature enough. You cannot be confident yet that a restricted licensed software will be mature enough to provide you with everything you need.

On the social side, Hopin offered fancy features like matching you with random attendees, mimicking what a coffee break would be, or offering specific booth rooms so you can talk with sponsors.

Truth is, I am usually very social on face to face events and talk with random people and visit the booths. But nothing was calling me to use these features on the online version of this conference. It’s not as if you see someone you want to talk to in the coffee break so you just approach them. It looks forced to me. The risk of matching a complete stranger with nothing in common and having an uncomfortable conversation was high.

Online Events Experiences

I’m sure all of you have some experiences with online events by now. Let me share some insights I have experienced and why I still think online events can’t replace face to face ones.

EsLibre experience

The EsLibre used Big Blue Button as the main conference platform, with RocketChat as the sidechat and MozillaHub for the Gala Dinner and social “after beers”. The experience was pretty good… except everything was disconnected, as we were using three different components completely decoupled.

And still, not the same as a face to face.

ApacheCON experience

ApacheCON used Hopin. It was in general a good experience, well organized, and we had more attendees than ever. But that may be misleading: most of the almost six thousand registered attendees logged in at some point in the event, but you rarely saw more than a thousand connected at the same time.

We used the “three timezone region” approach, which in the end led us to have like three different groups of attendees that didn’t mingle among each other.

Conclusion

Online Events can’t match Social Face to Face Events

At least, not for me, not with the technology and the social capabilities we have right now.

I really really hope this post ages badly. Because there’s a lot of people that can’t travel to on site events and they are missing all the awesomeness of a full event experience.

And, truth be told, having everyone traveling several times per year to different conferences is not ecological, not sustainable in the long term.

Maybe with experiments like the one from the Roguelike Celebration or the attempt at Google, we will be able to get closer to what we need.

What’s all this integration agitation, anyway?

Imagine you are in charge of creating a whole new complex architecture to solve a new need of your company. You are already an experienced engineer and have solved many of the requirements with some components you are already familiar with. But now, you have to orchestrate all these components together and make them work like a clock. Now we need a proper integration.

You may have heard any or all of these keywords before: middleware, integration, orchestration. And you may be wondering why and when to use them. Take a walk with me to understand when and how integration frameworks are useful.

Imagine you are in charge of solving a new need of your company. There is no complete software stack for what you need. You will have to involve your team to create something new. Even if you reuse some components, you have to make them interact and talk to each other.

You are an experienced software engineer and have solved previously many of the requirements with some components you are already familiar with. But now you have to orchestrate all these components together and make them work like a clock. Now you need a proper integration. You want all of them to cooperate smoothly in your architecture.

The first thing any good developer thinks about is building a custom software that acts as the glue between all these components. Maybe adding some fancy extra functionality. And, (why not?) as we are at the beginning of a new exciting project, probably we want to try all these new technologies you have been reading and hearing about. Whatever the fad buzzword is now, you are willing to try it.

Although this may be appealing, your inner experienced engineer tells you to stop. There’s something you also read about, these integration frameworks. Could they be useful here?

The Integration Paradigm

As much as we would like to start a new clean project from scratch and throw all our ingeniousness into it, we shouldn’t reinvent the wheel. Let’s take a look at what is this middleware or integration software.

Read more: What’s all this integration agitation, anyway?

Middleware, or integration software, can help us orchestrate and automate the interaction between different applications, APIs, third party services or any other software piece we may have to connect.

A proper integration tool should provide us with the following features: transformation, integration patterns and connectors to existing protocols and components.

Transformations

When we connect different components of an architecture, they rarely speak the same languages or, on this case, data formats. Some components will output an xml that has to be fed to the following component on a json form. Maybe we even need to add or remove some attributes on that json data.

We need some way to easily transform the data traveling from one component to the following so it fits properly.

If we want to do this with our own script, there are many libraries that can help us doing this like Jackson or the built-in xml libraries on Python . We even have the XSLT language to transform XML. But to use any of these properly, we would have to learn first how to use them. And any code we generate will have to be maintained and upgraded properly.

An integration framework allows us to define what is the mapping between the output of one component and the input of the following so we can forget about the explicit implementation. The less code we have to maintain, the better.

Enterprise Integration Patterns

Not all workflows in the architecture will be lineal. Some of the steps will require broadcasting, some of them will require conditional flowing. Some will require waiting the output of different components to conflate the data. These action patterns are something that have been studied for a long time. And as with software development patterns, you can classify them and study them to create better integrations.

You can find all of these patterns prettily explained in the classic Enterprise Integration Patterns book.

Connectors

All of the above is useless if we can’t connect to (and from) the specific component we need.

Our ideal integration framework should offer support for common protocols like ftp, http, jdbc,… Also it should offer support to connect to common components like a mail server, messaging services, atom,… We could claim even that no integration tool would be good if it doesn’t also support specific well known services like being able to send a message through a Telegram bot or store information on Elastic Search.

Integration Frameworks as Lego building blocks

Being able to seamlessly connect from one component to the next without having to worry about the specifics of their interfaces is what distinguishes an average integration tool from a good integration tool.

Apache Camel

Let’s talk about something less abstract. At this point you may be wondering where you can find a good integration framework.

Apache Camel is not only one of the most active projects inside the Apache Software Foundation, it is also the lightest and most complete integration framework available. And on top of it, it is also Free and Open Source Software!

Camel is already an old actor on the integration world. It has support for hundreds of components, protocols and formats. Some of these protocols come very handy allowing the user, for example, to connect to any REST API that they need.

Camel uses its own DSL, a simplified language to define easily the workflows step by step.

Camel-K

Camel is also available in Knative. This means, we can use it on a serverless environment, making sure the orchestration between services runs and escalates properly.

Camel K Orchestration Example

This example demonstrates how to orchestrate integrations using Camel-K and Kafka as a messaging service. We are going to implement two integrations that interact through a database to simulate how cat adoptions work.

The full example can be found on Github.

Flux diagram
Two integration workflows that simulate how cat adoptions work

One integration will store cats coming from Kafka to the database waiting for a person to adopt them. The second integration will receive people interested in adopting and will match cats with them.

Cat Input from Kafka to Database

First we are going to implement the storage of cat input messages to the database.

As you can see, the Camel DSL is very intuitive: this integration listens to the proper Kafka broker and for every message that arrives, it unmarshalls the json to extract the data and pushes it to the database. The Cat class is just a simple bean with getters and setters for the attributes.

// camel-k: language=java

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.dataformat.JsonLibrary;
import model.Cat;

public class CatInput extends RouteBuilder {
  @Override
  public void configure() throws Exception {

    //Listen to kafka cat broker
    from("kafka:cat?brokers=my-cluster-kafka-bootstrap:9092")
    .log("Message received from Kafka : ${body}")
    .unmarshal().json(JsonLibrary.Gson, Cat.class)
  
    //Store it on the database with a null person
    .setBody().simple("INSERT INTO cat (name, image) VALUES ('${body.name}', '${body.image}')")
    .to("jdbc:postgresBean?")
  
    //Write some log to know it finishes properly
    .log("Cat stored.");}
  }
}

Person Input from Kafka to Adopt

Now we are going to implement the reception of people wanting to adopt a cat.

This integration is a bit more complex, as we are going to introduce a conditional choice: if there is a cat available on the database, it will be assigned to the person. If there is no cat (otherwise), a message will be returned saying no cat is available.

// camel-k: language=java

import org.apache.camel.builder.RouteBuilder;

public class PersonInput extends RouteBuilder {
  @Override
  public void configure() throws Exception {
    //Listen to kafka person broker
    from("kafka:person?brokers=my-cluster-kafka-bootstrap:9092")
    .log("Message received from Kafka : ${body}")
    .log("${body} wants to adopt a cat")
    
    //Store the name of the person
    .setProperty("person", simple("${body}"))
    
    //Search for a lonely cat
    .log("...looking for available cats...")
    .setBody().simple("SELECT id, name, image FROM cat WHERE person is NULL LIMIT 1;")
    .to("jdbc:postgresBean?")
    
    .choice()
      .when(header("CamelJdbcRowCount").isGreaterThanOrEqualTo(1))
        .setProperty("catname", simple("${body[0][name]}"))
        .setProperty("catimage", simple("${body[0][image]}"))
        .setProperty("catid", simple("${body[0][id]}"))
        .log("Cat found called ${exchangeProperty.catname} with ID ${exchangeProperty.catid}")
        //There's a cat available, adopt it!
        .setBody().simple("UPDATE cat SET person='${exchangeProperty.person}' WHERE id=${exchangeProperty.catid}")
        .to("jdbc:postgresBean?")
  
        //Write some log to know it finishes properly
        .setBody().simple("Congratulations! ${exchangeProperty.catname} adopted ${exchangeProperty.person}. See how happy is on ${exchangeProperty.catimage}.")
        .to("log:info")
      .otherwise()
        //Write some log to know it finishes properly
        .setBody().simple("We are sorry, there's no cat looking for a family at this moment.")
        .to("log:info")
    .end();
  }
}

Feeding data automatically

As an extra step on this exercise, we are going to implement a final job that sends random new cat data to the Kafka “cat” topic with a timer.

The complexity on this class is not the Camel side, but the random generator of cat names.

// camel-k: language=java dependency=camel:gson

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.dataformat.JsonLibrary;

public class AutoCat extends RouteBuilder {
  @Override
  public void configure() throws Exception {

    // Preparing properties to build a GeoJSON Feature
    Processor processor = new Processor() {

      String[] title = new String[] { "", "Lady", "Princess", "Mighty", "Your Highness", "Little", "Purry", "Empress", "Doctor", "Professor" };
      String[] firstname = new String[] { "Dewey", "Butter", "Merlin", "Epiphany", "Blasfemy", "Metaphor", "Fuzzy",
          "Whity", "Astro", "Salty", "Smol", "Whiskers", "Scully" };
      String[] lastname = new String[] { "", "Luna", "Wild", "Dragonis", "Firefly", "Puff", "Purrcy", "Priss",
          "Catsie" };

      Random r = new Random();

      @Override
      public void process(Exchange exchange) throws Exception {
        Map<String, String> map = new HashMap<String, String>();
        map.put("image", exchange.getProperty("catimage").toString());

        StringBuilder name = new StringBuilder();
        name.append(title[r.nextInt(title.length)]);
        name.append(" ");
        name.append(firstname[r.nextInt(firstname.length)]);
        name.append(" ");
        name.append(lastname[r.nextInt(lastname.length)]);

        exchange.setProperty("catname", name.toString());
        map.put("name", name.toString().trim());

        exchange.getMessage().setBody(map);

      }

    };

    // Listen to kafka cat broker
    from("timer:java?period=10s")
      
      // Take a random image
      .to("https://api.thecatapi.com/v1/images/search")
      .unmarshal().json(JsonLibrary.Gson)
      .log("A new cat arrived today ${body[0][url]}")
      .setProperty("catimage", simple("${body[0][url]}"))

      // name cat and prepare json
      .process(processor)
      .log("${body}")
      .marshal().json(JsonLibrary.Gson)
      .log("We named them ${exchangeProperty.catname}")

      // Send it to Kafka cat broker
      .to("kafka:cat?brokers=my-cluster-kafka-bootstrap:9092")

      // Write some log to know it finishes properly
      .log("Cat is looking for a family.");

  }
}

Now you are ready to implement your own orchestrations with Kafka and Camel K.

en_GBEnglish (UK)