Skip to content

Commit

Permalink
Re-sync with main
Browse files Browse the repository at this point in the history
  • Loading branch information
essobedo committed Jul 7, 2023
2 parents a0d03f9 + 4f5c96c commit c7b0331
Show file tree
Hide file tree
Showing 27 changed files with 391 additions and 50 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/camel-master-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Fail if there are uncommitted changes
shell: bash
run: |
[[ -z $(git status --porcelain | grep -v antora.yml) ]] || { echo 'There are uncommitted changes'; git status; exit 1; }
[[ -z $(git status --porcelain | grep -v antora.yml) ]] || { echo 'There are uncommitted changes'; git status; git diff; exit 1; }
- name: Tar Maven Repo
shell: bash
run: |
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
- name: Fail if there are uncommitted changes
shell: bash
run: |
[[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; exit 1; }
[[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; git diff; exit 1; }
- name: Report Build Failure
if: failure() || cancelled()
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
- name: Fail if there are uncommitted changes
shell: bash
run: |
[[ -z $(git status --porcelain | grep -v antora.yml) ]] || { echo 'There are uncommitted changes'; git status; exit 1; }
[[ -z $(git status --porcelain | grep -v antora.yml) ]] || { echo 'There are uncommitted changes'; git status; git diff; exit 1; }
- name: Tar Maven Repo
shell: bash
run: |
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
- name: Fail if there are uncommitted changes
shell: bash
run: |
[[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; exit 1; }
[[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; git diff; exit 1; }
functional-extension-tests:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/quarkus-master-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Fail if there are uncommitted changes
shell: bash
run: |
[[ -z $(git status --porcelain | grep -v antora.yml) ]] || { echo 'There are uncommitted changes'; git status; exit 1; }
[[ -z $(git status --porcelain | grep -v antora.yml) ]] || { echo 'There are uncommitted changes'; git status; git diff; exit 1; }
- name: Tar Maven Repo
shell: bash
run: |
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
- name: Fail if there are uncommitted changes
shell: bash
run: |
[[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; exit 1; }
[[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; git diff; exit 1; }
- name: Report Build Failure
if: failure() || cancelled()
run: |
Expand Down
2 changes: 2 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Daether.remoteRepositoryFilter.groupId=true
-Daether.remoteRepositoryFilter.groupId.basedir=${session.rootDirectory}/.mvn/rrf/
6 changes: 6 additions & 0 deletions .mvn/rrf/groupId-atlassian.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
com.atlassian.event
com.atlassian.httpclient
com.atlassian.jira
com.atlassian.platform
com.atlassian.pom
com.atlassian.sal
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
**Closed issues:**

- Allow disabling periodic scan functionality [\#3078](https://github.com/apache/camel-quarkus/issues/3078)
- Surefire 3.0.0-M4 passing even if a build step throws an exception [\#723](https://github.com/apache/camel-quarkus/issues/723)

**Merged pull requests:**

- Set the official snapshot repositories [\#5062](https://github.com/apache/camel-quarkus/pull/5062) ([essobedo](https://github.com/essobedo))
- Improve native support of camel-quarkus-debug [\#5060](https://github.com/apache/camel-quarkus/pull/5060) ([essobedo](https://github.com/essobedo))
- Bump quarkus-micrometer-registry-jmx from 3.0.2 to 3.1.2 [\#5055](https://github.com/apache/camel-quarkus/pull/5055) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump quarkus-amazon-services-bom from 2.3.3 to 2.4.0 [\#5054](https://github.com/apache/camel-quarkus/pull/5054) ([dependabot[bot]](https://github.com/apps/dependabot))
- chore: fix various build/compilation warnings [\#5053](https://github.com/apache/camel-quarkus/pull/5053) ([lburgazzoli](https://github.com/lburgazzoli))
- Add sync tag for Groovy version property [\#5052](https://github.com/apache/camel-quarkus/pull/5052) ([jamesnetherton](https://github.com/jamesnetherton))
- Remove skip of maven-enforcer-plugin for Google extensions [\#5049](https://github.com/apache/camel-quarkus/pull/5049) ([jamesnetherton](https://github.com/jamesnetherton))
- Restore native profiles to kubernetes-client tests [\#5047](https://github.com/apache/camel-quarkus/pull/5047) ([jamesnetherton](https://github.com/jamesnetherton))
Expand Down
21 changes: 16 additions & 5 deletions docs/modules/ROOT/pages/reference/extensions/amqp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,25 @@ you must ensure that the `camel-quarkus-xml-jaxp` extension is present on the cl
When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be registered for serialization with `@RegisterForReflection(serialization = true)`.
Note that this extension automatically sets `quarkus.camel.native.reflection.serialization-enabled = true` for you. Refer to the xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.

[id="extensions-amqp-usage-connection-pooling"]
=== Connection Pooling

[id="extensions-amqp-camel-quarkus-limitations"]
== Camel Quarkus limitations
You can use the `quarkus-pooled-jms` extension to get pooling support for the connections. Refer to the https://quarkiverse.github.io/quarkiverse-docs/quarkus-pooled-jms/dev/index.html[quarkus-pooled-jms] extension documentation for more information.

[id="extensions-amqp-limitations-connection-pooling"]
=== Connection Pooling
Just add the following dependency to your `pom.xml`:
[source,xml]
----
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
</dependency>
----

JMS connection pooling isn't supported yet since there is still an open https://github.com/amqphub/quarkus-qpid-jms/issues/22[issue] with quarkus-qpid-jms.
To enable the pooling support, you need to add the following configuration to your `application.properties`:
[source,properties]
----
quarkus.qpid-jms.wrap=true
----


[id="extensions-amqp-transferexception-option-in-native-mode"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.ConcurrentSkipListSet;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
Expand All @@ -47,22 +49,24 @@ public class CamelSerializationProcessor {
Byte.class.getName(),
Character.class.getName(),
Collections.EMPTY_LIST.getClass().getName(),
ConcurrentSkipListMap.class.getName(),
ConcurrentSkipListSet.class.getName(),
Date.class.getName(),
Double.class.getName(),
Exception.class.getName(),
Float.class.getName(),
HashMap.class.getName(),
HashSet.class.getName(),
Integer.class.getName(),
LinkedHashMap.class.getName(),
LinkedHashSet.class.getName(),
Long.class.getName(),
Number.class.getName(),
RuntimeException.class.getName(),
StackTraceElement.class.getName(),
StackTraceElement[].class.getName(),
String.class.getName(),
Throwable.class.getName(),
HashSet.class.getName(),
LinkedHashSet.class.getName(),

// Camel classes
CamelExecutionException.class.getName(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.quarkus.support.language.runtime;

import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.annotations.Recorder;

@Recorder
public class LanguageSupportRecorder {

public RuntimeValue<Class<?>> loadClass(String name) throws ClassNotFoundException {
return new RuntimeValue<>(Class.forName(name, true, Thread.currentThread().getContextClassLoader()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.GeneratedNativeImageClassBuildItem;
import io.quarkus.deployment.builditem.GeneratedResourceBuildItem;
import io.quarkus.deployment.builditem.NativeImageFeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBundleBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
Expand Down Expand Up @@ -82,7 +83,8 @@ void resources(BuildProducer<NativeImageResourceBuildItem> resource) {
@BuildStep
void installTransformerFactory(
BuildProducer<GeneratedNativeImageClassBuildItem> nativeImageClass,
BuildProducer<GeneratedResourceBuildItem> generatedResources) {
BuildProducer<GeneratedResourceBuildItem> generatedResources,
BuildProducer<NativeImageFeatureBuildItem> nativeImageFeature) {

final String serviceProviderFileContent = XalanTransformerFactory.class.getName() + "\n";

Expand All @@ -98,14 +100,14 @@ void installTransformerFactory(
* or NativeImageResourceBuildItem will pick the service file preferred by us.
* We are thus forced to use this low level mechanism to ensure that.
*/
String xalanAutoFeatureClassName = getClass().getName() + "AutoFeature";
final ClassCreator file = new ClassCreator(new ClassOutput() {
@Override
public void write(String s, byte[] bytes) {
nativeImageClass.produce(new GeneratedNativeImageClassBuildItem(s, bytes));
}
}, getClass().getName() + "AutoFeature", null,
}, xalanAutoFeatureClassName, null,
Object.class.getName(), Feature.class.getName());
file.addAnnotation("com.oracle.svm.core.annotate.AutomaticFeature");
final MethodCreator beforeAn = file.getMethodCreator("beforeAnalysis", "V",
Feature.BeforeAnalysisAccess.class.getName());
final TryBlock overallCatch = beforeAn.tryBlock();
Expand All @@ -121,6 +123,7 @@ public void write(String s, byte[] bytes) {
beforeAn.returnValue(null);
file.close();

nativeImageFeature.produce(new NativeImageFeatureBuildItem(xalanAutoFeatureClassName));
}

}
3 changes: 0 additions & 3 deletions extensions/amqp/runtime/src/main/doc/limitations.adoc

This file was deleted.

19 changes: 19 additions & 0 deletions extensions/amqp/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,22 @@ you must ensure that the `camel-quarkus-xml-jaxp` extension is present on the cl

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be registered for serialization with `@RegisterForReflection(serialization = true)`.
Note that this extension automatically sets `quarkus.camel.native.reflection.serialization-enabled = true` for you. Refer to the xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.

=== Connection Pooling

You can use the `quarkus-pooled-jms` extension to get pooling support for the connections. Refer to the https://quarkiverse.github.io/quarkiverse-docs/quarkus-pooled-jms/dev/index.html[quarkus-pooled-jms] extension documentation for more information.

Just add the following dependency to your `pom.xml`:
[source,xml]
----
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
</dependency>
----

To enable the pooling support, you need to add the following configuration to your `application.properties`:
[source,properties]
----
quarkus.qpid-jms.wrap=true
----
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem;
import io.quarkus.deployment.pkg.steps.NativeBuild;
import io.quarkus.deployment.recording.RecorderContext;
import io.quarkus.maven.dependency.ResolvedDependency;
import io.quarkus.paths.PathCollection;
import io.quarkus.runtime.RuntimeValue;
Expand All @@ -42,6 +41,7 @@
import org.apache.camel.quarkus.support.language.deployment.ExpressionExtractionResultBuildItem;
import org.apache.camel.quarkus.support.language.deployment.ScriptBuildItem;
import org.apache.camel.quarkus.support.language.runtime.ExpressionUID;
import org.apache.camel.quarkus.support.language.runtime.LanguageSupportRecorder;
import org.apache.camel.quarkus.support.language.runtime.ScriptUID;
import org.codehaus.groovy.control.CompilationUnit;
import org.codehaus.groovy.control.CompilerConfiguration;
Expand Down Expand Up @@ -145,14 +145,11 @@ void compileScriptsAOT(CurateOutcomeBuildItem curateOutcomeBuildItem,
}
}

// We still need to use RecorderContext#classProxy as using i.e. Class.forName does not work
// at runtime. See https://github.com/apache/camel-quarkus/issues/5056
@SuppressWarnings("deprecation")
@Record(ExecutionTime.STATIC_INIT)
@BuildStep(onlyIf = NativeBuild.class)
CamelBeanBuildItem configureLanguage(
RecorderContext recorderContext,
GroovyExpressionRecorder recorder,
LanguageSupportRecorder languageRecorder,
ExpressionExtractionResultBuildItem result,
List<GroovyExpressionSourceBuildItem> sources) throws ClassNotFoundException {

Expand All @@ -162,7 +159,7 @@ CamelBeanBuildItem configureLanguage(
recorder.addScript(
builder,
source.getOriginalCode(),
recorderContext.classProxy(source.getClassName()));
languageRecorder.loadClass(source.getClassName()));
}
final RuntimeValue<GroovyLanguage> language = recorder.languageNewInstance(builder);
return new CamelBeanBuildItem("groovy", GroovyLanguage.class.getName(), language);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public RuntimeValue<GroovyLanguage.Builder> languageBuilder() {
}

@SuppressWarnings("unchecked")
public void addScript(RuntimeValue<GroovyLanguage.Builder> builder, String content, Class<?> clazz) {
public void addScript(RuntimeValue<GroovyLanguage.Builder> builder, String content, RuntimeValue<Class<?>> clazz) {
try {
builder.getValue().addScript(content, (Class<Script>) clazz);
builder.getValue().addScript(content, (Class<Script>) clazz.getValue());
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import io.quarkus.deployment.builditem.GeneratedClassBuildItem;
import io.quarkus.deployment.pkg.PackageConfig;
import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem;
import io.quarkus.deployment.recording.RecorderContext;
import io.quarkus.maven.dependency.ResolvedDependency;
import io.quarkus.paths.PathCollection;
import io.quarkus.runtime.RuntimeValue;
Expand All @@ -54,6 +53,7 @@
import org.apache.camel.quarkus.support.language.deployment.ExpressionExtractionResultBuildItem;
import org.apache.camel.quarkus.support.language.deployment.ScriptBuildItem;
import org.apache.camel.quarkus.support.language.runtime.ExpressionUID;
import org.apache.camel.quarkus.support.language.runtime.LanguageSupportRecorder;
import org.apache.camel.quarkus.support.language.runtime.ScriptUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -152,16 +152,13 @@ void compileExpressions(
}
}

// We still need to use RecorderContext#classProxy as using i.e. Class.forName does not work
// at runtime. See https://github.com/apache/camel-quarkus/issues/5056
@SuppressWarnings("deprecation")
@Record(ExecutionTime.STATIC_INIT)
@BuildStep(onlyIf = CompileAtBuildTime.class)
@Consume(CamelContextBuildItem.class)
CamelBeanBuildItem configureLanguage(
RecorderContext recorderContext,
JoorExpressionConfig config,
JoorExpressionRecorder recorder,
LanguageSupportRecorder languageRecorder,
CamelContextBuildItem context,
ExpressionExtractionResultBuildItem result,
List<JoorExpressionSourceBuildItem> sources) throws ClassNotFoundException {
Expand All @@ -179,13 +176,13 @@ CamelBeanBuildItem configureLanguage(
expressionScriptingCompilerBuilder,
camelContext,
source.getId(),
recorderContext.classProxy(source.getClassName()));
languageRecorder.loadClass(source.getClassName()));
} else {
recorder.addExpression(
expressionCompilerBuilder,
camelContext,
source.getId(),
recorderContext.classProxy(source.getClassName()));
languageRecorder.loadClass(source.getClassName()));
}
}
final RuntimeValue<JoorLanguage> language = recorder.languageNewInstance(config, expressionCompilerBuilder,
Expand All @@ -194,7 +191,7 @@ CamelBeanBuildItem configureLanguage(
if (config.resultType.isPresent()) {
recorder.setResultType(
language,
recorderContext.classProxy(config.resultType.get()));
languageRecorder.loadClass(config.resultType.get()));
}

return new CamelBeanBuildItem("joor", JoorLanguage.class.getName(), language);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public RuntimeValue<JoorLanguage> languageNewInstance(JoorExpressionConfig confi
return language;
}

public void setResultType(RuntimeValue<JoorLanguage> language, Class<?> resultType) {
language.getValue().setResultType(resultType);
public void setResultType(RuntimeValue<JoorLanguage> language, RuntimeValue<Class<?>> resultType) {
language.getValue().setResultType(resultType.getValue());
}

public RuntimeValue<JoorExpressionCompiler.Builder> expressionCompilerBuilder() {
Expand All @@ -49,21 +49,20 @@ public RuntimeValue<JoorExpressionScriptingCompiler.Builder> expressionScripting
}

public void addExpression(RuntimeValue<JoorExpressionCompiler.Builder> builder, RuntimeValue<CamelContext> ctx, String id,
Class<?> clazz) {
RuntimeValue<Class<?>> clazz) {
try {
builder.getValue().addExpression(id,
(JoorMethod) clazz.getConstructor(CamelContext.class).newInstance(ctx.getValue()));
(JoorMethod) clazz.getValue().getConstructor(CamelContext.class).newInstance(ctx.getValue()));
} catch (Exception e) {
throw new RuntimeException(e);
}
}

public void addScript(RuntimeValue<JoorExpressionScriptingCompiler.Builder> builder, RuntimeValue<CamelContext> ctx,
String id,
Class<?> clazz) {
String id, RuntimeValue<Class<?>> clazz) {
try {
builder.getValue().addScript(id,
(JoorScriptingMethod) clazz.getConstructor(CamelContext.class).newInstance(ctx.getValue()));
(JoorScriptingMethod) clazz.getValue().getConstructor(CamelContext.class).newInstance(ctx.getValue()));
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down
Loading

0 comments on commit c7b0331

Please sign in to comment.