Knative Trait

The Knative trait automatically discovers addresses of Knative resources and inject them into the running integration.

The full Knative configuration is injected in the CAMEL_KNATIVE_CONFIGURATION in JSON format. The Camel Knative component will then use the full configuration to configure the routes.

The trait is enabled by default when the Knative profile is active.

This trait is available in the following profiles: Knative.

Configuration

Trait properties can be specified when running any integration with the CLI:

$ kamel run --trait knative.[key]=[value] --trait knative.[key2]=[value2] integration.groovy

The following configuration options are available:

Property Type Description

knative.enabled

bool

Can be used to enable or disable a trait. All traits share this common property.

knative.configuration

string

Can be used to inject a Knative complete configuration in JSON format.

knative.channel-sources

[]string

List of channels used as source of integration routes. Can contain simple channel names or full Camel URIs.

knative.channel-sinks

[]string

List of channels used as destination of integration routes. Can contain simple channel names or full Camel URIs.

knative.endpoint-sources

[]string

List of channels used as source of integration routes.

knative.endpoint-sinks

[]string

List of endpoints used as destination of integration routes. Can contain simple endpoint names or full Camel URIs.

knative.event-sources

[]string

List of event types that the integration will be subscribed to. Can contain simple event types or full Camel URIs (to use a specific broker different from "default").

knative.event-sinks

[]string

List of event types that the integration will produce. Can contain simple event types or full Camel URIs (to use a specific broker).

knative.filter-source-channels

bool

Enables filtering on events based on the header "ce-knativehistory". Since this is an experimental header that can be removed in a future version of Knative, filtering is enabled only when the integration is listening from more than 1 channel.

knative.camel-source-compat

bool

Enables Knative CamelSource pre 0.15 compatibility fixes (will be removed in future versions).

knative.sink-binding

bool

Allows binding the integration to a sink via a Knative SinkBinding resource. This can be used when the integration targets a single sink. It’s enabled by default when the integration targets a single sink (except when the integration is owned by a Knative source).

knative.auto

bool

Enable automatic discovery of all trait properties.