This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch camel-master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 40336441a7aa4ce3971a67ecdd05c93bdf14a5aa Author: Guillaume Nodet <[email protected]> AuthorDate: Fri Apr 3 14:19:53 2020 +0200 Upgrade to Camel 3.2.0-SNAPSHOT --- .../pages/list-of-camel-quarkus-extensions.adoc | 78 ++++++++------------ .../quarkus/core/deployment/BuildProcessor.java | 6 ++ extensions-jvm/avro-rpc/deployment/pom.xml | 75 +++++++++++++++++++ .../component/avro/deployment/AvroProcessor.java | 58 +++++++++++++++ extensions-jvm/avro-rpc/integration-test/pom.xml | 82 +++++++++++++++++++++ .../quarkus/component/avro/it/AvroResource.java | 15 +--- .../camel/quarkus/component/avro/it/AvroTest.java | 8 --- extensions-jvm/avro-rpc/pom.xml | 40 +++++++++++ extensions-jvm/avro-rpc/runtime/pom.xml | 83 ++++++++++++++++++++++ .../camel/quarkus/component/avro/AvroRecorder.java | 14 ++++ .../main/resources/META-INF/quarkus-extension.yaml | 29 ++++++++ .../quarkus/component/avro/it/AvroResource.java | 15 +--- .../camel/quarkus/component/avro/it/AvroTest.java | 8 --- extensions-jvm/pom.xml | 1 + poms/bom/pom.xml | 55 ++++++++++++++ 15 files changed, 473 insertions(+), 94 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 4dd34d5..f80a63f 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: 147 in 112 JAR artifacts (0 deprecated) +Number of Camel components: 143 in 108 JAR artifacts (0 deprecated) [width="100%",cols="4,1,1,5",options="header"] |=== @@ -41,7 +41,7 @@ Level | Since | Description `amqp:destinationType:destinationName` | Native + Stable | 1.0.0-M6 | Messaging with AMQP protocol using Apache QPid Client. -| link:https://camel.apache.org/components/latest/avro-component.html[Avro] (camel-quarkus-avro) + +| link:https://camel.apache.org/components/latest/avro-component.html[Avro] (camel-quarkus-avro-rpc) + `avro:transport:host:port/messageName` | JVM + Preview | 1.0.0-M6 | Working with Apache Avro for data serialization. @@ -205,10 +205,6 @@ Level | Since | Description `couchdb:protocol:hostname:port/database` | Native + Stable | 1.0.0-M6 | The couchdb component is used for integrate with CouchDB databases. -| link:https://camel.apache.org/components/latest/cron-component.html[Cron] (camel-quarkus-cron) + -`cron:name` | Native + - Stable | 1.0.0-M6 | Camel Cron Component - | link:https://camel.apache.org/components/latest/dataformat-component.html[Data Format] (camel-quarkus-dataformat) + `dataformat:name:operation` | Native + Stable | 0.4.0 | The dataformat component is used for working with Data Formats as if it was a regular Component supporting Endpoints and URIs. @@ -249,10 +245,6 @@ Level | Since | Description `fhir:apiName/methodName` | Native + Stable | 0.3.0 | The fhir component is used for working with the FHIR protocol (health care). -| link:https://camel.apache.org/components/latest/file-component.html[File] (camel-quarkus-file) + -`file:directoryName` | Native + - Stable | 0.4.0 | The file component is used for reading or writing files. - | xref:extensions/file-watch.adoc[File Watch] (camel-quarkus-file-watch) + `file-watch:path` | Native + Stable | 1.0.0-M5 | The file-watch is used to monitor file events in directory using java.nio.file.WatchService @@ -299,7 +291,7 @@ Level | Since | Description | link:https://camel.apache.org/components/latest/google-pubsub-component.html[Google Pubsub] (camel-quarkus-google-pubsub) + `google-pubsub:projectId:destinationName` | JVM + - Preview | 1.0.0-M6 | Messaging client for Google Cloud Platform PubSub Service + Preview | 1.0.0-M6 | Messaging client for Google Cloud Platform PubSub Service Built on top of the Google Cloud Pub/Sub libraries. | link:https://camel.apache.org/components/latest/google-sheets-component.html[Google Sheets] (camel-quarkus-google-sheets) + `google-sheets:apiName/methodName` | Native + @@ -317,10 +309,6 @@ Level | Since | Description `grpc:host:port/service` | JVM + Preview | 1.0.0-M6 | The gRPC component allows to call and expose remote procedures via HTTP/2 with protobuf dataformat -| xref:extensions/http.adoc[HTTP] (camel-quarkus-http) + -`http:httpUri` | Native + - Stable | 1.0.0-M3 | For calling out to external HTTP servers using Apache HTTP Client 4.x. - | link:https://camel.apache.org/components/latest/infinispan-component.html[Infinispan] (camel-quarkus-infinispan) + `infinispan:cacheName` | Native + Stable | 0.2.0 | For reading/writing from/to Infinispan distributed key/value store and data grid. @@ -545,10 +533,6 @@ Level | Since | Description `servicenow:instanceName` | Native + Stable | 1.0.0-M6 | The servicenow component is used to integrate Camel with ServiceNow cloud services. -| link:https://camel.apache.org/components/latest/servlet-component.html[Servlet] (camel-quarkus-servlet) + -`servlet:contextPath` | Native + - Stable | 0.2.0 | To use a HTTP Servlet as entry for Camel routes when running in a servlet container. - | link:https://camel.apache.org/components/latest/sftp-component.html[SFTP] (camel-quarkus-ftp) + `sftp:host:port/directoryName` | Native + Stable | 1.0.0-M1 | The sftp (FTP over SSH) component is used for uploading or downloading files from SFTP servers. @@ -619,7 +603,7 @@ Level | Since | Description == Camel Data Formats // dataformats: START -Number of Camel data formats: 26 in 21 JAR artifacts (0 deprecated) +Number of Camel data formats: 24 in 19 JAR artifacts (0 deprecated) [width="100%",cols="4,1,1,5",options="header"] |=== @@ -659,15 +643,9 @@ Level | Since | Description | link:https://camel.apache.org/components/latest/jacksonxml-dataformat.html[JacksonXML] (camel-quarkus-jacksonxml) | Native + Stable | 1.0.0-M5 | JacksonXML data format is used for unmarshal a XML payload to POJO or to marshal POJO back to XML payload. -| link:https://camel.apache.org/components/latest/jaxb-dataformat.html[JAXB] (camel-quarkus-jaxb) | Native + - Stable | 1.0.0-M5 | JAXB data format uses the JAXB2 XML marshalling standard to unmarshal an XML payload into Java objects or to marshal Java objects into an XML payload. - | link:https://camel.apache.org/components/latest/json-gson-dataformat.html[JSon GSon] (camel-quarkus-gson) | Native + Stable | 1.0.0-M4 | JSon data format is used for unmarshal a JSon payload to POJO or to marshal POJO back to JSon payload. -| link:https://camel.apache.org/components/latest/json-jackson-dataformat.html[JSon Jackson] (camel-quarkus-jackson) | Native + - Stable | 0.3.0 | JSon data format is used for unmarshal a JSon payload to POJO or to marshal POJO back to JSon payload. - | link:https://camel.apache.org/components/latest/json-johnzon-dataformat.html[JSon Johnzon] (camel-quarkus-johnzon) | Native + Stable | 1.0.0-M5 | JSon data format is used for unmarshal a JSon payload to POJO or to marshal POJO back to JSon payload. @@ -709,7 +687,7 @@ Level | Since | Description == Camel Languages // languages: START -Number of Camel languages: 13 in 7 JAR artifacts (0 deprecated) +Number of Camel languages: 6 in 6 JAR artifacts (0 deprecated) [width="100%",cols="4,1,1,5",options="header"] |=== @@ -719,36 +697,15 @@ Level | Since | Description | link:https://camel.apache.org/components/latest/bean-language.html[Bean method] (camel-quarkus-bean) | Native + Stable | 0.2.0 | To use a Java bean (aka method call) in Camel expressions or predicates. -| link:https://camel.apache.org/components/latest/constant-language.html[Constant] (camel-quarkus-core) | Native + - Stable | 0.2.0 | To use a constant value in Camel expressions or predicates. Important: this is a fixed constant value that is only set once during starting up the route, do not use this if you want dynamic values during routing. - -| link:https://camel.apache.org/components/latest/exchangeProperty-language.html[ExchangeProperty] (camel-quarkus-core) | Native + - Stable | 0.2.0 | To use a Camel Exchange property in expressions or predicates. - -| link:https://camel.apache.org/components/latest/file-language.html[File] (camel-quarkus-core) | Native + - Stable | 0.2.0 | For expressions and predicates using the file/simple language. - | link:https://camel.apache.org/components/latest/groovy-language.html[Groovy] (camel-quarkus-groovy) | JVM + Preview | 1.0.0-M6 | To use Groovy scripts in Camel expressions or predicates. -| link:https://camel.apache.org/components/latest/header-language.html[Header] (camel-quarkus-core) | Native + - Stable | 0.2.0 | To use a Camel Message header in expressions or predicates. - | link:https://camel.apache.org/components/latest/jsonpath-language.html[JsonPath] (camel-quarkus-jsonpath) | Native + Stable | 1.0.0-M3 | To use JsonPath in Camel expressions or predicates. | link:https://camel.apache.org/components/latest/ognl-language.html[OGNL] (camel-quarkus-ognl) | JVM + Preview | 1.0.0-M6 | To use OGNL scripts in Camel expressions or predicates. -| link:https://camel.apache.org/components/latest/ref-language.html[Ref] (camel-quarkus-core) | Native + - Stable | 0.2.0 | Reference to an existing Camel expression or predicate, which is looked up from the Camel registry. - -| link:https://camel.apache.org/components/latest/simple-language.html[Simple] (camel-quarkus-core) | Native + - Stable | 0.2.0 | To use Camels built-in Simple language in Camel expressions or predicates. - -| link:https://camel.apache.org/components/latest/tokenize-language.html[Tokenize] (camel-quarkus-core) | Native + - Stable | 0.2.0 | To use Camel message body or header with a tokenizer in Camel expressions or predicates. - | link:https://camel.apache.org/components/latest/xtokenize-language.html[XML Tokenize] (camel-quarkus-xml-jaxp) | Native + Stable | 1.0.0-M5 | To use Camel message body or header with a XML tokenizer in Camel expressions or predicates. @@ -760,27 +717,45 @@ Level | Since | Description == Miscellaneous Extensions // others: START -Number of miscellaneous extensions: 12 in 12 JAR artifacts (0 deprecated) +Number of miscellaneous extensions: 19 in 19 JAR artifacts (0 deprecated) [width="100%",cols="4,1,1,5",options="header"] |=== | Extension | Target Level | Since | Description | (camel-quarkus-attachments) | Native + - Stable | 0.3.0 | Java Attachments support for Camel Message + Stable | 0.3.0 | Support for attachments on Camel messages. | (camel-quarkus-caffeine-lrucache) | Native + Stable | 1.0.0-M5 | Provides an implementation of the LRUCacheFactory based on Caffeine +| (camel-quarkus-core) | Native + + Stable | 0.2.0 | The Camel Quarkus core module + | (camel-quarkus-core-cloud) | Native + Stable | 0.2.0 | The Camel Quarkus core cloud module +| (camel-quarkus-cron) | Native + + Stable | 1.0.0-M6 | Camel Cron Component + | (camel-quarkus-endpointdsl) | Native + Stable | 1.0.0-M3 | camel-quarkus-endpointdsl +| (camel-quarkus-file) | Native + + Stable | 0.4.0 | The file component provides access to the file system. + +| xref:extensions/http.adoc[camel-quarkus-http] | Native + + Stable | 1.0.0-M3 | The http component provides support for the HTTP/HTTPS protocols. + | (camel-quarkus-hystrix) | Native + Stable | 1.0.0-M1 | Circuit Breaker EIP using Netflix Hystrix +| (camel-quarkus-jackson) | Native + + Stable | 0.3.0 | Provides support for the Jackson dataformat. + +| (camel-quarkus-jaxb) | Native + + Stable | 1.0.0-M5 | The jaxb extensions provides JAXB support for Camel. + | (camel-quarkus-kotlin) | Native + Stable | 1.0.0-M3 | camel-quarkus-kotlin @@ -796,6 +771,9 @@ Number of miscellaneous extensions: 12 in 12 JAR artifacts (0 deprecated) | (camel-quarkus-reactive-executor) | Native + Stable | 0.3.0 | Reactive Executor for camel-core using Vert.x +| (camel-quarkus-servlet) | Native + + Stable | 0.2.0 | Camel servlet transport support. + | (camel-quarkus-xml-io) | Native + Stable | 1.0.0-M5 | An XML stack for parsing XML route definitions. A fast an light weight alternative to camel-quarkus-xml-jaxp diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java index 7595070..3207fe3 100644 --- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java +++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java @@ -156,6 +156,12 @@ class BuildProcessor { "META-INF/services/org/apache/camel/language/*", "META-INF/services/org/apache/camel/dataformat/*", "META-INF/services/org/apache/camel/cron/*")); + + services.produce(new CamelServicePatternBuildItem( + CamelServiceDestination.DISCOVERY, + false, + "META-INF/services/org/apache/camel/configurer/avro-component", + "META-INF/services/org/apache/camel/configurer/avro-endpoint")); } @BuildStep diff --git a/extensions-jvm/avro-rpc/deployment/pom.xml b/extensions-jvm/avro-rpc/deployment/pom.xml new file mode 100644 index 0000000..4310cab --- /dev/null +++ b/extensions-jvm/avro-rpc/deployment/pom.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-avro-rpc-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-avro-rpc-deployment</artifactId> + <name>Camel Quarkus :: Avro RPC :: Deployment</name> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core-deployment</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-avro-rpc</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/extensions-jvm/avro-rpc/deployment/src/main/java/org/apache/camel/quarkus/component/avro/deployment/AvroProcessor.java b/extensions-jvm/avro-rpc/deployment/src/main/java/org/apache/camel/quarkus/component/avro/deployment/AvroProcessor.java new file mode 100644 index 0000000..ec58a38 --- /dev/null +++ b/extensions-jvm/avro-rpc/deployment/src/main/java/org/apache/camel/quarkus/component/avro/deployment/AvroProcessor.java @@ -0,0 +1,58 @@ +/* + * 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.component.avro.deployment; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.annotations.ExecutionTime; +import io.quarkus.deployment.annotations.Record; +import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.pkg.steps.NativeBuild; +import org.apache.camel.component.avro.AvroComponent; +import org.apache.camel.quarkus.component.avro.AvroRecorder; +import org.apache.camel.quarkus.core.JvmOnlyRecorder; +import org.apache.camel.quarkus.core.deployment.CamelBeanBuildItem; +import org.jboss.logging.Logger; + +class AvroProcessor { + + private static final Logger LOG = Logger.getLogger(AvroProcessor.class); + private static final String FEATURE = "camel-avro-rpc"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + + /** + * Remove this once this extension starts supporting the native mode. + */ + @BuildStep(onlyIf = NativeBuild.class) + @Record(value = ExecutionTime.RUNTIME_INIT) + void warnJvmInNative(JvmOnlyRecorder recorder) { + JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time + recorder.warnJvmInNative(FEATURE); // warn at runtime + } + + @Record(ExecutionTime.STATIC_INIT) + @BuildStep + CamelBeanBuildItem avroComponent(AvroRecorder recorder) { + return new CamelBeanBuildItem( + "avro-rpc", + AvroComponent.class.getName(), + recorder.createAvroComponent()); + } +} diff --git a/extensions-jvm/avro-rpc/integration-test/pom.xml b/extensions-jvm/avro-rpc/integration-test/pom.xml new file mode 100644 index 0000000..b76aa68 --- /dev/null +++ b/extensions-jvm/avro-rpc/integration-test/pom.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-avro-rpc-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + </parent> + + <artifactId>camel-quarkus-avro-rpc-integration-test</artifactId> + <name>Camel Quarkus :: Avro RPC :: Integration Test</name> + <description>Integration tests for Camel Quarkus Avro extension</description> + + <properties> + <!-- mvnd, a.k.a. Maven Daemon: https://github.com/gnodet/mvnd --> + <!-- The following rule tells mvnd to build the listed deployment modules before this module. --> + <!-- This is important because mvnd builds modules in parallel by default. The deployment modules are not --> + <!-- explicit dependencies of this module in the Maven sense, although they are required by the Quarkus Maven plugin. --> + <!-- Please update rule whenever you change the dependencies of this module by running --> + <!-- mvn process-resources -Pformat from the root directory --> + <mvnd.builder.rule>camel-quarkus-avro-rpc-deployment,camel-quarkus-support-policy-deployment</mvnd.builder.rule> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-avro-rpc</artifactId> + </dependency> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-resteasy</artifactId> + </dependency> + + <!-- test dependencies --> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-junit5</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>io.rest-assured</groupId> + <artifactId>rest-assured</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>build</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> diff --git a/extensions-jvm/avro/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java b/extensions-jvm/avro-rpc/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java similarity index 74% copy from extensions-jvm/avro/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java copy to extensions-jvm/avro-rpc/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java index 0ba3eb3..99f5473 100644 --- a/extensions-jvm/avro/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java +++ b/extensions-jvm/avro-rpc/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java @@ -33,8 +33,7 @@ public class AvroResource { private static final Logger LOG = Logger.getLogger(AvroResource.class); - private static final String COMPONENT_AVRO = "avro"; - private static final String DATAFORMAT_AVRO = "avro"; + private static final String COMPONENT_AVRO = "avro-rpc"; @Inject CamelContext context; @@ -49,16 +48,4 @@ public class AvroResource { LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_AVRO); return Response.status(500, COMPONENT_AVRO + " could not be loaded from the Camel context").build(); } - - @Path("/load/dataformat/avro") - @GET - @Produces(MediaType.TEXT_PLAIN) - public Response loadDataformatAvro() throws Exception { - /* This is an autogenerated test */ - if (context.getComponent(DATAFORMAT_AVRO) != null) { - return Response.ok().build(); - } - LOG.warnf("Could not load [%s] from the Camel context", DATAFORMAT_AVRO); - return Response.status(500, DATAFORMAT_AVRO + " could not be loaded from the Camel context").build(); - } } diff --git a/extensions-jvm/avro/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java b/extensions-jvm/avro-rpc/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java similarity index 85% copy from extensions-jvm/avro/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java copy to extensions-jvm/avro-rpc/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java index 417bee2..346a3c9 100644 --- a/extensions-jvm/avro/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java +++ b/extensions-jvm/avro-rpc/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java @@ -31,12 +31,4 @@ class AvroTest { .statusCode(200); } - @Test - public void loadDataformatAvro() { - /* A simple autogenerated test */ - RestAssured.get("/avro/load/dataformat/avro") - .then() - .statusCode(200); - } - } diff --git a/extensions-jvm/avro-rpc/pom.xml b/extensions-jvm/avro-rpc/pom.xml new file mode 100644 index 0000000..2bf4bd8 --- /dev/null +++ b/extensions-jvm/avro-rpc/pom.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-build-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../../poms/build-parent/pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-avro-rpc-parent</artifactId> + <name>Camel Quarkus :: Avro RPC</name> + <packaging>pom</packaging> + + <modules> + <module>deployment</module> + <module>runtime</module> + <module>integration-test</module> + </modules> +</project> diff --git a/extensions-jvm/avro-rpc/runtime/pom.xml b/extensions-jvm/avro-rpc/runtime/pom.xml new file mode 100644 index 0000000..f7dfabf --- /dev/null +++ b/extensions-jvm/avro-rpc/runtime/pom.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + 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. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-avro-rpc-parent</artifactId> + <version>1.1.0-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-avro-rpc</artifactId> + <name>Camel Quarkus :: Avro RPC :: Runtime</name> + <description>Working with Apache Avro for data serialization.</description> + + <properties> + <firstVersion>1.0.0-M6</firstVersion> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-avro-rpc</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-bootstrap-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/extensions-jvm/avro-rpc/runtime/src/main/java/org/apache/camel/quarkus/component/avro/AvroRecorder.java b/extensions-jvm/avro-rpc/runtime/src/main/java/org/apache/camel/quarkus/component/avro/AvroRecorder.java new file mode 100644 index 0000000..6fbb1b6 --- /dev/null +++ b/extensions-jvm/avro-rpc/runtime/src/main/java/org/apache/camel/quarkus/component/avro/AvroRecorder.java @@ -0,0 +1,14 @@ +package org.apache.camel.quarkus.component.avro; + +import io.quarkus.runtime.RuntimeValue; +import io.quarkus.runtime.annotations.Recorder; +import org.apache.camel.component.avro.AvroComponent; + +@Recorder +public class AvroRecorder { + + public RuntimeValue<?> createAvroComponent() { + return new RuntimeValue<>(new AvroComponent()); + } + +} diff --git a/extensions-jvm/avro-rpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions-jvm/avro-rpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000..def5c36 --- /dev/null +++ b/extensions-jvm/avro-rpc/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,29 @@ +# +# 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. +# + +--- +name: "Avro RPC" +description: "Working with Apache Avro for RPC." +metadata: + unlisted: true + keywords: + - "messaging" + - "transformation" + guide: "https://camel.apache.org/components/latest/avro-rpc-component.html" + categories: + - "integration" + status: "preview" diff --git a/extensions-jvm/avro/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java b/extensions-jvm/avro/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java index 0ba3eb3..ec520f6 100644 --- a/extensions-jvm/avro/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java +++ b/extensions-jvm/avro/integration-test/src/main/java/org/apache/camel/quarkus/component/avro/it/AvroResource.java @@ -33,29 +33,16 @@ public class AvroResource { private static final Logger LOG = Logger.getLogger(AvroResource.class); - private static final String COMPONENT_AVRO = "avro"; private static final String DATAFORMAT_AVRO = "avro"; @Inject CamelContext context; - @Path("/load/component/avro") - @GET - @Produces(MediaType.TEXT_PLAIN) - public Response loadComponentAvro() throws Exception { - /* This is an autogenerated test */ - if (context.getComponent(COMPONENT_AVRO) != null) { - return Response.ok().build(); - } - LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_AVRO); - return Response.status(500, COMPONENT_AVRO + " could not be loaded from the Camel context").build(); - } - @Path("/load/dataformat/avro") @GET @Produces(MediaType.TEXT_PLAIN) public Response loadDataformatAvro() throws Exception { /* This is an autogenerated test */ - if (context.getComponent(DATAFORMAT_AVRO) != null) { + if (context.resolveDataFormat(DATAFORMAT_AVRO) != null) { return Response.ok().build(); } LOG.warnf("Could not load [%s] from the Camel context", DATAFORMAT_AVRO); diff --git a/extensions-jvm/avro/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java b/extensions-jvm/avro/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java index 417bee2..78229a0 100644 --- a/extensions-jvm/avro/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java +++ b/extensions-jvm/avro/integration-test/src/test/java/org/apache/camel/quarkus/component/avro/it/AvroTest.java @@ -24,14 +24,6 @@ import org.junit.jupiter.api.Test; class AvroTest { @Test - public void loadComponentAvro() { - /* A simple autogenerated test */ - RestAssured.get("/avro/load/component/avro") - .then() - .statusCode(200); - } - - @Test public void loadDataformatAvro() { /* A simple autogenerated test */ RestAssured.get("/avro/load/dataformat/avro") diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml index 90f87ef..d620b49 100644 --- a/extensions-jvm/pom.xml +++ b/extensions-jvm/pom.xml @@ -35,6 +35,7 @@ <modules> <!-- extensions a..z; do not remove this comment, it is important when sorting via mvn process-resources -Pformat --> <module>avro</module> + <module>avro-rpc</module> <module>aws-swf</module> <module>aws2-cw</module> <module>aws2-ddb</module> diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index 91a64b7..54a2079 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -134,6 +134,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-avro-rpc</artifactId> + <version>${camel.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-aws-ec2</artifactId> <version>${camel.version}</version> </dependency> @@ -1054,6 +1059,11 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-avro-rpc</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-aws-commons</artifactId> <version>${camel-quarkus.version}</version> </dependency> @@ -1886,6 +1896,21 @@ <version>${jackson.version}</version> </dependency> <dependency> + <groupId>com.google.api.grpc</groupId> + <artifactId>proto-google-common-protos</artifactId> + <version>1.17.0</version> + </dependency> + <dependency> + <groupId>com.google.auth</groupId> + <artifactId>google-auth-library-credentials</artifactId> + <version>0.19.0</version> + </dependency> + <dependency> + <groupId>com.google.auth</groupId> + <artifactId>google-auth-library-oauth2-http</artifactId> + <version>0.19.0</version> + </dependency> + <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>${gson.version}</version> @@ -1907,6 +1932,11 @@ </exclusions> </dependency> <dependency> + <groupId>com.google.protobuf</groupId> + <artifactId>protobuf-java</artifactId> + <version>3.11.0</version> + </dependency> + <dependency> <groupId>com.orbitz.consul</groupId> <artifactId>consul-client</artifactId> <version>${consul-client.version}</version> @@ -1959,6 +1989,11 @@ <version>${ahc.version}</version> </dependency> <dependency> + <groupId>org.codehaus.mojo</groupId> + <artifactId>animal-sniffer-annotations</artifactId> + <version>1.18</version> + </dependency> + <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>stax2-api</artifactId> <version>${stax2.version}</version> @@ -2015,6 +2050,16 @@ <version>${snakeyaml.version}</version> </dependency> <dependency> + <groupId>org.threeten</groupId> + <artifactId>threetenbp</artifactId> + <version>1.4.0</version> + </dependency> + <dependency> + <groupId>software.amazon.awssdk</groupId> + <artifactId>annotations</artifactId> + <version>${awssdk2.version}</version><!-- override the version set in the quarkus BOM --> + </dependency> + <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>apache-client</artifactId> <version>${awssdk2.version}</version><!-- override the version set in the quarkus BOM --> @@ -2026,6 +2071,11 @@ </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> + <artifactId>http-client-spi</artifactId> + <version>${awssdk2.version}</version><!-- override the version set in the quarkus BOM --> + </dependency> + <dependency> + <groupId>software.amazon.awssdk</groupId> <artifactId>netty-nio-client</artifactId> <version>${awssdk2.version}</version><!-- override the version set in the quarkus BOM --> </dependency> @@ -2035,6 +2085,11 @@ <version>${awssdk2.version}</version><!-- override the version set in the quarkus BOM --> </dependency> <dependency> + <groupId>software.amazon.awssdk</groupId> + <artifactId>utils</artifactId> + <version>${awssdk2.version}</version><!-- override the version set in the quarkus BOM --> + </dependency> + <dependency> <groupId>xalan</groupId> <artifactId>xalan</artifactId> <version>${xalan.version}</version>
