This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new e0fc8694046 CAMEL-21695 Remove remaining traces of camel-k and camel-jbang-plugin-k (#17017) e0fc8694046 is described below commit e0fc8694046b6a7da4e9b3b333df99e0b7112849 Author: Claudio Miranda <clau...@claudius.com.br> AuthorDate: Mon Feb 3 03:16:39 2025 -0300 CAMEL-21695 Remove remaining traces of camel-k and camel-jbang-plugin-k (#17017) --- bom/camel-bom/pom.xml | 5 - .../camel/xml/io/util/XmlStreamDetector.java | 1 + .../apache/camel/xml/io/util/XmlStreamInfo.java | 1 + docs/user-manual/modules/ROOT/nav.adoc | 1 - .../modules/ROOT/pages/camel-jbang-k.adoc | 653 --------------------- .../modules/ROOT/pages/camel-jbang.adoc | 44 +- .../ROOT/pages/camelcontext-autoconfigure.adoc | 2 +- .../faq/pages/how-do-i-edit-the-website.adoc | 2 +- .../src/main/docs/java-joor-dsl.adoc | 11 +- .../dsl/jbang/core/commands/ExportBaseCommand.java | 4 - .../apache/camel/dsl/jbang/core/commands/Init.java | 10 +- .../apache/camel/dsl/jbang/core/commands/Run.java | 10 +- .../camel/dsl/jbang/core/commands/bind/Bind.java | 2 +- ...meletBindingProvider.java => PipeProvider.java} | 4 +- .../camel/dsl/jbang/core/common/GitHubHelper.java | 1 - .../src/main/docs/java-xml-io-dsl.adoc | 13 +- .../src/main/docs/java-xml-jaxb-dsl.adoc | 2 +- .../dsl/yaml/deserializers/BeansDeserializer.java | 2 +- .../IntegrationConfigurationPropertiesSource.java | 101 ---- .../camel/dsl/yaml/IntegrationSourceResource.java | 47 -- .../camel/dsl/yaml/YamlRoutesBuilderLoader.java | 406 +------------ .../camel/dsl/yaml/ChoiceCamelKExtTest.groovy | 111 ---- .../yaml/IntegrationLoaderDependenciesTest.groovy | 82 --- .../camel/dsl/yaml/IntegrationLoaderTest.groovy | 206 ------- .../KameletBindingLoaderIntegrationSpecTest.groovy | 84 --- .../camel/dsl/yaml/KameletBindingLoaderTest.groovy | 71 --- .../dsl/yaml/KameletIntegrationLoaderTest.groovy | 63 -- .../dsl/yaml/PipeLoaderIntegrationSpecTest.groovy | 84 --- .../apache/camel/dsl/yaml/PipeLoaderTest.groovy | 76 +-- .../camel/dsl/yaml/support/YamlTestSupport.groovy | 10 - parent/pom.xml | 6 - .../org/apache/camel/tooling/maven/MavenGav.java | 4 +- .../camel/maven/packaging/PrepareCatalogMojo.java | 2 +- 33 files changed, 85 insertions(+), 2036 deletions(-) diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml index 51d41c5314f..8a29a993844 100644 --- a/bom/camel-bom/pom.xml +++ b/bom/camel-bom/pom.xml @@ -1112,11 +1112,6 @@ <artifactId>camel-jbang-plugin-generate</artifactId> <version>4.10.0-SNAPSHOT</version> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jbang-plugin-k</artifactId> - <version>4.10.0-SNAPSHOT</version> - </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jbang-plugin-kubernetes</artifactId> diff --git a/core/camel-xml-io-util/src/main/java/org/apache/camel/xml/io/util/XmlStreamDetector.java b/core/camel-xml-io-util/src/main/java/org/apache/camel/xml/io/util/XmlStreamDetector.java index 55830692ec1..379802a6703 100644 --- a/core/camel-xml-io-util/src/main/java/org/apache/camel/xml/io/util/XmlStreamDetector.java +++ b/core/camel-xml-io-util/src/main/java/org/apache/camel/xml/io/util/XmlStreamDetector.java @@ -101,6 +101,7 @@ public class XmlStreamDetector { String comment = reader.getText(); if (comment != null) { comment.lines().map(String::trim).forEach(l -> { + // TODO: remove modeline support after 4.10 if (l.startsWith("camel-k:")) { information.modelines.add(l); } diff --git a/core/camel-xml-io-util/src/main/java/org/apache/camel/xml/io/util/XmlStreamInfo.java b/core/camel-xml-io-util/src/main/java/org/apache/camel/xml/io/util/XmlStreamInfo.java index dc6814fdd44..2e0390e25d3 100644 --- a/core/camel-xml-io-util/src/main/java/org/apache/camel/xml/io/util/XmlStreamInfo.java +++ b/core/camel-xml-io-util/src/main/java/org/apache/camel/xml/io/util/XmlStreamInfo.java @@ -48,6 +48,7 @@ public class XmlStreamInfo { /** * Trimmed and unparsed lines starting with Camel-recognized modeline markers (now: {@code camel-k:}). */ + // TODO: remove modeline support after 4.10 final List<String> modelines = new ArrayList<>(); public boolean isValid() { diff --git a/docs/user-manual/modules/ROOT/nav.adoc b/docs/user-manual/modules/ROOT/nav.adoc index 3bfbce66340..36e91a65785 100644 --- a/docs/user-manual/modules/ROOT/nav.adoc +++ b/docs/user-manual/modules/ROOT/nav.adoc @@ -7,7 +7,6 @@ ** xref:camel-console.adoc[Camel Developer Console] ** xref:camel-jbang.adoc[Camel JBang] *** xref:camel-jbang-kubernetes.adoc[Camel Kubernetes plugin] -*** xref:camel-jbang-k.adoc[Camel K plugin] ** xref:camel-maven-plugin.adoc[Camel Maven Plugin] ** xref:camel-component-maven-plugin.adoc[Camel Component Maven Plugin] ** xref:camel-report-maven-plugin.adoc[Camel Maven Report Plugin] diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-k.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang-k.adoc deleted file mode 100644 index a0939d03e29..00000000000 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang-k.adoc +++ /dev/null @@ -1,653 +0,0 @@ -= Camel K plugin (deprecated) - -IMPORTANT: This plugin is deprecated, and removed in Camel 4.10 onwards. - -Please make sure to meet these prerequisites for running Camel integrations on Kubernetes: - -* Connect to namespace on a Kubernetes cluster where you want to run the integration -* Camel K operator must be installed on the Kubernetes cluster (either installed on the same namespace or as global operator for the whole cluster) - -To set up a local Kubernetes cluster, you have several options. -Camel K JBang is able to interact with all of these Kubernetes platforms. - -* Kind -* Minikube - -Of course, you may also connect to a remote Kubernetes cluster. - -Running Camel routes on Kubernetes is quite simple with Camel JBang. -In fact, you can develop and test your Camel route locally with Camel JBang and then promote the same source to running it as an integration on Kubernetes. - -The Camel K JBang functionality is provided as a command plugin. -This means you need to enable the `camel-k` plugin first to use the subcommands in Camel JBang. - -[source,bash] ----- -camel plugin add camel-k ----- - -You should see the `camel-k` plugin listed as an installed plugin. - -[source,bash] ----- -camel plugin get ----- - -[source,bash] ----- - NAME COMMAND DEPENDENCY DESCRIPTION - camel-k k org.apache.camel:camel-jbang-plugin-k Manage Camel integrations on Kubernetes ----- - -Now Camel JBang is able to run the subcommands offered by the plugin. - -== Run integrations - -Simply run the integration using the `k` subcommand in Camel JBang. - -[source,bash] ----- -camel k run route.yaml ----- - -The command runs the Camel integration on Kubernetes. -More precisely, it creates a Camel K Integration custom resource in the current namespace. -The Camel K operator makes sure to create a proper runtime image and run the integration (usually as a Pod). - -The Camel K operator will automatically manage and configure this integration. -In particular, the operator takes care on exposing services, configuring health endpoints, providing metrics, updating image streams and much more. - -By default, the run command will not wait for the integration to in state running. -You need to add `-w` or `--wait` option in order to wait for the integration to become ready. - -The `--logs` option makes the command also print the integration output once the integration Pod is running. - -The run command offers a lot more options that you may use to configure the Camel K integration. - -[width="100%",cols="1m,3",options="header",] -|======================================================================= -|Option |Description - -|--name -|The integration name. Use this when the name should not get derived from the source file name. - -|--image -|An image built externally (for instance via CI/CD). Enabling it will skip the integration build phase. - -|--kit -|The kit used to run the integration. - -|--trait-profile -|The trait profile to use for the deployment. - -|--service-account -|The service account used to run this Integration. - -|--pod-template -|The path of the YAML file containing a PodSpec template to be used for the integration pods. - -|--operator-id -|Operator id selected to manage this integration. (default=camel-k) - -|--dependency -|Adds dependency that should be included, use "camel:" prefix for a Camel component, "mvn:org.my:app:1.0" for a Maven dependency. - -|--property -|Add a runtime property or properties file from a path, a config map or a secret (syntax: `[my-key=my-value,file:/path/to/my-conf.properties,[configmap,secret]:name]`). - -|--build-property -|Add a build time property or properties file from a path, a config map or a secret (syntax: `[my-key=my-value,file:/path/to/my-conf.properties,[configmap,secret]:name]]`). - -|--config -|Add a runtime configuration from a ConfigMap or a Secret (syntax: `[configmap,secret]:name[/key]`, where name represents the configmap/secret name and key optionally represents the configmap/secret key to be filtered). - -|--resource -|Add a runtime resource from a Configmap or a Secret (syntax: `[configmap,secret]:name[/key][@path]`, where name represents the configmap/secret name, key optionally represents the configmap/secret key to be filtered and the path represents the destination path). - -|--open-api -|Add an OpenAPI spec (syntax: `[configmap,file]:name`). - -|--env -|Set an environment variable in the integration container, for instance `"-e MY_VAR=my-value"`. - -|--volume -|Mount a volume into the integration container, for instance `"-v pvcname:/container/path"`. - -|--connect -|A Service that the integration should bind to, specified as `[[apigroup/]version:]kind:[namespace/]name`. - -|--source -|Add a source file to your integration, this is added to the list of files listed as arguments of the command. - -|--maven-repository -|Add a maven repository used to resolve dependencies. - -|--annotation -|Add an annotation to the integration. Use name values pairs like `"--annotation my.company=hello"`. - -|--label -|Add a label to the integration. Use name values pairs like `"--label my.company=hello"`. - -|--trait -|Add a trait configuration to the integration. Use name values pairs like `"--trait trait.name.config=hello"`. - -|--use-flows -|Write YAML sources as Flow objects in the integration custom resource (default=true). - -|--compression -|Enable storage of sources and resources as a compressed binary blobs. - -|--wait -|Wait for the integration to become ready. - -|--logs -|Print logs after integration has been started. - -|--output -|Just output the generated integration custom resource (supports: YAML or JSON or k8s). -|======================================================================= - -== List integrations - -You can list the available integration resources with the following command. - -[source,bash] ----- -camel k get -NAME PHASE KIT READY -my-route Running kit-123456789 1/1 ----- - -This looks for all integrations in the current namespace and lists their individual status. - -== Show integration logs - -To inspect the log output of a running integration call: - -[source,bash] ----- -camel k logs my-route ----- - -The command connects to the running integration Pod and prints the log output. -Just terminate the process to stop printing the logs. - -== Delete integrations - -Of course, you may also delete an integration resource from the cluster. - -[source,bash] ----- -camel k delete my-route ----- - -To remove all available integrations on the current namespace use the `--all` option. - -[source,bash] ----- -camel k delete --all ----- - -== Create integration pipes - -In some contexts (for example, **"serverless"**), users often want to leverage the power of Apache Camel to be able to connect to various sources/sinks, with focus on connectivity to 3rd party technologies and services and less focus on doing complex processing (such as transformations or other enterprise integration patterns). - -Pipe resources represent a special form of Camel integrations where a source gets bound to a sink. -The operation to create such a Pipe resource is often related to as the process of binding a source to a sink. - -You can use the Camel JBang subcommand `bind` to create Pipe resources. -The result of this Pipe resource being created on a Kubernetes cluster is a running Camel integration. - -The Camel K bind command supports the following options: - -[width="100%",cols="1m,3",options="header",] -|======================================================================= -|Option |Description - -|--operator-id -|Operator id selected to manage this integration. (default=camel-k) - -|--source -|Source (from) such as a Kamelet or Camel endpoint uri that provides data. - -|--sink -|Sink (to) such as a Kamelet or Camel endpoint uri where data should be sent to. - -|--step -|Add optional 1-n steps to the pipe processing. Each step represents a reference to a Kamelet of type action. - -|--property -|Add a pipe property in the form of `[source,sink,error-handler,step-<n>].<key>=<value>` where `<n>` is the step number starting from 1. - -|--error-handler -|Add error handler (none,log,sink:<endpoint>). Sink endpoints are expected in the format `[[apigroup/]version:]kind:[namespace/]name`, plain Camel URIs or Kamelet name. - -|--annotation -|Add an annotation to the integration. Use name values pairs like `"--annotation my.company=hello"`. - -|--connect -|A Service that the integration should bind to, specified as `[[apigroup/]version:]kind:[namespace/]name`. - -|--trait -|Add a trait configuration to the integration. Use name values pairs like `"--trait trait.name.config=hello"`. - -|--wait -|Wait for the integration to become ready. - -|--logs -|Print logs after integration has been started. - -|--output -|Just output the generated pipe custom resource (supports: file, YAML or JSON). -|======================================================================= - -Sources and sinks in a pipe may be Camel endpoint URIs, a Kamelet or a references to a Kubernetes resource (e.g. Knative brokers, Kafka topics). - -=== Binding Kamelets - -In a typical use case, a Pipe connects Kamelets of type source and sink. -Usually a Kamelet gets identified by its name (e.g. timer-source, log-sink). - -[source,bash] ----- -camel k bind my-pipe --source timer-source --sink log-sink --property source.message="Camel rocks!" --property sink.showHeaders=true ----- - -The bind command receives the name of the pipe as a command argument and uses several options to specify the source and the sink. -In addition to that, the user is able to specify properties on the individual source and sink (e.g., the message property on the timer-source Kamelet). - -The result of this command is a Pipe custom resource that you can apply to a Kubernetes cluster. - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe - annotations: - camel.apache.org/operator.id: camel-k -spec: - source: # <1> - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: timer-source - properties: - message: "Camel rocks!" - sink: # <2> - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: log-sink - properties: - showHeaders: true ----- -<1> Reference to the source that provides data -<2> Reference to the sink where data should be sent to - -Each Pipe resource uses an operator id annotation to specify which operator on the cluster should handle the resource. - -NOTE: The bind command is able to inspect the properties defined in the Kamelet specification in order to set default values. In case the Kamelet defines a required property that is not explicitly set by the user the bind command automatically creates a property placeholder with an example value. - -=== Add binding steps - -You can specify 1-n additional steps that get executed between the source and sink. - -[source,bash] ----- -camel k bind my-pipe --source timer-source --sink log-sink --step set-body-action --property step-1.value="Camel rocks!" ----- - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe -spec: - source: -# ... - steps: - - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: set-body-action - properties: - value: "Camel rocks!" - sink: -# ... ----- - -NOTE: Each step should reverence a Kamelet of type `action`. -The properties for a step can be set with the respective `step-<n>` prefix where `n` is the step number beginning with 1. - -=== Binding Camel endpoint URIs - -Instead of referencing a Kamelet or Kubernetes resource you can also configure the source/sink to be an explicit Camel URI. -For example, the following bind command is allowed: - -[source,bash] ----- -camel k bind my-pipe --source timer:tick --sink https://mycompany.com/the-service --property source.period=5000 ----- - -This will use the Camel endpoint URIs `timer:tick` and `log:info` as source and sink in the Pipe. -The properties are set as endpoint parameters. - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe -spec: - source: - uri: timer:tick # <1> - properties: - period: 5000 - sink: - uri: https://mycompany.com/the-service # <2> ----- -<1> Pipe with explicit Camel endpoint URI as source -<2> Pipe with explicit Camel endpoint URI as sink where the data gets pushed to - -This Pipe explicitly defines Camel endpoint URIs that act as a source and sink. - -NOTE: You can also specify endpoint parameters directly on the source/sink like `--source timer:tick?period=5000` - -=== Binding to Knative broker - -You can reference Knative eventing resources as source or sink in a Pipe resource. -The reference to the Knative resource is identified by the apiVersion, kind and resource name. Users may add properties to the object reference as usual. - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe - annotations: - camel.apache.org/operator.id: camel-k -spec: - source: # <1> - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: timer-source - properties: - message: "Camel rocks!" - sink: # <2> - ref: - kind: Broker - apiVersion: eventing.knative.dev/v1 - name: default - properties: - type: org.apache.camel.event.my-event # <3> ----- -<1> Reference to the source that provides data -<2> Reference to the Knative broker where data should be sent to -<3> The CloudEvents event type that is used for the events - -NOTE: Knative eventing uses CloudEvents data format by default. Camel provides the concept of data types that is able to transform from many different component data formats to CloudEvents data type. The data type transformation will set proper event properties such as ce-type, ce-source or ce-subject. - -When referencing a Knative broker as a source the `type` property is mandatory in order to filter the event stream. - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe - annotations: - camel.apache.org/operator.id: camel-k -spec: - source: # <1> - ref: - kind: Broker - apiVersion: eventing.knative.dev/v1 - name: default - properties: - type: org.apache.camel.event.my-event # <2> - sink: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: log-sink ----- -<1> Reference to the source Knative broker that provides the events -<2> Filter the event stream for events with the given CloudEvents event type - -=== Binding to Knative channels - -Knative eventing provides the channel resource for a subscription consumer model. -Camel K is able to automatically manage the subscription when referencing Knative eventing channels as a source or sink in a Pipe. - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe - annotations: - camel.apache.org/operator.id: camel-k -spec: - source: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: timer-source - properties: - message: "Camel rocks!" - sink: # <1> - ref: - kind: InMemoryChannel - apiVersion: messaging.knative.dev/v1 - name: my-messages ----- -<1> Reference to the Knative message channel that receives the events - -The same approach can be used to subscribe to a message chanel as a consumer to act as a source in a Pipe. - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe - annotations: - camel.apache.org/operator.id: camel-k -spec: - source: # <1> - ref: - kind: InMemoryChannel - apiVersion: messaging.knative.dev/v1 - name: my-messages - sink: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: log-sink ----- -<1> Reference to the source Knative message channel that provides the events - -=== Binding to Kafka topics - -Kafka topic resources may act as a source or sink in a Pipe. -Strimzi provides KafkaTopic resources that you can reference in your Pipe. - -The reference to the Strimzi resource is identified by the apiVersion, kind and resource name. Users may add properties to the object reference such as the brokers bootstrap URI. - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe - annotations: - camel.apache.org/operator.id: camel-k -spec: - source: # <1> - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: timer-source - properties: - message: "Camel rocks!" - sink: # <2> - ref: - kind: KafkaTopic - apiVersion: kafka.strimzi.io/v1beta2 - name: my-topic - properties: - brokers: "my-cluster-kafka-bootstrap:9092" # <3> ----- -<1> Reference to the source that provides data -<2> Reference to the Strimzi Kafka topic where data should be sent to -<3> The Kafka brokers bootstrap URI - -NOTE: Camel K is able to auto resolve the Kafka broker bootstrap URI by resolving the Strimzi Kafka resources in the same namespace. The operator may perform a lookup of the bootstrap URI and inject this as a property to the Camel component at runtime. - -You can set the `brokers` property to explicitly point to the Strimzi Kafka broker. - -=== Error handling - -You can configure an error handler in order to specify what to do when some event ends up with failure. -Pipes offer a mechanism to specify an error policy to adopt in case an event processing fails. - -In case of an exception thrown during the pipe processing, the respective error handler will perform its actions. - -The Pipe knows different types of error handlers `none`, `log` and `sink`: - -* none -> Explicit `noErrorHandler` is set and the error is ignored. -* log -> Errors get logged to the output. -* sink -> Errors get pushed to a specified endpoint in the form of dead letter queue. - -The error handler may be configured with special properties that allow you to define the error handling behavior such as redelivery or delay policy. - -==== No error handler - -There may be certain cases where you want to just ignore any failure happening in your integration. -In this situation use a `none` error handler. - -[source,bash] ----- -camel k bind my-pipe --source timer-source --sink log-sink --error-handler none ----- - -This results in following error handler configuration on the pipe: - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe -spec: - source: -# ... - sink: -# ... - errorHandler: - none: {} ----- - -==== Log error handler - -Apache Camel offers a default behavior for handling failure: log to standard output. -However, you can use the `log` error handler to specify other behaviors such as redelivery or delay policy. - -[source,bash] ----- -camel k bind my-pipe --source timer-source --sink log-sink --error-handler log --property error-handler.maximumRedeliveries=3 --property error-handler.redeliveryDelay=2000 ----- - -This results in the error handler configuration on the Pipe: - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe -spec: - source: -# ... - sink: -# ... - errorHandler: - log: - parameters: # <1> - redeliveryDelay: 2000 - maximumRedeliveries: 3 ----- -<1> Parameters belonging to the `log` error handler type - -==== Sink error handler - -The `sink` error handler is probably the most interesting error handler type as it allows you to redirect failing events to other components, such as a third party URI, a queue or topic or even another `Kamelet` which will be performing certain logic with the failing event. - -The sink error handler expects a proper endpoint URI, which may be a reference to another Kamelet, a fully qualified custom resource reference or an arbitrary Camel endpoint URI. - -[source,bash] ----- -camel k bind my-pipe --source timer-source --sink log-sink --error-handler sink:my-error-handler --property error-handler.sink.message=ERROR! --property error-handler.maximumRedeliveries=1 ----- - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe -spec: - source: -# ... - sink: -# ... - errorHandler: - sink: - endpoint: - ref: # <1> - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: my-error-handler - properties: - message: "ERROR!" # <2> - # ... - parameters: - maximumRedeliveries: 1 # <3> - # ... ----- -<1> You can use `ref` or `uri`. `ref` will be interpreted by the operator according the `kind`, `apiVersion` and `name`. You can use any `Kamelet`, `KafkaTopic` channel or `Knative` destination. -<2> Properties targeting the sink endpoint (in this example, a property on the `Kamelet` named `my-error-handler`). Properties targeting the sink endpoint need to use the `error-handler.sink.*` prefix. -<3> Parameters for the error handler (such as redelivery or delay policy). Error handler parameters need to use the `error-handler.*` prefix. - -NOTE: The error handler properties are divided into properties that target the error handler sink endpoint and properties that should be set on the Camel error handler component, (e.g., maximumRedeliveries). You need to specify the respective property prefix (`error-handler.` or `error-handler.sink.`) to decide where the property should be set. - -As an alternative to referencing a Kamelet as an error handler sink, you may also use an arbitrary Camel endpoint URI. - -[source,bash] ----- -camel k bind my-pipe --source timer-source --sink log-sink --error-handler sink:log:error --property error-handler.sink.showHeaders=true ----- - -It creates the error handler specification as follows: - -[source,yaml] ----- -apiVersion: camel.apache.org/v1 -kind: Pipe -metadata: - name: my-pipe -spec: - source: -# ... - sink: -# ... - errorHandler: - sink: - endpoint: - uri: log:error - properties: - showHeaders: true ----- diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc index f7880d19193..1c81b8c0371 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-jbang.adoc @@ -478,7 +478,7 @@ curl -T bar.java http://0.0.0.0:8080/q/upload/bar.java To send the data via PUT, then the file body can be included when using `Content-Type: application/x-www-form-urlencoded`: -For example, from a CURL `--ascii-trace`: +For example, from a CURL `--trace-ascii log.txt`: [source,text] ---- @@ -762,7 +762,7 @@ camel run foo.java --maven-settings=false You can run a route hosted on GitHub using Camels xref:components:others:resourceresolver-github.adoc[GitHub] resource loader. -For example, to run one of the Camel K examples, you can do: +For example, to run one of the Camel Kamelets examples, you can do: [source,bash] ---- @@ -841,11 +841,11 @@ You can also run in dev mode, to hot-deploy on source code changes. camel run * --dev ---- -You can also download a single file, such as one of the Camel K examples: +You can also download a single file, such as one of the Camel Kamelets examples: [source,bash] ---- -camel init https://github.com/apache/camel-k-examples/blob/main/generic-examples/languages/simple.groovy +camel init https://github.com/apache/camel-kamelets-examples/blob/main/jbang/hello-yaml/hello.camel.yaml ---- This is a groovy route, which you can run with (or use `*`): @@ -1050,7 +1050,6 @@ Supported plugins: NAME COMMAND DEPENDENCY DESCRIPTION kubernetes kubernetes org.apache.camel:camel-jbang-plugin-kubernetes Run Camel applications on Kubernetes - camel-k k org.apache.camel:camel-jbang-plugin-k Managed Camel integrations on Kubernetes generate generate org.apache.camel:camel-jbang-plugin-generate Generate code such as DTOs ---- @@ -1084,9 +1083,9 @@ To remove a plugin from the current Camel JBang command line tooling, you can us camel plugin delete <plugin-name> ---- -=== Running Camel K integrations or pipes +=== Running Pipes -Camel also supports running Camel K integrations and pipes, which represent Kubernetes custom resources following a specific CRD format (Kubernetes Custom Resource Definitions). +Camel also supports running pipes, which represent Kubernetes custom resources following a specific CRD format (Kubernetes Custom Resource Definitions). For example, a pipe file named `joke.yaml`: @@ -1212,11 +1211,6 @@ spec: ---- <1> Pipe with explicit Camel endpoint URI as sink where the data gets pushed to -==== Advanced binding options - -The Camel K JBang plugin also provides the bind command. It enhances the arbitrary bind command with the option to directly create this resource on the -Kubernetes cluster. Please refer to the plugin documentation for more complex examples and a full description on how to use the bind command options. - === Creating a new Kamelet You can create a new kamelet with the `init` command by using kamelet naming convention. @@ -1883,12 +1877,6 @@ The plugin uses the project export functionality to build and deploy the applica Read about it in the xref:camel-jbang-kubernetes.adoc[Camel Kubernetes plugin] documentation. -In addition to that, you can also leverage the Camel K plugin commands that interact with the Camel K operator on Kubernetes. -Camel K gets you started with the journey of running Camel integrations on Kubernetes in a declarative way. -The container image build, push to registry as well as the ownership of deployments is all taken care of by the Camel K operator. - -Read about it in xref:camel-jbang-k.adoc[Camel K plugin]. - ==== Configuring logging levels You can see the current logging levels of the running Camel integrations by: @@ -3778,7 +3766,7 @@ The follow options related to _exporting_, can be configured in `application.pro |Additional files to add to classpath (Use commas to separate multiple files). See more details at xref:_adding_custom_jars[]. |`camel.jbang.jkubeFiles` -|Resource fragments for Kubernetes (Use commas to separate multiple files). +|Resource fragments for Kubernetes (Use commas to separate multiple files). |`camel.jbang.javaVersion` |Java version (17 or 21). Java 17 is default. @@ -3990,15 +3978,15 @@ Following is the output for the above-mentioned configuration. [source,bash] ---- -ALIAS IMPLEMENTATION - ignite - azure storage-queue - openldap - event-bridge - xmpp - kinesis - redis - ... +ALIAS IMPLEMENTATION + ignite + azure storage-queue + openldap + event-bridge + xmpp + kinesis + redis + ... ---- === Run Service diff --git a/docs/user-manual/modules/ROOT/pages/camelcontext-autoconfigure.adoc b/docs/user-manual/modules/ROOT/pages/camelcontext-autoconfigure.adoc index f74835369c1..cf416861355 100644 --- a/docs/user-manual/modules/ROOT/pages/camelcontext-autoconfigure.adoc +++ b/docs/user-manual/modules/ROOT/pages/camelcontext-autoconfigure.adoc @@ -1,7 +1,7 @@ = CamelContext Auto Configuration The xref:camelcontext.adoc[CamelContext] is autoconfigured when running Camel with either -xref:components:others:main.adoc[Camel Main], Camel Spring Boot, Camel Quarkus, or Camel K. +xref:components:others:main.adoc[Camel Main], Camel Spring Boot, Camel Quarkus. == Camel Autoconfiguration diff --git a/docs/user-manual/modules/faq/pages/how-do-i-edit-the-website.adoc b/docs/user-manual/modules/faq/pages/how-do-i-edit-the-website.adoc index fabf539e1ef..70f65845248 100644 --- a/docs/user-manual/modules/faq/pages/how-do-i-edit-the-website.adoc +++ b/docs/user-manual/modules/faq/pages/how-do-i-edit-the-website.adoc @@ -28,7 +28,7 @@ For such documentation, you will need to locate the original source and propose == In local repositories To edit files locally, it's important to understand how the website is generated and where the files are located. The configuration for the Antora and Hugo site generators is located in its https://github.com/apache/camel-website[own repository]. -The documentation is located in the main https://github.com/apache/camel[Apache Camel] repository and sub-project repositories, such as https://github.com/apache/camel-k[Camel-K] and https://github.com/apache/camel-quarkus[Camel Quarkus]. +The documentation is located in the main https://github.com/apache/camel[Apache Camel] repository and sub-project repositories, such as https://github.com/apache/camel-spring-boot[Camel Spring Boot] and https://github.com/apache/camel-quarkus[Camel Quarkus]. See xref:ROOT:improving-the-documentation.adoc[] for instructions on how to work on the documentation. diff --git a/dsl/camel-java-joor-dsl/src/main/docs/java-joor-dsl.adoc b/dsl/camel-java-joor-dsl/src/main/docs/java-joor-dsl.adoc index 1534f7fe1ea..f7b40278a84 100644 --- a/dsl/camel-java-joor-dsl/src/main/docs/java-joor-dsl.adoc +++ b/dsl/camel-java-joor-dsl/src/main/docs/java-joor-dsl.adoc @@ -32,20 +32,13 @@ public class MyRoute extends RouteBuilder { public void configure() throws Exception { from("timer:tick") .setBody() - .constant("Hello Camel K!") + .constant("Hello Camel!") .to("log:info"); } } ---- -Can then be loaded and run with Camel CLI or Camel K. - -.Running with Camel K - -[source,bash] ----- -kamel run MyRoute.java ----- +Can then be loaded and run with Camel CLI. .Running with Camel CLI diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java index 1d7e642e904..d717938904e 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java @@ -1008,10 +1008,6 @@ public abstract class ExportBaseCommand extends CamelCommand { return "camel:" + dependency.substring("camel-quarkus:".length()); } - if (dependency.startsWith("camel-k-")) { - return "camel-k:" + dependency.substring("camel-k-".length()); - } - if (dependency.startsWith("camel-")) { return "camel:" + dependency.substring("camel-".length()); } diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Init.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Init.java index 4ee54fdfdb8..ca007792cd7 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Init.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Init.java @@ -71,12 +71,8 @@ public class Init extends CamelCommand { "--kamelets-version" }, description = "Apache Camel Kamelets version") private String kameletsVersion; - @Option(names = { "--integration" }, - description = "When creating a yaml file should it be created as a Camel K Integration CRD") - private boolean integration; - @Option(names = { "--pipe" }, - description = "When creating a yaml file should it be created as a Camel K Pipe CRD") + description = "When creating a yaml file should it be created as a Pipe CR") private boolean pipe; public Init(CamelJBangMain main) { @@ -104,9 +100,7 @@ public class Init extends CamelCommand { } String ext = FileUtil.onlyExt(file, false); - if ("yaml".equals(ext) && integration) { - ext = "integration.yaml"; - } else if ("yaml".equals(ext) && pipe) { + if ("yaml".equals(ext) && pipe) { ext = "init-pipe.yaml"; } diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java index 02c50e5d227..11f365ccb77 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java @@ -290,7 +290,8 @@ public class Run extends CamelCommand { description = "Metrics (Micrometer and Prometheus) at /q/metrics on local HTTP server (port 8080 by default)") boolean metrics; - @Option(names = { "--modeline" }, defaultValue = "true", description = "Enables Camel-K style modeline") + @Option(names = { "--modeline" }, defaultValue = "true", + description = "Deprecated, to be removed: Enables Camel-K style modeline") boolean modeline = true; @Option(names = { "--open-api" }, description = "Adds an OpenAPI spec from the given file (json or yaml file)") @@ -567,6 +568,7 @@ public class Run extends CamelCommand { writeSetting(main, profileProperties, "camel.main.tracing", "true"); } if (modeline) { + printer().println("WARN: modeline parameter is deprecated, to be removed in the next version."); writeSetting(main, profileProperties, "camel.main.modeline", "true"); } if (ignoreLoadingError) { @@ -1680,10 +1682,8 @@ public class Run extends CamelCommand { || source.content().contains("- route-configuration:") || source.content().contains("- rest:") || source.content().contains("- beans:") - // also support Camel K integrations and Pipes. And KameletBinding for backward compatibility - || source.content().contains("KameletBinding") - || source.content().contains("Pipe") - || source.content().contains("kind: Integration"); + // also support Pipes. + || source.content().contains("Pipe"); } } // if the ext is an accepted file then we include it as a potential route diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/Bind.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/Bind.java index 00f77c2f652..f3e70110a65 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/Bind.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/Bind.java @@ -74,7 +74,7 @@ public class Bind extends CamelCommand { // Available binding providers, order in array is important! private final BindingProvider[] bindingProviders = new BindingProvider[] { - new KameletBindingProvider(), + new PipeProvider(), new KnativeBrokerBindingProvider(), new KnativeChannelBindingProvider(), new StrimziKafkaTopicBindingProvider(), diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/KameletBindingProvider.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/PipeProvider.java similarity index 98% rename from dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/KameletBindingProvider.java rename to dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/PipeProvider.java index 1e65af00fef..e5236ce577f 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/KameletBindingProvider.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/bind/PipeProvider.java @@ -45,11 +45,11 @@ import static org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.nodeAt; * Binding to Kamelets as Kubernetes object references. Automatically resolves Kamelet from catalog and reads required * properties. Adds required properties as placeholder to the object reference when not set already by the user. */ -public class KameletBindingProvider extends ObjectReferenceBindingProvider { +public class PipeProvider extends ObjectReferenceBindingProvider { private static final String prefix = "kamelet:"; - public KameletBindingProvider() { + public PipeProvider() { super("camel.apache.org/v1", "Kamelet"); } diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/GitHubHelper.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/GitHubHelper.java index be8f770770a..a7756ac24cc 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/GitHubHelper.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/GitHubHelper.java @@ -90,7 +90,6 @@ public final class GitHubHelper { path = sj.toString(); if ("tree".equals(action)) { - // https://api.github.com/repos/apache/camel-k-examples/contents/examples/generic-examples url = "https://api.github.com/repos/" + org + "/" + repo + "/contents/" + path; if (!"main".equals(branch) && !"master".equals(branch)) { url = url + "?ref=" + branch; diff --git a/dsl/camel-xml-io-dsl/src/main/docs/java-xml-io-dsl.adoc b/dsl/camel-xml-io-dsl/src/main/docs/java-xml-io-dsl.adoc index 257ac5b0e01..e3d2fcd51bb 100644 --- a/dsl/camel-xml-io-dsl/src/main/docs/java-xml-io-dsl.adoc +++ b/dsl/camel-xml-io-dsl/src/main/docs/java-xml-io-dsl.adoc @@ -19,7 +19,7 @@ However, the `xml-io-dsl` is a source code generated parser that is Camel specif route files (not classic Spring `<beans>` XML files). If you are using Camel XML DSL then it is recommended using `xml-io-dsl` instead of `xml-jaxb-dsl`. -You can use this in all of Camel's runtime such as Spring Boot, Quarkus, Camel Main, and Camel K etc. +You can use this in all of Camel's runtime such as Spring Boot, Quarkus, Camel Main. == Example @@ -32,7 +32,7 @@ The following `my-route.xml` source file: <route> <from uri="timer:tick"/> <setBody> - <constant>Hello Camel K!</constant> + <constant>Hello Camel!</constant> </setBody> <to uri="log:info"/> </route> @@ -41,14 +41,7 @@ The following `my-route.xml` source file: TIP: You can omit the `xmlns` namespace. And if there is only a single route, you can use `<route>` as the root XML tag. -Can then be loaded and run with Camel CLI or Camel K. - -.Running with Camel K - -[source,bash] ----- -kamel run my-route.xml ----- +Can then be loaded and run with Camel CLI. .Running with Camel CLI diff --git a/dsl/camel-xml-jaxb-dsl/src/main/docs/java-xml-jaxb-dsl.adoc b/dsl/camel-xml-jaxb-dsl/src/main/docs/java-xml-jaxb-dsl.adoc index 90470a039d3..ca7e265d1f9 100644 --- a/dsl/camel-xml-jaxb-dsl/src/main/docs/java-xml-jaxb-dsl.adoc +++ b/dsl/camel-xml-jaxb-dsl/src/main/docs/java-xml-jaxb-dsl.adoc @@ -18,7 +18,7 @@ However, the `xml-io-dsl` is a source code generated parser that is Camel specif route files (not classic Spring `<beans>` XML files). If you are using Camel XML DSL then it is recommended using `xml-io-dsl` instead of `xml-jaxb-dsl`. -You can use this in all of Camel's runtime such as Spring Boot, Quarkus, Camel Main, and Camel K etc. +You can use this in all of Camel's runtime such as Spring Boot, Quarkus, Camel Main. If you use classic Spring `<beans>` XML files then you must use the `camel-jaxb-dsl`, which comes out of the box when using `camel-spring-xml`. diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java index 9b5001d5428..aebec90986f 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java @@ -74,7 +74,7 @@ public class BeansDeserializer extends YamlDeserializerSupport implements Constr } // due to yaml-dsl is pre parsing beans which gets created eager - // and then later beans can be parsed again such as from Camel K Integration CRD files + // and then later beans can be parsed again such as from Yaml dsl files // we need to avoid double creating beans and therefore has a cache to check for duplicates String key = bean.getName() + ":" + bean.getType(); boolean duplicate = beanCache.contains(key); diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/IntegrationConfigurationPropertiesSource.java b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/IntegrationConfigurationPropertiesSource.java deleted file mode 100644 index 61b6c2cf638..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/IntegrationConfigurationPropertiesSource.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml; - -import java.io.InputStream; -import java.util.Properties; - -import org.apache.camel.CamelContext; -import org.apache.camel.CamelContextAware; -import org.apache.camel.Ordered; -import org.apache.camel.component.properties.AbstractLocationPropertiesSource; -import org.apache.camel.component.properties.PropertiesComponent; -import org.apache.camel.component.properties.PropertiesLocation; -import org.apache.camel.spi.PropertiesSource; -import org.apache.camel.support.ResourceHelper; -import org.apache.camel.util.StringHelper; - -/** - * {@link PropertiesSource} for camel-k integration spec/configuration values. - */ -public class IntegrationConfigurationPropertiesSource extends AbstractLocationPropertiesSource - implements CamelContextAware, Ordered { - - private final String name; - private CamelContext camelContext; - - public IntegrationConfigurationPropertiesSource(PropertiesComponent propertiesComponent, PropertiesLocation location, - String name) { - super(propertiesComponent, location); - this.name = name; - } - - @Override - public CamelContext getCamelContext() { - return camelContext; - } - - @Override - public void setCamelContext(CamelContext camelContext) { - this.camelContext = camelContext; - } - - @Override - public String getName() { - return name; - } - - @Override - public Properties loadPropertiesFromLocation(PropertiesComponent propertiesComponent, PropertiesLocation location) { - // properties are "loaded" in the parseConfigurationValue - return null; - } - - @Override - public int getOrder() { - return 300; - } - - public void parseConfigurationValue(String line) { - if (line.contains("=")) { - String key = StringHelper.before(line, "=").trim(); - String value = StringHelper.after(line, "=").trim(); - setProperty(key, value); - } else { - if (ResourceHelper.hasScheme(line)) { - // it is a properties file so load resource - try (InputStream is = ResourceHelper.resolveResourceAsInputStream(camelContext, line)) { - Properties prop = new Properties(); - prop.load(is); - for (String k : prop.stringPropertyNames()) { - String v = prop.getProperty(k); - String key = k.trim(); - String value = v.trim(); - setProperty(key, value); - } - } catch (Exception e) { - // ignore - } - } - } - } - - @Override - public String toString() { - return "camel-yaml-dsl"; - } -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/IntegrationSourceResource.java b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/IntegrationSourceResource.java deleted file mode 100644 index 74fdd0ef90b..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/IntegrationSourceResource.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; - -import org.apache.camel.support.ResourceSupport; - -/** - * Resource for embedded sources in Camel-K integration sources. - */ -final class IntegrationSourceResource extends ResourceSupport { - - private final String code; - - IntegrationSourceResource(String scheme, String location, String code) { - super(scheme, location); - this.code = code; - } - - @Override - public boolean exists() { - return true; - } - - @Override - public InputStream getInputStream() throws IOException { - return new ByteArrayInputStream(code.getBytes(StandardCharsets.UTF_8)); - } -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java index 9bae448eada..91105ef6177 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/main/java/org/apache/camel/dsl/yaml/YamlRoutesBuilderLoader.java @@ -27,19 +27,15 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.camel.CamelContext; import org.apache.camel.CamelContextAware; import org.apache.camel.ErrorHandlerFactory; import org.apache.camel.RuntimeCamelException; import org.apache.camel.api.management.ManagedResource; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.builder.RouteConfigurationBuilder; -import org.apache.camel.component.properties.PropertiesLocation; import org.apache.camel.dsl.yaml.common.YamlDeserializationContext; import org.apache.camel.dsl.yaml.common.YamlDeserializerSupport; -import org.apache.camel.dsl.yaml.common.exception.InvalidNodeTypeException; import org.apache.camel.dsl.yaml.deserializers.OutputAwareFromDefinition; import org.apache.camel.model.InterceptDefinition; import org.apache.camel.model.InterceptFromDefinition; @@ -61,14 +57,10 @@ import org.apache.camel.model.rest.RestDefinition; import org.apache.camel.model.rest.VerbDefinition; import org.apache.camel.spi.CamelContextCustomizer; import org.apache.camel.spi.DataType; -import org.apache.camel.spi.DependencyStrategy; import org.apache.camel.spi.Resource; import org.apache.camel.spi.annotations.RoutesLoader; import org.apache.camel.support.ObjectHelper; -import org.apache.camel.support.PluginHelper; import org.apache.camel.support.PropertyBindingSupport; -import org.apache.camel.util.FileUtil; -import org.apache.camel.util.StringQuoteHelper; import org.apache.camel.util.URISupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -87,7 +79,6 @@ import org.snakeyaml.engine.v2.scanner.StreamReader; import static org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asMap; import static org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asMappingNode; import static org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asSequenceNode; -import static org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asStringList; import static org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.asText; import static org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.isSequenceNode; import static org.apache.camel.dsl.yaml.common.YamlDeserializerSupport.nodeAt; @@ -99,18 +90,13 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { public static final String EXTENSION = "yaml"; public static final String[] SUPPORTED_EXTENSION = { EXTENSION, "camel.yaml", "pipe.yaml" }; - private static final String DEPRECATED_EXTENSION = "camelk.yaml"; private static final Logger LOG = LoggerFactory.getLogger(YamlRoutesBuilderLoader.class); - private final AtomicBoolean deprecatedWarnLogged = new AtomicBoolean(); - private final AtomicBoolean deprecatedBindingWarnLogged = new AtomicBoolean(); - - // API versions for Camel-K Integration and Pipe - // we are lenient so lets just assume we can work with any of the v1 even if they evolve - private static final String INTEGRATION_VERSION = "camel.apache.org/v1"; + // API versions for Pipe + // we are lenient so lets just assume we can work with any of the v1 even if + // they evolve @Deprecated - private static final String BINDING_VERSION = "camel.apache.org/v1alpha1"; private static final String PIPE_VERSION = "camel.apache.org/v1"; private static final String STRIMZI_VERSION = "kafka.strimzi.io/v1beta2"; private static final String KNATIVE_MESSAGING_VERSION = "messaging.knative.dev/v1"; @@ -130,19 +116,14 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { @Override public boolean isSupportedExtension(String extension) { // this builder can support multiple extensions - if (DEPRECATED_EXTENSION.equals(extension)) { - if (deprecatedWarnLogged.compareAndSet(false, true)) { - LOG.warn("File extension camelk.yaml is deprecated. Use camel.yaml instead."); - } - return true; - } return Arrays.asList(SUPPORTED_EXTENSION).contains(extension); } protected RouteBuilder builder(final YamlDeserializationContext ctx, final Node root) { // we need to keep track of already configured items as the yaml-dsl returns a - // RouteConfigurationBuilder that is capable of both route and route configurations + // RouteConfigurationBuilder that is capable of both route and route + // configurations // which can lead to the same items being processed twice final Set<Integer> indexes = new HashSet<>(); @@ -179,7 +160,8 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { } } - // knowing this is the last time an YAML may have been parsed, we can clear the cache + // knowing this is the last time an YAML may have been parsed, we can clear the + // cache // (route may get reloaded later) Resource resource = ctx.getResource(); if (resource != null) { @@ -334,24 +316,13 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { // backwards compatible fixes Object target = root; - // check if the yaml is a camel-k yaml with embedded binding/routes (called flow(s)) + // check if the yaml with embedded pipes if (Objects.equals(root.getNodeType(), NodeType.MAPPING)) { final MappingNode mn = YamlDeserializerSupport.asMappingNode(root); - // camel-k: integration - boolean integration = anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(INTEGRATION_VERSION)) && - anyTupleMatches(mn.getValue(), "kind", "Integration"); - // camel-k: kamelet binding (deprecated) - boolean binding = anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(BINDING_VERSION)) && - anyTupleMatches(mn.getValue(), "kind", "KameletBinding"); - // camel-k: pipe + // pipe boolean pipe = anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(PIPE_VERSION)) && anyTupleMatches(mn.getValue(), "kind", "Pipe"); - if (integration) { - target = preConfigureIntegration(root, ctx, target, preParse); - } else if (binding || pipe) { - if (binding && deprecatedBindingWarnLogged.compareAndSet(false, true)) { - LOG.warn("CamelK kind=KameletBinding is deprecated. Use CamelK kind=Pipe instead."); - } + if (pipe) { target = preConfigurePipe(root, ctx, target, preParse); } } @@ -386,322 +357,7 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { } /** - * Camel K Integration file - */ - private Object preConfigureIntegration(Node root, YamlDeserializationContext ctx, Object target, boolean preParse) { - Node spec = nodeAt(root, "/spec"); - if (spec != null) { - return preConfigureIntegrationSpec(spec, ctx, target, preParse); - } else { - return new ArrayList<>(); - } - } - - /** - * Camel K Integration spec - */ - private List<Object> preConfigureIntegrationSpec( - Node root, YamlDeserializationContext ctx, Object target, boolean preParse) { - // when in pre-parse phase then we only want to gather spec/dependencies,spec/configuration,spec/traits - - List<Object> answer = new ArrayList<>(); - - // if there are dependencies then include them first - Node deps = nodeAt(root, "/dependencies"); - if (deps != null) { - var dep = preConfigureDependencies(deps); - answer.add(dep); - } - - // if there are configurations then include them early - Node configuration = nodeAt(root, "/configuration"); - if (configuration != null) { - var list = preConfigureConfiguration(ctx.getResource(), configuration); - answer.addAll(list); - } - // if there are trait configuration then include them early - configuration = nodeAt(root, "/traits/camel"); - if (configuration != null) { - var list = preConfigureTraitCamel(ctx.getResource(), configuration); - answer.addAll(list); - } - // if there are trait environment then include them early - configuration = nodeAt(root, "/traits/environment"); - if (configuration != null) { - var list = preConfigureTraitEnvironment(ctx.getResource(), configuration); - answer.addAll(list); - } - - if (!preParse) { - // if there are sources then include them before routes - Node sources = nodeAt(root, "/sources"); - if (sources != null) { - var list = preConfigureSources(sources); - answer.addAll(list); - } - // add routes last - Node routes = nodeAt(root, "/flows"); - if (routes == null) { - routes = nodeAt(root, "/flow"); - } - if (routes != null) { - // routes should be an array - if (routes.getNodeType() != NodeType.SEQUENCE) { - throw new InvalidNodeTypeException(routes, NodeType.SEQUENCE); - } - answer.add(routes); - } - } - - return answer; - } - - private CamelContextCustomizer preConfigureDependencies(Node node) { - final List<String> dep = YamlDeserializerSupport.asStringList(node); - return new CamelContextCustomizer() { - @Override - public void configure(CamelContext camelContext) { - // notify the listeners about each dependency detected - for (DependencyStrategy ds : camelContext.getRegistry().findByType(DependencyStrategy.class)) { - for (String d : dep) { - try { - ds.onDependency(d); - } catch (Exception e) { - // ignore - } - } - } - } - }; - } - - private List<CamelContextCustomizer> preConfigureConfiguration(Resource resource, Node node) { - List<CamelContextCustomizer> answer = new ArrayList<>(); - - final List<String> lines = new ArrayList<>(); - SequenceNode seq = asSequenceNode(node); - for (Node n : seq.getValue()) { - MappingNode content = asMappingNode(n); - Map<String, Object> params = asMap(content); - Object type = params.get("type"); - Object value = params.get("value"); - if ("property".equals(type) && value != null) { - String line = value.toString(); - lines.add(line); - } - } - answer.add(new CamelContextCustomizer() { - @Override - public void configure(CamelContext camelContext) { - try { - org.apache.camel.component.properties.PropertiesComponent pc - = (org.apache.camel.component.properties.PropertiesComponent) camelContext.getPropertiesComponent(); - IntegrationConfigurationPropertiesSource ps - = (IntegrationConfigurationPropertiesSource) pc.getPropertiesSource("integration-configuration"); - if (ps == null) { - ps = new IntegrationConfigurationPropertiesSource( - pc, new PropertiesLocation(resource.getLocation()), "integration-configuration"); - pc.addPropertiesSource(ps); - } - lines.forEach(ps::parseConfigurationValue); - } catch (Exception e) { - throw new RuntimeCamelException("Error adding properties from spec/configuration", e); - } - } - }); - - return answer; - } - - private List<CamelContextCustomizer> preConfigureTraitCamel(Resource resource, Node node) { - List<CamelContextCustomizer> answer = new ArrayList<>(); - - Node target; - if (nodeAt(node, "/configuration") != null) { - // legacy trait configuration parameters - target = nodeAt(node, "/configuration/properties"); - } else { - target = nodeAt(node, "/properties"); - } - - final List<String> lines = asStringList(target); - if (lines == null || lines.isEmpty()) { - return answer; - } - - answer.add(new CamelContextCustomizer() { - @Override - public void configure(CamelContext camelContext) { - try { - org.apache.camel.component.properties.PropertiesComponent pc - = (org.apache.camel.component.properties.PropertiesComponent) camelContext.getPropertiesComponent(); - IntegrationConfigurationPropertiesSource ps - = (IntegrationConfigurationPropertiesSource) pc - .getPropertiesSource("integration-trait-configuration"); - if (ps == null) { - ps = new IntegrationConfigurationPropertiesSource( - pc, new PropertiesLocation(resource.getLocation()), "integration-trait-configuration"); - pc.addPropertiesSource(ps); - } - lines.forEach(ps::parseConfigurationValue); - } catch (Exception e) { - throw new RuntimeCamelException("Error adding properties from spec/traits/camel", e); - } - } - }); - - return answer; - } - - private List<CamelContextCustomizer> preConfigureTraitEnvironment(Resource resource, Node node) { - List<CamelContextCustomizer> answer = new ArrayList<>(); - - Node target; - if (nodeAt(node, "/configuration") != null) { - // legacy trait configuration parameters - target = nodeAt(node, "/configuration/vars"); - } else { - target = nodeAt(node, "/vars"); - } - - final List<String> lines = asStringList(target); - if (lines == null || lines.isEmpty()) { - return answer; - } - - answer.add(new CamelContextCustomizer() { - @Override - public void configure(CamelContext camelContext) { - try { - org.apache.camel.component.properties.PropertiesComponent pc - = (org.apache.camel.component.properties.PropertiesComponent) camelContext.getPropertiesComponent(); - IntegrationConfigurationPropertiesSource ps - = (IntegrationConfigurationPropertiesSource) pc - .getPropertiesSource("environment-trait-configuration"); - if (ps == null) { - ps = new IntegrationConfigurationPropertiesSource( - pc, new PropertiesLocation(resource.getLocation()), "environment-trait-configuration"); - pc.addPropertiesSource(ps); - } - lines.forEach(ps::parseConfigurationValue); - } catch (Exception e) { - throw new RuntimeCamelException("Error adding properties from spec/traits/environment", e); - } - } - }); - - return answer; - } - - private List<CamelContextCustomizer> preConfigureTraitConfigurationBinding(Resource resource, Map<String, Object> map) { - List<CamelContextCustomizer> answer = new ArrayList<>(); - - if (map == null || map.isEmpty()) { - return null; - } - Object value = map.get("trait.camel.apache.org/camel.properties"); - if (value == null || value.toString().isEmpty()) { - return null; - } - final String[] properties = StringQuoteHelper.splitSafeQuote(value.toString(), ',', true); - - answer.add(new CamelContextCustomizer() { - @Override - public void configure(CamelContext camelContext) { - try { - org.apache.camel.component.properties.PropertiesComponent pc - = (org.apache.camel.component.properties.PropertiesComponent) camelContext.getPropertiesComponent(); - IntegrationConfigurationPropertiesSource ps - = (IntegrationConfigurationPropertiesSource) pc - .getPropertiesSource("binding-trait-configuration"); - if (ps == null) { - ps = new IntegrationConfigurationPropertiesSource( - pc, new PropertiesLocation(resource.getLocation()), "binding-trait-configuration"); - pc.addPropertiesSource(ps); - } - - for (String line : properties) { - ps.parseConfigurationValue(line); - } - } catch (Exception e) { - throw new RuntimeCamelException("Error adding properties from metadata/annotations/", e); - } - } - }); - - return answer; - } - - private List<CamelContextCustomizer> preConfigureTraitEnvironmentBinding(Resource resource, Map<String, Object> map) { - List<CamelContextCustomizer> answer = new ArrayList<>(); - - if (map == null || map.isEmpty()) { - return null; - } - Object value = map.get("trait.camel.apache.org/environment.vars"); - if (value == null || value.toString().isEmpty()) { - return null; - } - final String[] properties = StringQuoteHelper.splitSafeQuote(value.toString(), ',', true); - - answer.add(new CamelContextCustomizer() { - @Override - public void configure(CamelContext camelContext) { - try { - org.apache.camel.component.properties.PropertiesComponent pc - = (org.apache.camel.component.properties.PropertiesComponent) camelContext.getPropertiesComponent(); - IntegrationConfigurationPropertiesSource ps - = (IntegrationConfigurationPropertiesSource) pc - .getPropertiesSource("environment-trait-configuration"); - if (ps == null) { - ps = new IntegrationConfigurationPropertiesSource( - pc, new PropertiesLocation(resource.getLocation()), "environment-trait-configuration"); - pc.addPropertiesSource(ps); - } - - for (String line : properties) { - ps.parseConfigurationValue(line); - } - } catch (Exception e) { - throw new RuntimeCamelException("Error adding properties from metadata/annotations/", e); - } - } - }); - - return answer; - } - - private List<CamelContextCustomizer> preConfigureSources(Node node) { - List<CamelContextCustomizer> answer = new ArrayList<>(); - - SequenceNode seq = asSequenceNode(node); - for (Node n : seq.getValue()) { - MappingNode content = asMappingNode(n); - Map<String, Object> params = asMap(content); - Object name = params.get("name"); - Object code = params.get("content"); - if (name != null && code != null) { - String ext = FileUtil.onlyExt(name.toString(), false); - final Resource res = new IntegrationSourceResource(ext, name.toString(), code.toString()); - answer.add(new CamelContextCustomizer() { - @Override - public void configure(CamelContext camelContext) { - try { - PluginHelper.getRoutesLoader(camelContext).loadRoutes(res); - } catch (Exception e) { - throw new RuntimeCamelException( - "Error loading sources from resource: " + res + " due to " + e.getMessage(), e); - } - } - }); - } - } - - return answer; - } - - /** - * Camel K Pipe file + * Pipe file */ private Object preConfigurePipe(Node root, YamlDeserializationContext ctx, Object target, boolean preParse) { // when in pre-parse phase then we only want to gather /metadata/annotations @@ -710,22 +366,6 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { MappingNode ann = asMappingNode(nodeAt(root, "/metadata/annotations")); Map<String, Object> params = asMap(ann); - if (params != null) { - var list = preConfigureTraitConfigurationBinding(ctx.getResource(), params); - if (list != null) { - answer.addAll(list); - } - list = preConfigureTraitEnvironmentBinding(ctx.getResource(), params); - if (list != null) { - answer.addAll(list); - } - } - - // Pipe may hold an integration spec - Node integration = nodeAt(root, "/spec/integration"); - if (integration != null) { - answer.addAll(preConfigureIntegrationSpec(integration, ctx, target, preParse)); - } if (!preParse) { // start with a route @@ -911,16 +551,14 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { // extract uri is different if kamelet or not boolean kamelet = mn != null && anyTupleMatches(mn.getValue(), "kind", "Kamelet"); - boolean strimzi - = !kamelet && mn != null && anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(STRIMZI_VERSION)) - && anyTupleMatches(mn.getValue(), "kind", "KafkaTopic"); - boolean knativeBroker - = !kamelet && mn != null - && anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(KNATIVE_EVENTING_VERSION)) - && anyTupleMatches(mn.getValue(), "kind", "Broker"); - boolean knativeChannel - = !kamelet && !strimzi && mn != null - && anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(KNATIVE_MESSAGING_VERSION)); + boolean strimzi = !kamelet && mn != null + && anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(STRIMZI_VERSION)) + && anyTupleMatches(mn.getValue(), "kind", "KafkaTopic"); + boolean knativeBroker = !kamelet && mn != null + && anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(KNATIVE_EVENTING_VERSION)) + && anyTupleMatches(mn.getValue(), "kind", "Broker"); + boolean knativeChannel = !kamelet && !strimzi && mn != null + && anyTupleMatches(mn.getValue(), "apiVersion", v -> v.startsWith(KNATIVE_MESSAGING_VERSION)); String uri; if (knativeBroker) { uri = KNATIVE_EVENT_TYPE; @@ -935,7 +573,8 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { Map<String, Object> params = asMap(prop); if (knativeBroker && params != null && params.containsKey("type")) { - // Use explicit event type from properties - remove setting from params and set as uri + // Use explicit event type from properties - remove setting from params and set + // as uri uri = params.remove("type").toString(); } @@ -964,7 +603,8 @@ public class YamlRoutesBuilderLoader extends YamlRoutesBuilderLoaderSupport { @Override public void preParseRoute(Resource resource) throws Exception { - // preparsing is done at early stage, so we have a chance to load additional beans and populate + // preparsing is done at early stage, so we have a chance to load additional + // beans and populate // Camel registry if (preparseDone.getOrDefault(resource.getLocation(), false)) { return; diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ChoiceCamelKExtTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ChoiceCamelKExtTest.groovy deleted file mode 100644 index fdee6ef02e2..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ChoiceCamelKExtTest.groovy +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml - -import org.apache.camel.dsl.yaml.support.YamlTestSupport -import org.apache.camel.model.ChoiceDefinition -import org.apache.camel.model.ToDefinition -import org.apache.camel.model.WhenDefinition - -class ChoiceCamelKExtTest extends YamlTestSupport { - - def "choice definition"() { - when: - loadRoutesExt("camelk.yaml", ''' - - from: - uri: "direct:start" - steps: - - choice: - when: - - simple: "${body.size()} == 1" - steps: - - to: "log:when-a" - - expression: - simple: "${body.size()} == 2" - steps: - - to: "log:when-b" - otherwise: - steps: - - to: "log:otherwise" - ''') - then: - context.routeDefinitions.size() == 1 - - with(context.routeDefinitions[0].outputs[0], ChoiceDefinition) { - with(whenClauses[0], WhenDefinition) { - expression.language == 'simple' - expression.expression == '${body.size()} == 1' - with(outputs[0], ToDefinition) { - endpointUri == 'log:when-a' - } - } - with(whenClauses[1], WhenDefinition) { - expression.language == 'simple' - expression.expression == '${body.size()} == 2' - with(outputs[0], ToDefinition) { - endpointUri == 'log:when-b' - } - } - with(otherwise.outputs[0], ToDefinition) { - endpointUri == 'log:otherwise' - } - } - } - - def "choice in precondition mode"() { - when: - loadRoutesExt("camelk.yaml", ''' - - from: - uri: "direct:start" - steps: - - choice: - precondition: true - when: - - simple: "{{?red}}" - steps: - - to: "mock:red" - - simple: "{{?blue}}" - steps: - - to: "mock:blue" - otherwise: - steps: - - to: "mock:other" - ''') - then: - context.routeDefinitions.size() == 1 - - with(context.routeDefinitions[0].outputs[0], ChoiceDefinition) { - with(whenClauses[0], WhenDefinition) { - expression.language == 'simple' - expression.expression == '{{?red}}' - with(outputs[0], ToDefinition) { - endpointUri == 'mock:red' - } - } - with(whenClauses[1], WhenDefinition) { - expression.language == 'simple' - expression.expression == '{{?blue}}' - with(outputs[0], ToDefinition) { - endpointUri == 'mock:blue' - } - } - with(otherwise.outputs[0], ToDefinition) { - endpointUri == 'mock:other' - } - } - } -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/IntegrationLoaderDependenciesTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/IntegrationLoaderDependenciesTest.groovy deleted file mode 100644 index e0318dee911..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/IntegrationLoaderDependenciesTest.groovy +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml - -import org.apache.camel.dsl.yaml.support.YamlTestSupport -import org.apache.camel.spi.DependencyStrategy - -class IntegrationLoaderDependenciesTest extends YamlTestSupport { - - var Set<String> deps = new LinkedHashSet<>() - - @Override - def doSetup() { - context.registry.bind("myDep", new DependencyStrategy() { - @Override - void onDependency(String dependency) { - deps.add(dependency) - } - }) - - context.start() - } - - def "integration dependencies"() { - when: - loadIntegrations(''' - apiVersion: camel.apache.org/v1 - kind: Integration - metadata: - name: sql-to-log.yaml - spec: - dependencies: - - "mvn:org.apache.commons:commons-dbcp2:2.9.0" - - "mvn:org.postgresql:postgresql:42.6.0" - flows: - - from: - uri: "sql:SELECT * FROM table1" - parameters: - dataSource: "#bean:myDatasource" - steps: - - marshal: - json: - library: Jackson - - log: "${body}" - - beans: - - name: myDatasource - type: "org.apache.commons.dbcp2.BasicDataSource" - properties: - driverClassName: "org.postgresql.Driver" - url: "jdbc:postgresql:localhost:5432:demo" - username: postgres - password: postgres - ''') - then: - context.routeDefinitions.size() == 1 - - with (context.routeDefinitions[0]) { - input.endpointUri == 'sql:SELECT * FROM table1?dataSource=#bean:myDatasource' - input.lineNumber == 11 - outputs.size() == 2 - } - - deps.size() == 2 - deps[0] == 'mvn:org.apache.commons:commons-dbcp2:2.9.0' - deps[1] == 'mvn:org.postgresql:postgresql:42.6.0' - } - -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/IntegrationLoaderTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/IntegrationLoaderTest.groovy deleted file mode 100644 index d6560894a2f..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/IntegrationLoaderTest.groovy +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml - -import org.apache.camel.dsl.yaml.support.YamlTestSupport -import org.apache.camel.model.LogDefinition -import org.apache.camel.model.ToDefinition -import org.apache.camel.spi.PropertiesComponent - -class IntegrationLoaderTest extends YamlTestSupport { - - def "integration configuration"() { - when: - loadIntegrations(''' - apiVersion: camel.apache.org/v1 - kind: Integration - metadata: - name: foobar - spec: - configuration: - - type: property - value: camel.component.seda.queueSize = 123 - - type: property - value: camel.component.seda.default-block-when-full = true - flows: - - from: - uri: "seda:foo" - steps: - - log: - logging-level: "INFO" - message: "test" - log-name: "yaml" - - to: "mock:result" - ''') - then: - context.routeDefinitions.size() == 1 - - PropertiesComponent pc = context.getPropertiesComponent() - pc.resolveProperty("camel.component.seda.queueSize").get() == "123" - pc.resolveProperty("camel.component.seda.default-block-when-full").get() == "true" - } - - def "integration trait configuration"() { - when: - loadIntegrations(''' - apiVersion: camel.apache.org/v1 - kind: Integration - metadata: - name: foobar2 - spec: - traits: - camel: - properties: - - camel.component.seda.queueSize = 456 - - camel.component.seda.default-block-when-full = true - flows: - - from: - uri: "seda:foo" - steps: - - log: - logging-level: "INFO" - message: "test" - log-name: "yaml" - - to: "mock:result" - ''') - then: - context.routeDefinitions.size() == 1 - - PropertiesComponent pc = context.getPropertiesComponent() - pc.resolveProperty("camel.component.seda.queueSize").get() == "456" - pc.resolveProperty("camel.component.seda.default-block-when-full").get() == "true" - } - - def "integration env configuration"() { - when: - loadIntegrations(''' - apiVersion: camel.apache.org/v1 - kind: Integration - metadata: - name: foobar2 - spec: - traits: - camel: - properties: - - camel.component.seda.queueSize = 456 - - camel.component.seda.default-block-when-full = true - environment: - vars: - - TEST_MESSAGE = Hello World - flows: - - from: - uri: "seda:foo" - steps: - - log: - logging-level: "INFO" - message: "{{TEST_MESSAGE}}" - log-name: "yaml" - - to: "mock:result" - ''') - then: - context.routeDefinitions.size() == 1 - - with(context.routeDefinitions[0].outputs[0], LogDefinition) { - loggingLevel == 'INFO' - message == '{{TEST_MESSAGE}}' - logName == 'yaml' - } - - PropertiesComponent pc = context.getPropertiesComponent() - pc.resolveProperty("camel.component.seda.queueSize").get() == "456" - pc.resolveProperty("camel.component.seda.default-block-when-full").get() == "true" - pc.resolveProperty("TEST_MESSAGE").get() == "Hello World" - } - - def "integration"() { - when: - loadIntegrations(''' - apiVersion: camel.apache.org/v1 - kind: Integration - metadata: - name: foobar3 - spec: - flows: - - from: - uri: "seda:foo" - steps: - - to: "mock:result" - ''') - then: - context.routeDefinitions.size() == 1 - - with(context.routeDefinitions[0].outputs[0], ToDefinition) { - uri == "mock:result" - } - } - - def "integrationTwo"() { - when: - loadIntegrations(''' - apiVersion: camel.apache.org/v1 - kind: Integration - metadata: - name: foobar3 - spec: - flows: - - from: - uri: "seda:foo" - steps: - - to: "mock:result" - - from: - uri: "seda:foo2" - steps: - - to: "mock:result2" - ''') - then: - context.routeDefinitions.size() == 2 - - with(context.routeDefinitions[0].outputs[0], ToDefinition) { - uri == "mock:result" - } - with(context.routeDefinitions[1].outputs[0], ToDefinition) { - uri == "mock:result2" - } - } - - def "integration with route"() { - when: - loadIntegrations(''' - apiVersion: camel.apache.org/v1 - kind: Integration - metadata: - name: foobar3 - spec: - flows: - - route: - id: myRoute - from: - uri: "seda:foo" - steps: - - to: "mock:result" - ''') - then: - context.routeDefinitions.size() == 1 - - context.routeDefinitions[0].id == "myRoute" - - with(context.routeDefinitions[0].outputs[0], ToDefinition) { - uri == "mock:result" - } - } - -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletBindingLoaderIntegrationSpecTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletBindingLoaderIntegrationSpecTest.groovy deleted file mode 100644 index 37bef89a4f9..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletBindingLoaderIntegrationSpecTest.groovy +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml - -import org.apache.camel.dsl.yaml.support.YamlTestSupport -import org.apache.camel.spi.DependencyStrategy - -class KameletBindingLoaderIntegrationSpecTest extends YamlTestSupport { - - var Set<String> deps = new LinkedHashSet<>() - - @Override - def doSetup() { - context.registry.bind("myDep", new DependencyStrategy() { - @Override - void onDependency(String dependency) { - deps.add(dependency) - } - }) - - context.start() - } - - def "binding with integration spec"() { - when: - loadBindings(''' - apiVersion: camel.apache.org/v1alpha1 - kind: KameletBinding - metadata: - name: timer-event-source - spec: - integration: - dependencies: - - "camel:cloudevents" - traits: - camel: - properties: - - "foo=howdy" - - "bar=123" - environment: - vars: - - "MY_ENV=cheese" - source: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: timer-source - properties: - message: "Hello world!" - sink: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: log-sink - ''') - then: - context.routeDefinitions.size() == 3 - - context.resolvePropertyPlaceholders("{{foo}}") == "howdy" - context.resolvePropertyPlaceholders("{{bar}}") == "123" - context.resolvePropertyPlaceholders("{{MY_ENV}}") == "cheese" - - with(deps) { - deps.contains("camel:core") - deps.contains("camel:kamelet") - deps.contains("camel:cloudevents") - } - } - -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletBindingLoaderTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletBindingLoaderTest.groovy deleted file mode 100644 index e3111c427f7..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletBindingLoaderTest.groovy +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml - -import org.apache.camel.Exchange -import org.apache.camel.Processor -import org.apache.camel.component.mock.MockEndpoint -import org.apache.camel.dsl.yaml.support.YamlTestSupport -import org.apache.camel.model.KameletDefinition -import org.apache.camel.model.ToDefinition -import org.apache.camel.model.TransformDefinition -import org.apache.camel.model.errorhandler.DeadLetterChannelDefinition -import org.apache.camel.model.errorhandler.DefaultErrorHandlerDefinition -import org.apache.camel.model.errorhandler.NoErrorHandlerDefinition - -class KameletBindingLoaderTest extends YamlTestSupport { - @Override - def doSetup() { - context.start() - } - - def "kamelet binding from kamelet to kamelet"() { - when: - loadBindings(''' - apiVersion: camel.apache.org/v1alpha1 - kind: KameletBinding - metadata: - name: timer-event-source - spec: - source: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: timer-source - properties: - message: "Hello world!" - sink: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: log-sink - ''') - then: - context.routeDefinitions.size() == 3 - - with (context.routeDefinitions[0]) { - routeId == 'timer-event-source' - input.endpointUri == 'kamelet:timer-source?message=Hello+world%21' - input.lineNumber == 7 - outputs.size() == 1 - with (outputs[0], ToDefinition) { - endpointUri == 'kamelet:log-sink' - lineNumber == 14 - } - } - } -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletIntegrationLoaderTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletIntegrationLoaderTest.groovy deleted file mode 100644 index dedef4e1af5..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/KameletIntegrationLoaderTest.groovy +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml - -import org.apache.camel.dsl.yaml.support.YamlTestSupport -import org.apache.camel.model.KameletDefinition - -class KameletIntegrationLoaderTest extends YamlTestSupport { - @Override - def doSetup() { - context.start() - } - - def "kamelet integration"() { - when: - loadIntegrations(''' - apiVersion: camel.apache.org/v1 - kind: Integration - metadata: - name: foobar - spec: - flows: - - from: - uri: 'kamelet:timer-source' - steps: - - kamelet: - name: log-sink - parameters: - showStreams: false - showHeaders: false - parameters: - message: Hello Camel K - period: 1234 - ''') - then: - context.routeDefinitions.size() == 3 - - with (context.routeDefinitions[0]) { - input.endpointUri == 'kamelet:timer-source?message=Hello Camel K&period=1234' - input.lineNumber == 8 - outputs.size() == 1 - with (outputs[0], KameletDefinition) { - name == 'log-sink?showStreams=false&showHeaders=false' - lineNumber == 11 - } - } - } - -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderIntegrationSpecTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderIntegrationSpecTest.groovy deleted file mode 100644 index 02ab2e856e2..00000000000 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderIntegrationSpecTest.groovy +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.dsl.yaml - -import org.apache.camel.dsl.yaml.support.YamlTestSupport -import org.apache.camel.spi.DependencyStrategy - -class PipeLoaderIntegrationSpecTest extends YamlTestSupport { - - var Set<String> deps = new LinkedHashSet<>() - - @Override - def doSetup() { - context.registry.bind("myDep", new DependencyStrategy() { - @Override - void onDependency(String dependency) { - deps.add(dependency) - } - }) - - context.start() - } - - def "Pipe with integration spec"() { - when: - loadBindings(''' - apiVersion: camel.apache.org/v1 - kind: Pipe - metadata: - name: timer-event-source - spec: - integration: - dependencies: - - "camel:cloudevents" - traits: - camel: - properties: - - "foo=howdy" - - "bar=123" - environment: - vars: - - "MY_ENV=cheese" - source: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: timer-source - properties: - message: "Hello world!" - sink: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: log-sink - ''') - then: - context.routeDefinitions.size() == 3 - - context.resolvePropertyPlaceholders("{{foo}}") == "howdy" - context.resolvePropertyPlaceholders("{{bar}}") == "123" - context.resolvePropertyPlaceholders("{{MY_ENV}}") == "cheese" - - with(deps) { - deps.contains("camel:core") - deps.contains("camel:kamelet") - deps.contains("camel:cloudevents") - } - } - -} diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderTest.groovy index d7126afae54..701cddf887c 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderTest.groovy +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PipeLoaderTest.groovy @@ -33,7 +33,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -69,7 +69,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: uri: timer:foo @@ -98,7 +98,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: uri: timer:foo @@ -274,7 +274,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -314,7 +314,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -343,7 +343,7 @@ class PipeLoaderTest extends YamlTestSupport { kafka-service-account-secret: tiger parameters: maximumRedeliveries: 1 - redeliveryDelay: 2000 + redeliveryDelay: 2000 ''') then: context.routeDefinitions.size() == 4 @@ -375,7 +375,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -414,7 +414,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: knative-event-source + name: knative-event-source spec: source: ref: @@ -453,7 +453,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -468,7 +468,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: eventing.knative.dev/v1 name: foo-broker properties: - type: org.apache.camel.event.messages + type: org.apache.camel.event.messages ''') then: context.routeDefinitions.size() == 2 @@ -494,7 +494,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: knative-event-source + name: knative-event-source spec: source: ref: @@ -502,7 +502,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: eventing.knative.dev/v1 name: foo-broker properties: - type: org.apache.camel.event.messages + type: org.apache.camel.event.messages sink: ref: kind: Kamelet @@ -530,7 +530,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -559,45 +559,13 @@ class PipeLoaderTest extends YamlTestSupport { } } - def "Pipe with trait properties"() { - when: - loadBindings(''' - apiVersion: camel.apache.org/v1 - kind: Pipe - metadata: - name: timer-event-source - annotations: - trait.camel.apache.org/camel.properties: "foo=howdy,bar=123" - trait.camel.apache.org/environment.vars: "MY_ENV=cheese" - spec: - source: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: timer-source - properties: - message: "Hello world!" - sink: - ref: - kind: Kamelet - apiVersion: camel.apache.org/v1 - name: log-sink - ''') - then: - context.routeDefinitions.size() == 3 - - context.resolvePropertyPlaceholders("{{foo}}") == "howdy" - context.resolvePropertyPlaceholders("{{bar}}") == "123" - context.resolvePropertyPlaceholders("{{MY_ENV}}") == "cheese" - } - def "Pipe no sink"() { when: loadBindings(''' apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -633,7 +601,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -652,7 +620,7 @@ class PipeLoaderTest extends YamlTestSupport { name: log-sink dataTypes: out: - format: application/octet-stream + format: application/octet-stream ''') then: context.routeDefinitions.size() == 3 @@ -677,7 +645,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -698,7 +666,7 @@ class PipeLoaderTest extends YamlTestSupport { dataTypes: out: scheme: camel - format: application/octet-stream + format: application/octet-stream ''') then: context.routeDefinitions.size() == 3 @@ -723,7 +691,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -732,7 +700,7 @@ class PipeLoaderTest extends YamlTestSupport { name: timer-source dataTypes: out: - format: application/octet-stream + format: application/octet-stream properties: message: "Hello world!" sink: @@ -775,7 +743,7 @@ class PipeLoaderTest extends YamlTestSupport { apiVersion: camel.apache.org/v1 kind: Pipe metadata: - name: timer-event-source + name: timer-event-source spec: source: ref: @@ -785,7 +753,7 @@ class PipeLoaderTest extends YamlTestSupport { dataTypes: out: scheme: camel - format: application/octet-stream + format: application/octet-stream properties: message: "Hello world!" sink: diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/support/YamlTestSupport.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/support/YamlTestSupport.groovy index ad54dd79380..b5753649c37 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/support/YamlTestSupport.groovy +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/support/YamlTestSupport.groovy @@ -127,16 +127,6 @@ class YamlTestSupport extends Specification implements HasCamelContext { ) } - def loadIntegrations(String... resources) { - int index = 0 - - PluginHelper.getRoutesLoader(context).loadRoutes( - resources.collect { - it -> ResourceHelper.fromString("integration-${index++}.yaml", it.stripIndent()) - } - ) - } - def loadBindings(String... resources) { int index = 0 diff --git a/parent/pom.xml b/parent/pom.xml index b38343f77ae..03e77890e58 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -91,7 +91,6 @@ <californium-version>3.13.0</californium-version> <californium-scandium-version>3.11.0</californium-scandium-version> <camunda-version>7.22.0</camunda-version> - <camel-k-version>2.5.0</camel-k-version> <cassandra-driver-version>4.18.1</cassandra-driver-version> <jta-api-1.2-version>1.2</jta-api-1.2-version> <cglib-version>3.3.0</cglib-version> @@ -2760,11 +2759,6 @@ <artifactId>camel-jbang-plugin-generate</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-jbang-plugin-k</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jbang-plugin-kubernetes</artifactId> diff --git a/tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenGav.java b/tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenGav.java index 2f20ffc2eb7..2237c0abeca 100644 --- a/tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenGav.java +++ b/tooling/camel-tooling-maven/src/main/java/org/apache/camel/tooling/maven/MavenGav.java @@ -57,7 +57,7 @@ public final class MavenGav { public static MavenGav parseGav(String gav, String defaultVersion) { MavenGav answer = new MavenGav(); - // camel-k style GAV + // abbreviated style GAV gav = gav.trim(); if (gav.startsWith("camel:")) { answer.setGroupId("org.apache.camel"); @@ -74,7 +74,7 @@ public final class MavenGav { answer.setVersion(defaultVersion); } } else if (gav.startsWith("camel-") && !(gav.contains(":") || gav.contains("/"))) { - // not really camel-k style but users may mistakenly use camel-file instead of camel:file + // users may mistakenly use camel-file instead of camel:file answer.setGroupId("org.apache.camel"); String a = gav; // users may mistakenly use quarkus extension, but they should just refer to the vanilla component name diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java index 54c4802f1f0..f4e6bbf1c2a 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java @@ -917,7 +917,7 @@ public class PrepareCatalogMojo extends AbstractMojo { case "camel-huawei": case "camel-infinispan": case "camel-jetty-common": - case "camel-kantive": + case "camel-knative": case "camel-langchain4j-core": case "camel-microprofile": case "camel-olingo2":