You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2020/06/25 15:11:41 UTC
[camel-quarkus] branch master updated (ef23e49 -> 39c2d24)
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git.
from ef23e49 Rename camel-quarkus-package-maven-plugin to camel-quarkus-maven-plugin #1395
new 15cbddf Ensure CamelContextAware beans have CamelContext set when bound to the registry
new c0af51e Remove NettyHttpComponent producer method from RestOpenapiResource
new 39c2d24 Regen docs
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../pages/list-of-camel-quarkus-extensions.adoc | 4 ++--
.../core/deployment/CamelRegistryProcessor.java | 25 ++++++++++++++--------
.../apache/camel/quarkus/core/CoreResource.java | 13 ++++++++++-
.../org/apache/camel/quarkus/core/CoreTest.java | 5 +++++
.../rest/openapi/it/RestOpenapiResource.java | 12 -----------
5 files changed, 35 insertions(+), 24 deletions(-)
[camel-quarkus] 02/03: Remove NettyHttpComponent producer method
from RestOpenapiResource
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit c0af51edcbb4b23a467c2c1238b2eeffd3bd6808
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Jun 25 13:49:54 2020 +0100
Remove NettyHttpComponent producer method from RestOpenapiResource
Fixes #1237
---
.../component/rest/openapi/it/RestOpenapiResource.java | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/integration-tests/rest-openapi/src/main/java/org/apache/camel/quarkus/component/rest/openapi/it/RestOpenapiResource.java b/integration-tests/rest-openapi/src/main/java/org/apache/camel/quarkus/component/rest/openapi/it/RestOpenapiResource.java
index 11f5727..ad7d348 100644
--- a/integration-tests/rest-openapi/src/main/java/org/apache/camel/quarkus/component/rest/openapi/it/RestOpenapiResource.java
+++ b/integration-tests/rest-openapi/src/main/java/org/apache/camel/quarkus/component/rest/openapi/it/RestOpenapiResource.java
@@ -17,7 +17,6 @@
package org.apache.camel.quarkus.component.rest.openapi.it;
import javax.inject.Inject;
-import javax.inject.Named;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@@ -25,9 +24,7 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
-import org.apache.camel.component.netty.http.NettyHttpComponent;
@Path("/rest-openapi")
public class RestOpenapiResource {
@@ -41,13 +38,4 @@ public class RestOpenapiResource {
String response = producerTemplate.requestBodyAndHeader("direct:start", null, "test-port", port, String.class);
return Response.ok().entity(response).build();
}
-
- // TODO: Remove this for Camel 3.4.0. See https://issues.apache.org/jira/browse/CAMEL-15076
- @javax.enterprise.inject.Produces
- @Named("netty-http")
- public NettyHttpComponent createNettyHttpComponent(CamelContext context) {
- NettyHttpComponent nettyHttpComponent = new NettyHttpComponent();
- nettyHttpComponent.setCamelContext(context);
- return nettyHttpComponent;
- }
}
[camel-quarkus] 01/03: Ensure CamelContextAware beans have
CamelContext set when bound to the registry
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 15cbddf9a9720a490b6caed64be7362a7b16babc
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Jun 25 13:49:17 2020 +0100
Ensure CamelContextAware beans have CamelContext set when bound to the registry
---
.../core/deployment/CamelRegistryProcessor.java | 25 ++++++++++++++--------
.../apache/camel/quarkus/core/CoreResource.java | 13 ++++++++++-
.../org/apache/camel/quarkus/core/CoreTest.java | 5 +++++
3 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRegistryProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRegistryProcessor.java
index 22ceeac..8ffbd52 100644
--- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRegistryProcessor.java
+++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRegistryProcessor.java
@@ -23,10 +23,10 @@ import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.ApplicationArchivesBuildItem;
import io.quarkus.deployment.recording.RecorderContext;
-import io.quarkus.runtime.RuntimeValue;
import org.apache.camel.quarkus.core.CamelConfig;
import org.apache.camel.quarkus.core.CamelRecorder;
import org.apache.camel.quarkus.core.deployment.spi.CamelBeanBuildItem;
+import org.apache.camel.quarkus.core.deployment.spi.CamelContextBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelRegistryBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelRuntimeBeanBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelRuntimeTaskBuildItem;
@@ -36,7 +36,6 @@ import org.apache.camel.quarkus.core.deployment.spi.CamelServicePatternBuildItem
import org.apache.camel.quarkus.core.deployment.spi.ContainerBeansBuildItem;
import org.apache.camel.quarkus.core.deployment.util.CamelSupport;
import org.apache.camel.quarkus.core.deployment.util.PathFilter;
-import org.apache.camel.spi.Registry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,18 +44,25 @@ public class CamelRegistryProcessor {
@Record(ExecutionTime.STATIC_INIT)
@BuildStep
- CamelRegistryBuildItem registry(
+ CamelRegistryBuildItem registry(CamelRecorder recorder) {
+ return new CamelRegistryBuildItem(recorder.createRegistry());
+ }
+
+ @Record(ExecutionTime.STATIC_INIT)
+ @BuildStep
+ public void bindBeansToRegistry(
CamelRecorder recorder,
RecorderContext recorderContext,
CamelConfig camelConfig,
ApplicationArchivesBuildItem applicationArchives,
ContainerBeansBuildItem containerBeans,
+ CamelRegistryBuildItem registry,
+ // CamelContextBuildItem placeholder ensures this build step runs after the CamelContext is created
+ CamelContextBuildItem camelContextBuildItem,
List<CamelBeanBuildItem> registryItems,
List<CamelServiceFilterBuildItem> serviceFilters,
List<CamelServicePatternBuildItem> servicePatterns) {
- final RuntimeValue<Registry> registry = recorder.createRegistry();
-
final PathFilter pathFilter = servicePatterns.stream()
.filter(patterns -> patterns.getDestination() == CamelServiceDestination.REGISTRY)
.collect(
@@ -87,7 +93,7 @@ public class CamelRegistryProcessor {
LOGGER.debug("Binding bean with name: {}, type {}", si.name, si.type);
recorder.bind(
- registry,
+ registry.getRegistry(),
si.name,
recorderContext.classProxy(si.type));
});
@@ -98,7 +104,7 @@ public class CamelRegistryProcessor {
LOGGER.debug("Binding bean with name: {}, type {}", item.getName(), item.getType());
if (item.getValue().isPresent()) {
recorder.bind(
- registry,
+ registry.getRegistry(),
item.getName(),
recorderContext.classProxy(item.getType()),
item.getValue().get());
@@ -106,13 +112,12 @@ public class CamelRegistryProcessor {
// the instance of the service will be instantiated by the recorder, this avoid
// creating a recorder for trivial services.
recorder.bind(
- registry,
+ registry.getRegistry(),
item.getName(),
recorderContext.classProxy(item.getType()));
}
});
- return new CamelRegistryBuildItem(registry);
}
@Record(ExecutionTime.RUNTIME_INIT)
@@ -122,6 +127,8 @@ public class CamelRegistryProcessor {
RecorderContext recorderContext,
ContainerBeansBuildItem containerBeans,
CamelRegistryBuildItem registry,
+ // CamelContextBuildItem placeholder ensures this build step runs after the CamelContext is created
+ CamelContextBuildItem camelContextBuildItem,
List<CamelRuntimeBeanBuildItem> registryItems) {
registryItems.stream()
diff --git a/integration-tests/core/src/main/java/org/apache/camel/quarkus/core/CoreResource.java b/integration-tests/core/src/main/java/org/apache/camel/quarkus/core/CoreResource.java
index 0dbb16e..21e5e80 100644
--- a/integration-tests/core/src/main/java/org/apache/camel/quarkus/core/CoreResource.java
+++ b/integration-tests/core/src/main/java/org/apache/camel/quarkus/core/CoreResource.java
@@ -22,6 +22,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
+import java.util.stream.Collectors;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
@@ -35,6 +36,7 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.NoSuchLanguageException;
import org.apache.camel.catalog.RuntimeCamelCatalog;
@@ -82,6 +84,16 @@ public class CoreResource {
return registry.findByType(CamelContext.class).size() == 1;
}
+ @Path("/registry/camel-context-aware/initialized")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public boolean camelContextAwareBeansHaveContextSet() {
+ return registry.findByType(CamelContextAware.class).stream()
+ .filter(camelContextAware -> camelContextAware.getCamelContext() == null)
+ .collect(Collectors.toList())
+ .isEmpty();
+ }
+
@Path("/context/version")
@GET
@Produces(MediaType.TEXT_PLAIN)
@@ -211,5 +223,4 @@ public class CoreResource {
return Response.serverError().entity(e.getClass().getName() + ": " + e.getMessage()).build();
}
}
-
}
diff --git a/integration-tests/core/src/test/java/org/apache/camel/quarkus/core/CoreTest.java b/integration-tests/core/src/test/java/org/apache/camel/quarkus/core/CoreTest.java
index b460c29..42db9c8 100644
--- a/integration-tests/core/src/test/java/org/apache/camel/quarkus/core/CoreTest.java
+++ b/integration-tests/core/src/test/java/org/apache/camel/quarkus/core/CoreTest.java
@@ -40,6 +40,11 @@ public class CoreTest {
}
@Test
+ public void testCamelContextAwareRegistryBeansInitialized() {
+ RestAssured.when().get("/test/registry/camel-context-aware/initialized").then().body(is("true"));
+ }
+
+ @Test
public void testCamelBeanBuildItem() {
Response response = RestAssured.get("/test/registry/log/exchange-formatter").andReturn();
[camel-quarkus] 03/03: Regen docs
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 39c2d2476044c3765ce038207d63185122791afd
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Jun 25 13:50:50 2020 +0100
Regen docs
---
docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
index 4f70644..13f45dc 100644
--- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
+++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
@@ -18,7 +18,7 @@ In case you are missing some Camel feature in the list:
== Camel Components
// components: START
-Number of Camel components: 151 in 116 JAR artifacts (0 deprecated)
+Number of Camel components: 152 in 117 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,1,1,5",options="header"]
|===
@@ -445,7 +445,7 @@ Number of miscellaneous extensions: 16 in 16 JAR artifacts (1 deprecated)
| xref:extensions/core-cloud.adoc[Cloud] | camel-quarkus-core-cloud | Native + Stable | 0.2.0 | The Camel Quarkus core cloud module
-| xref:extensions/componentdsl.adoc[Component DSL] | camel-quarkus-componentdsl | Native + Stable | 1.0.0-M3 | Create Camel components with a fluent Java DSL
+| xref:extensions/componentdsl.adoc[Component DSL] | camel-quarkus-componentdsl | Native + Stable | 1.0.0-CR3 | Create Camel components with a fluent Java DSL
| xref:extensions/endpointdsl.adoc[Endpoint DSL] | camel-quarkus-endpointdsl | Native + Stable | 1.0.0-M3 | Code Camel endpoint URI using Java DSL instead of plain strings