Giter VIP home page Giter VIP logo

camel-k-runtime's Introduction

Apache Camel K Runtime

Maven Central Licensed under Apache License version 2.0 Chat on Zulip Build Status

This repository contains the Apache Camel-K Runtime bits used by the Camel K project_. This is a lightweight dependency used on top of Camel Quarkus, required by Camel K operator to set all the runtime configuration on Kubernetes.

How to bump the main dependencies

In order to simplify the maintenance, you can use a script in /script/ directory which take care of bumping the versions for the project, aligning it with Camel Quarkus version: ./scripts/bump.sh --camel-quarkus 2.16.0. When starting a new major or minor release, you’ll also need to align the dependencies expected by Camel Quarkus running ./scripts/sync_cq.sh --skip-version-check.

The project has an automatic action (./scripts/sync_cq.sh) running every night by Github Actions which is in charge to align the set of dependencies required by Camel Quarkus, according to the release. This is useful to keep up to date each patch release.

Instructions for local debugging

You can follow these instructions in order to run and debug a Camel K integration based on a local Camel K runtime.

camel-k-runtime's People

Contributors

apupier avatar astefanutti avatar christophd avatar claudio4j avatar cunningt avatar davsclaus avatar dependabot[bot] avatar dhirajsb avatar djencks avatar essobedo avatar gansheer avatar github-actions[bot] avatar heiko-braun avatar hguerrero avatar ipolyzos avatar ityreh avatar jamesnetherton avatar lburgazzoli avatar nicolaferraro avatar orpiske avatar oscerd avatar pixelneo avatar poojachandak avatar squakez avatar tadayosi avatar tplevko avatar valdar avatar willemjiang avatar zhfeng avatar zregvart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

camel-k-runtime's Issues

Support Knative broker/trigger model

We can add a third endpoint to knative called events.

A user can write:

from('knative:events/chuck.norris')

To get all events of type chuck.norris.
The behavior will be:

  • The operator creates a trigger on event type chuck.norris
  • The component filters messages containing header Ce-Type equals to chuck.norris
  • The component exposes the usual endpoint to receive cloud events

Some additional properties are required:

  • brokerApiVersion: to change the api version of the broker (interpreted by the operator)
  • brokerName: to change the name of the broker to use (by default there's only one called default)
  • brokerKind cannot be changed as there's a single CRD at the moment

Additional filters can be put in the endpoint, e.g.:

from('knative:events/chuck.norris?ceAuthorName=Nicola')

ceAuthorName like filters can be dynamic and translate into an additional filter on both the trigger and the component on the header Ce-Author-Name.

remove support for camel 2.x

when camel 3 gets stable enough we should drop support for camel 2.x as maintaining support for both the version is becoming more and more complex as source of errors.

Knative component filters out all headers

Consider the following integration sending data to a channel:

from('timer:clock?period=3s')
	.setBody().constant("Hello World from Camel K")
	.setHeader('CamelCippaLippa').constant('42')
	.to('log:info?showHeaders=true')
	.to('knative:channel/messages')
	.to('log:info?showHeaders=true')
	.log('sent message to messages channel')

This is the output log:

2019-07-26 10:57:00.318 �[32mINFO �[m [Camel (camel-k) thread #2 - timer://clock] info - Exchange[ExchangePattern: InOnly, Headers: {CamelCippaLippa=42, firedTime=Fri Jul 26 10:57:00 UTC 2019}, BodyType: String, Body: Hello World from Camel K]
2019-07-26 10:57:00.323 �[32mINFO �[m [Camel Thread #3 - NettyClientTCPWorker] info - Exchange[ExchangePattern: InOnly, Headers: {CamelHttpResponseCode=202, CamelHttpResponseText=Accepted, Content-Length=0, Date=Fri, 26 Jul 2019 10:57:00 GMT}, BodyType: byte[], Body: ]
2019-07-26 10:57:00.323 �[32mINFO �[m [Camel Thread #3 - NettyClientTCPWorker] route1 - sent message to messages channel

The CamelCippaLippa header is deleted after passing from the knative endpoint.

Refactor customizer activation

Customizers are activated by the property

camel.k.customizer

And then configured with properties using the following patter:

customizer.${id}.${property}

Wondering if we should drop camel.k.customizer and use customizer.${id}.enabled to activate/deactivate customizers.

@valdar what do you think ?

switch to camel main for quarkus related bits

Lambda processor doesn't work with JS routes

Copied from apache/camel-k#873

With Camel K Client 1.0.0-M1-SNAPSHOT, examples/routes.js doesn't work as follows:

$ kamel run --dev examples/routes.js
[...]
[1] 2019-07-25 02:36:45.686 WARN  [Camel (camel-k) thread #2 - timer://js] TimerConsumer - Error processing exchange. Exchange[ID-routes-5ccdc6b89-jl2c9-1564022203707-0-5]. Caused by: [java.lang.ClassCastException - java.lang.Object cannot be cast to com.oracle.truffle.polyglot.PolyglotLanguageContext]
[1] java.lang.ClassCastException: java.lang.Object cannot be cast to com.oracle.truffle.polyglot.PolyglotLanguageContext
[1] 	at com.oracle.truffle.polyglot.PolyglotLanguage$ContextProfile.profile(PolyglotLanguage.java:383) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.oracle.truffle.polyglot.HostToGuestRootNode.profileContext(HostToGuestRootNode.java:113) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:72) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:102) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.oracle.truffle.polyglot.FunctionProxyHandler.invoke(HostInteropReflect.java:454) ~[org.graalvm.truffle.truffle-api-19.0.2.jar:?]
[1] 	at com.sun.proxy.$Proxy28.process(Unknown Source) ~[?:?]
[1] 	at org.apache.camel.support.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63) ~[org.apache.camel.camel-support-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryState.run(RedeliveryErrorHandler.java:480) ~[org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:185) [org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59) [org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:87) [org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:222) [org.apache.camel.camel-base-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:193) [org.apache.camel.camel-timer-3.0.0-M4.jar:3.0.0-M4]
[1] 	at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:75) [org.apache.camel.camel-timer-3.0.0-M4.jar:3.0.0-M4]
[1] 	at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_191]
[1] 	at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_191]
[1] Caused by: com.oracle.truffle.api.TruffleStackTrace$LazyStackTrace

The error comes from this part. Removing .process(proc) makes the route work.

function proc(e) {
    e.getIn().setHeader('RandomValue', Math.floor((Math.random() * 100) + 1))
}
[...]
    .process(proc)

See also: apache/camel-k#589

HTTP multi-headers are randomized in camel-knative-http

This line

behave in a random way when the header contains multiple values.

In case of the header ce-knativehistory, values may be like: channel1.ns.channels.cluster.local; channel2.ns.channels.cluster.local. They are interpreted by netty as being present multiple times (which is correct) and only one of them is returned by that call (which is correct), but a random one (which is wrong).
We should find a way to get always the last value of the header, which is the last channel that received the message.

I've tried also to get the full list of values using getAll but the order of elements in the list is still randomized.

I've found there's a CombinedHttpHeader class in netty that may solve the issue by appending values to the same header instead of adding multiple entries, but I'm not able to plug it in Camel Netty.

Any idea @lburgazzoli ?

Release 0.3.1

There are some bugfixes and improvements in the Knative area that deserve a new release:

  • Fix knative service call (#20)
  • Use cloudevents 0.2 (#25)
  • Support for health checks (#22, #24)
  • Fix catalog (#26)

Add the error log when setting component property failed

It looks like the groovy component property setting DSL doesn't throw any exception from the runtime when the property name is wrong.
But when setting the value with method in component with wrong name, the thrown exception is not related to component property setting issue.
So my suggestion is adding error log for it, to help the user to find out the real reason.

Modularize loaders

We now ave the camel-runtime-jvm that provides route loaders for js, xml and java: in order to have a better support for quarkus (#57) we should further modularize the loaders

Release 0.3.0

We need to release version 0.3.0

  • support for camel 3.x

Release 0.3.2

We should start a new minor release in order to have the following fixes:

  • add catalog information to runtime artifacts
  • fix stream handler
  • fix netty http binding for knative
  • support stream caching configuration
  • honour cutomizer list property/env
  • add a default type to cloudevents
  • deprecation of spring-boot runtime apache/camel-k#534

In particular, without the fixes to the knative component, Knative CamelSources are not usable.

Support explicit source/target in knative endpoint

Currently Camel K 1.0.0-M2 has a pre-baked list of allowed endpoints that can be used as start or end of a route.

E.g.

from('knative:channel/xx`)

The Knative trait looks for:

  • eventing.knative.dev/v1alpha1 -> Channel
  • messaging.knative.dev/v1alpha1 -> Channel
  • messaging.knative.dev/v1alpha1 -> InMemoryChannel
  • messaging.knative.dev/v1alpha1 -> KafkaChannel
  • ...

A similar thing happen for the knative/endpoint.

It would be better if a user can explicitly set the target, like:

from('knative:channel/xx?kind=InMemoryChannel')

or even:

from('knative:channel/xx?kind=InMemoryChannel&apiVersion=messaging.knative.dev/v1')

Same also for endpoint. In the case of channel, the operator creates also a subscription.

The resolution of the apiVersion and kind will happen at operator level, but those properties need to be accepted by the runtime.

Wdyt @lburgazzoli ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.