KaotoIO / kaoto-backend

Backend for the Kaoto project to provide an easy to use integration framework based on Apache Camel.
Apache License 2.0
75 stars 32 forks source link
apache-camel automation-framework hacktoberfest integration-flow java kubernetes workflow-automation

Kaoto Backend

This is the backend companion of the Kaoto project.

GitHub release (latest by date including pre-releases) GitHub

Docker Pulls Docker generation

GitHub contributors GitHub commit activity GitHub code size in bytes codecov

Quality Gate Status Reliability Rating Maintainability Rating Security Rating

Twitter Follow YouTube Channel Subscribers

Using Kaoto

This is the API companion for the Kaoto frontend. It is designed as an hexagonal architecture, decoupled and modularized to be able to easily add your own DSL, and with maintainability in mind.

This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

Running as a docker container

There is a nightly dockerized container for the Kaoto backend. You can run it with the following command:

docker run --rm -d -p 8081:8081 kaotoio/backend

If you want to use it with Kaoto-ui, don't forget to set CORS origins via QUARKUS_HTTP_CORS_ORIGINS env, e.g.:

docker run --rm -d -p 8081:8081 -e QUARKUS_HTTP_CORS_ORIGINS='http://localhost:1337' kaotoio/backend

Using OpenTelemetry tracing

Kaoto-backend provides OpenTelemetry tracing. By default, OpenTelemetry SDK Autoconfigure is disabled. It can be enabled by quarkus.otel.sdk.disabled=false

NOTE: When OpenTelemetry is enabled, by default, the OTLP Exporter (e.g. Jaeger) is expected on http://localhost:4317/ endpoint. That endpoint can be overridden via quarkus.otel.exporter.otlp.traces.endpointconfiguration property.

For more information and all configuration properties, see Quarkus OpenTelemetry guide.

CORS

CORS filter is enabled by default. For proper functionality with the Kaoto-ui, it is necessary to set quarkus.http.cors.origins configuration property with Kaoto-ui URL(s). For more information and all configuration properties, see Quarkus HTTP Reference

NOTE: When you run Kaoto-backend in the dev mode, all origins are accepted. (origins: /.*/)

Steps catalog resources

Actual versions of resources:

Updating step resources

The repository contains steps repositories zip files which are bundled with Kaoto-backend during building. For upgrading those resources, run update-resources.sh script.

Developing Kaoto

Developer documentation is on https://kaotoio.github.io/kaoto-backend/

The API static swagger documentation is on https://kaotoio.github.io/kaoto-backend/api/index.html

Requirements

You have to install in your machine

Building

First you need to build and install the different maven modules.

mvn install

Running the dev mode

Then you can run your application in dev mode that enables live coding using:

mvn quarkus:dev -pl api

Your app is now deployed on localhost:8081 and you can check the swagger API on http://localhost:8081/q/swagger-ui/.

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8081/q/dev/.

NOTE2: During dev mode, the Dev Services for Kubernetes are enabled and require running Docker on your environment. If you don't have Docker, you can disable this functionality by -Dquarkus.kubernetes-client.devservices.enabled=false

Packaging and Running

Kaoto can be packaged using:

mvn install

It produces the quarkus-run.jar file in the api/target/quarkus-app/ directory. Be aware that it’s not an über-jar as the dependencies are copied into the api/target/quarkus-app/lib/ directory.

If you want to build an über-jar, execute the following command:

mvn install -Dquarkus.package.type=uber-jar

Kaoto backend is now runnable using java -jar api/target/quarkus-app/quarkus-run.jar.

Creating a native executable

You can create a native executable using:

mvn install -Pnative

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:

mvn install -Pnative -Dquarkus.native.container-build=true

You can then execute your native executable with: .api/target/code-with-quarkus-1.0.0-SNAPSHOT-runner

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html .

Building the Documentation

Documentation is generated using LeafDoc.

npm install
npm run docs