From 6e413f4066409863dc62f104ec2fd7a1c2054015 Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Wed, 26 Jul 2023 15:22:34 +0200 Subject: [PATCH 1/2] fix: use non deprecated components --- pkg/metadata/metadata_dependencies_test.go | 12 ++++++------ pkg/metadata/metadata_http_test.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/metadata/metadata_dependencies_test.go b/pkg/metadata/metadata_dependencies_test.go index 6ce6f0275b..d252a84531 100644 --- a/pkg/metadata/metadata_dependencies_test.go +++ b/pkg/metadata/metadata_dependencies_test.go @@ -32,7 +32,7 @@ func TestDependenciesJavaSource(t *testing.T) { DataSpec: v1.DataSpec{ Name: "Request.java", Content: ` - import org.apache.camel.component.activemq.ActiveMQComponent; + import org.apache.camel.component.kafka.KafkaComponent; from("telegram:bots/cippa").to("log:stash"); from("timer:tick").to("amqp:queue"); @@ -52,7 +52,7 @@ func TestDependenciesJavaSource(t *testing.T) { assert.ElementsMatch( t, []string{ - "camel:activemq", + "camel:kafka", "camel:amqp", "camel:log", "camel:telegram", @@ -67,7 +67,7 @@ func TestDependenciesJavaScript(t *testing.T) { DataSpec: v1.DataSpec{ Name: "source.js", Content: ` - var component = Java.type("org.apache.camel.component.activemq.ActiveMQComponent"); + var component = Java.type("org.apache.camel.component.kafka.KafkaComponent"); from('telegram:bots/cippa').to("log:stash"); from('timer:tick').to("amqp:queue"); @@ -86,7 +86,7 @@ func TestDependenciesJavaScript(t *testing.T) { assert.ElementsMatch( t, []string{ - "camel:activemq", + "camel:kafka", "camel:amqp", "camel:log", "camel:telegram", @@ -100,7 +100,7 @@ func TestDependenciesGroovy(t *testing.T) { DataSpec: v1.DataSpec{ Name: "source.groovy", Content: ` - import org.apache.camel.component.activemq.ActiveMQComponent; + import org.apache.camel.component.kafka.KafkaComponent; from('telegram:bots/cippa').to("log:stash"); from('timer:tick').to("amqp:queue"); @@ -121,7 +121,7 @@ func TestDependenciesGroovy(t *testing.T) { assert.ElementsMatch( t, []string{ - "camel:activemq", + "camel:kafka", "camel:amqp", "camel:log", "camel:telegram", diff --git a/pkg/metadata/metadata_http_test.go b/pkg/metadata/metadata_http_test.go index 5572d6459b..7f095105ac 100644 --- a/pkg/metadata/metadata_http_test.go +++ b/pkg/metadata/metadata_http_test.go @@ -101,7 +101,7 @@ func TestHttpOnlyJavaSourceRest2(t *testing.T) { DataSpec: v1.DataSpec{ Name: "Request.java", Content: ` - from("vm:bots/cippa").to("log:stash"); + from("seda:bots/cippa").to("log:stash"); rest( ).get("").to("log:stash"); `, }, From 5fbe09dcd90a55a33bcac382de36b72eb847accc Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Wed, 26 Jul 2023 15:32:57 +0200 Subject: [PATCH 2/2] chore(doc): some dependency feature --- .../pages/configuration/dependencies.adoc | 22 +++++++++++++++++++ release.adoc | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/configuration/dependencies.adoc b/docs/modules/ROOT/pages/configuration/dependencies.adoc index 78861d15b2..5edff4a4ce 100644 --- a/docs/modules/ROOT/pages/configuration/dependencies.adoc +++ b/docs/modules/ROOT/pages/configuration/dependencies.adoc @@ -17,6 +17,28 @@ Automatic resolution is also a nice feature in xref:running/dev-mode.adoc[dev mo NOTE: Camel K won't be able to resolve automatically the dependencies when your routes specify dynamic URIs. +[[dependencies-from-import]] +== Import path dependencies + +While developing your route, you will start including references to Camel dependencies via Java (or any other DSL) import mechanism. Camel K is able to scan and detect such dependencies as well. Take the following example: + +```java +import org.apache.camel.builder.RouteBuilder; +... +import org.apache.camel.component.kafka.KafkaComponent; + +public class Test extends RouteBuilder { + + @Override + public void configure() throws Exception { + from("timer:java?period={{time:1000}}"). + ... + } +} + +``` +Camel K will be able to include `camel-kafka` dependency as it discover scanning the import paths. No need to specify it in such circumstances. + [[dependencies-explicit]] == Add explicit dependencies diff --git a/release.adoc b/release.adoc index 5440b7b14a..e7c9b2629d 100644 --- a/release.adoc +++ b/release.adoc @@ -265,6 +265,6 @@ git push upstream main ``` Where represents the new version you want to bump and the version that was previously released. -Note: this action should also replace automatically the oldest nightly release Github Action with the newest one just created. +NOTE: this action should also replace automatically the oldest nightly release Github Action with the newest one just created. You will also need to update the `docs/antora.yml` configuration in order to provide the proper versions for the upcoming release in `main` branch.