Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge camel-quarkus-main into camel-quarkus-core #2358 #2371

Merged
merged 8 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ '8' , '11', '15' ]
java: [ '11', '15' ]
env:
MAVEN_OPTS: -Xmx3000m
steps:
Expand Down Expand Up @@ -328,7 +328,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ '8' , '11', '15' ]
java: [ '11', '15' ]
steps:
- name: Setup apache-snapshots profile
if: github.ref == 'refs/heads/camel-master' || github.base_ref == 'camel-master'
Expand Down
26 changes: 26 additions & 0 deletions catalog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-groovy-dsl</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-grpc</artifactId>
Expand Down Expand Up @@ -2218,6 +2231,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kotlin-dsl</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kubernetes</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
*** xref:reference/extensions/graphql.adoc[GraphQL]
*** xref:reference/extensions/grok.adoc[Grok]
*** xref:reference/extensions/groovy.adoc[Groovy]
*** xref:reference/extensions/groovy-dsl.adoc[Groovy DSL]
*** xref:reference/extensions/gson.adoc[Gson]
*** xref:reference/extensions/guava-eventbus.adoc[Guava EventBus]
*** xref:reference/extensions/hbase.adoc[HBase]
Expand Down Expand Up @@ -179,6 +180,7 @@
*** xref:reference/extensions/kafka.adoc[Kafka]
*** xref:reference/extensions/kamelet.adoc[Kamelet]
*** xref:reference/extensions/kotlin.adoc[Kotlin]
*** xref:reference/extensions/kotlin-dsl.adoc[Kotlin DSL]
*** xref:reference/extensions/kubernetes.adoc[Kubernetes]
*** xref:reference/extensions/kudu.adoc[Kudu]
*** xref:reference/extensions/ldap.adoc[LDAP]
Expand Down
18 changes: 18 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,24 @@ A comma separated list of Ant-path style patterns to match class names that shou
What to do if it is not possible to extract CSimple expressions from a route definition at build time.
| `org.apache.camel.quarkus.core.CamelConfig.FailureRemedy`
| `warn`

|icon:lock[title=Fixed at build time] [[quarkus.camel.main.enabled]]`link:#quarkus.camel.main.enabled[quarkus.camel.main.enabled]`

If `true` all `camel-main` features are enabled; otherwise no `camel-main` features are enabled. See described the link:https://camel.apache.org/camel-quarkus/latest/user-guide/bootstrap.html#_camel_main[Bootstrap] section of Camel Quarkus documentation for more details.
| `boolean`
| `true`

|icon:lock[title=Fixed at build time] [[quarkus.camel.main.shutdown.timeout]]`link:#quarkus.camel.main.shutdown.timeout[quarkus.camel.main.shutdown.timeout]`

A timeout (with millisecond precision) to wait for `CamelMain++#++stop()` to finish
| `java.time.Duration`
| `PT3S`

|icon:lock[title=Fixed at build time] [[quarkus.camel.main.arguments.on-unknown]]`link:#quarkus.camel.main.arguments.on-unknown[quarkus.camel.main.arguments.on-unknown]`

The action to take when `CamelMain` encounters an unknown argument. fail - Prints the `CamelMain` usage statement and throws a `RuntimeException` ignore - Suppresses any warnings and the application startup proceeds as normal warn - Prints the `CamelMain` usage statement but allows the application startup to proceed as normal
| `org.apache.camel.quarkus.core.CamelConfig.FailureRemedy`
| `warn`
|===

[.configuration-legend]
Expand Down
27 changes: 27 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/groovy-dsl.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
= Groovy DSL
:cq-artifact-id: camel-quarkus-groovy-dsl
:cq-native-supported: false
:cq-status: Preview
:cq-description: Support for parsing Groovy route definitions at runtime
:cq-deprecated: false
:cq-jvm-since: 1.8.0
:cq-native-since: n/a

[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.8.0## [.badge-key]##Native##[.badge-unsupported]##unsupported##

Support for parsing Groovy route definitions at runtime

== Maven coordinates

[source,xml]
----
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-groovy-dsl</artifactId>
</dependency>
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
= Java jOOR DSL
:cq-artifact-id: camel-quarkus-java-joor-dsl
:cq-native-supported: true
:cq-status: Stable
:cq-native-supported: false
:cq-status: Preview
:cq-description: Support for parsing Java route definitions at runtime
:cq-deprecated: false
:cq-jvm-since: 1.8.0
:cq-native-since: 1.8.0
:cq-native-since: n/a

[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.8.0## [.badge-key]##Native since##[.badge-supported]##1.8.0##
[.badge-key]##JVM since##[.badge-supported]##1.8.0## [.badge-key]##Native##[.badge-unsupported]##unsupported##

Support for parsing Java route definitions at runtime

Expand Down
27 changes: 27 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/kotlin-dsl.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
= Kotlin DSL
:cq-artifact-id: camel-quarkus-kotlin-dsl
:cq-native-supported: false
:cq-status: Preview
:cq-description: Support for parsing Kotlin route definitions at runtime
:cq-deprecated: false
:cq-jvm-since: 1.8.0
:cq-native-since: n/a

[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.8.0## [.badge-key]##Native##[.badge-unsupported]##unsupported##

Support for parsing Kotlin route definitions at runtime

== Maven coordinates

[source,xml]
----
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-kotlin-dsl</artifactId>
</dependency>
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
24 changes: 0 additions & 24 deletions docs/modules/ROOT/pages/reference/extensions/main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,3 @@ Bootstrap Camel using Camel Main which brings advanced auto-configuration capabi
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Additional Camel Quarkus configuration

[width="100%",cols="80,5,15",options="header"]
|===
| Configuration property | Type | Default


|icon:lock[title=Fixed at build time] [[quarkus.camel.main.shutdown.timeout]]`link:#quarkus.camel.main.shutdown.timeout[quarkus.camel.main.shutdown.timeout]`

A timeout (with millisecond precision) to wait for `CamelMain++#++stop()` to finish
| `java.time.Duration`
| `PT3S`

|icon:lock[title=Fixed at build time] [[quarkus.camel.main.arguments.on-unknown]]`link:#quarkus.camel.main.arguments.on-unknown[quarkus.camel.main.arguments.on-unknown]`

The action to take when `CamelMain` encounters an unknown argument. fail - Prints the `CamelMain` usage statement and throws a `RuntimeException` ignore - Suppresses any warnings and the application startup proceeds as normal warn - Prints the `CamelMain` usage statement but allows the application startup to proceed as normal
| `org.apache.camel.quarkus.core.CamelConfig.FailureRemedy`
| `warn`
|===

[.configuration-legend]
icon:lock[title=Fixed at build time] Configuration property fixed at build time. All other configuration properties are overridable at runtime.

4 changes: 4 additions & 0 deletions extensions-core/caffeine-lrucache/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-caffeine-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>

<dependency>
<groupId>org.apache.camel.quarkus</groupId>
Expand Down
5 changes: 5 additions & 0 deletions extensions-core/caffeine-lrucache/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-caffeine</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>


<dependency>
<groupId>org.apache.camel</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Consume;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Overridable;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.runtime.RuntimeValue;
import org.apache.camel.CamelContext;
import org.apache.camel.quarkus.core.CamelConfig;
import org.apache.camel.quarkus.core.CamelContextRecorder;
import org.apache.camel.quarkus.core.CamelRuntime;
import org.apache.camel.quarkus.core.deployment.main.spi.CamelMainEnabled;
import org.apache.camel.quarkus.core.deployment.spi.CamelContextBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelContextCustomizerBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelFactoryFinderResolverBuildItem;
Expand Down Expand Up @@ -121,8 +121,7 @@ CamelContextBuildItem context(
* @param config a reference to the Camel Quarkus configuration
* @return a build item holding a {@link CamelRuntime} instance.
*/
@Overridable
@BuildStep
@BuildStep(onlyIfNot = CamelMainEnabled.class)
@Record(value = ExecutionTime.RUNTIME_INIT, optional = true)
/* @Consume(SyntheticBeansRuntimeInitBuildItem.class) makes sure that camel-main starts after the ArC container is
* fully initialized. This is required as under the hoods the camel registry may look-up beans form the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.main.deployment;
package org.apache.camel.quarkus.core.deployment.main;

import java.util.stream.Stream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.main.deployment;
package org.apache.camel.quarkus.core.deployment.main;

import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -24,14 +24,15 @@

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
import org.apache.camel.quarkus.core.deployment.main.spi.CamelMainEnabled;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class CamelMainHotDeploymentProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(CamelMainHotDeploymentProcessor.class);
private static final String FILE_PREFIX = "file:";

@BuildStep
@BuildStep(onlyIf = CamelMainEnabled.class)
List<HotDeploymentWatchedFileBuildItem> locations() {
List<HotDeploymentWatchedFileBuildItem> items = CamelMainHelper.routesIncludePatter()
.filter(location -> location.startsWith(FILE_PREFIX))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.quarkus.main.deployment;
package org.apache.camel.quarkus.core.deployment.main;

import java.util.stream.Collectors;
import java.util.stream.Stream;

import io.quarkus.deployment.Capabilities;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import org.apache.camel.quarkus.core.deployment.main.spi.CamelMainEnabled;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.util.AntPathMatcher;
import org.jboss.logging.Logger;

public class CamelMainNativeImageProcessor {
private static final Logger LOG = Logger.getLogger(CamelMainNativeImageProcessor.class);

@BuildStep
@BuildStep(onlyIf = CamelMainEnabled.class)
ReflectiveClassBuildItem reflectiveCLasses() {
// TODO: The classes below are needed to fix https://github.com/apache/camel-quarkus/issues/1005
// but we need to investigate why it does not fail with Java 1.8
Expand All @@ -44,7 +46,7 @@ ReflectiveClassBuildItem reflectiveCLasses() {
org.apache.camel.quarkus.main.CamelMainApplication.class);
}

@BuildStep
@BuildStep(onlyIf = CamelMainEnabled.class)
private void camelNativeImageResources(
Capabilities capabilities,
BuildProducer<NativeImageResourceBuildItem> nativeResource) {
Expand All @@ -65,5 +67,10 @@ private void camelNativeImageResources(
}
}
}

String[] resources = Stream.of("components", "dataformats", "languages")
.map(k -> "org/apache/camel/main/" + k + ".properties")
.toArray(String[]::new);
nativeResource.produce(new NativeImageResourceBuildItem(resources));
}
}