You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/11/24 14:46:24 UTC

[GitHub] [camel-quarkus] JiriOndrusek opened a new pull request #2025: Camel Avro RPC component native support #1941

JiriOndrusek opened a new pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025


   fixes: https://github.com/apache/camel-quarkus/issues/1941
   
   Change overrides version of avro dependencies from 1.9.1 (camel) to 1.10.0 (used by quarkus). Once issue https://issues.apache.org/jira/browse/CAMEL-15879 is solved, restriction could be removed. But version has to be still aligned manually, because camel uses dependencies like `avro-ipc*`, which are not used in quarkus.
   
   There is a "questionable" substitution - `GenericDatumReaderSubstitute`.
   As you can see, there is a method `getStringClass` in avro (see https://github.com/apache/avro/blob/branch-1.10/lang/java/avro/src/main/java/org/apache/avro/generic/GenericDatumReader.java#L503), which uses local cache created right during instantiation (see https://github.com/apache/avro/blob/branch-1.10/lang/java/avro/src/main/java/org/apache/avro/generic/GenericDatumReader.java#L500).
   This cache is **null** (in some tests) during execution in native mode. I don't see how this is possible. But I've created substitution, which creates this cache if it is null. With this substitution tests are successful. (but I still think that it should work without this substitution, which obviously does not)
   From my POV it could be nice, to create a separate issue to investigate this behavior. WDYT? 
     
   
   
   [ ] An issue should be filed for the change unless this is a trivial change (fixing a typo or similar). One issue should ideally be fixed by not more than one commit and the other way round, each commit should fix just one issue, without pulling in other changes.
   [ ] Each commit in the pull request should have a meaningful and properly spelled subject line and body. Copying the title of the associated issue is typically enough. Please include the issue number in the commit message prefixed by #.
   [ ] The pull request description should explain what the pull request does, how, and why. If the info is available in the associated issue or some other external document, a link is enough.
   [ ] Phrases like Fix #<issueNumber> or Fixes #<issueNumber> will auto-close the named issue upon merging the pull request. Using them is typically a good idea.
   [ ] Please run mvn process-resources -Pformat (and amend the changes if necessary) before sending the pull request.
   [ ] Contributor guide is your good friend: https://camel.apache.org/camel-quarkus/latest/contributor-guide.html


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#discussion_r529618569



##########
File path: integration-tests/avro-rpc/pom.xml
##########
@@ -0,0 +1,154 @@
+<?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-integration-tests</artifactId>
+        <version>1.5.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-avro-rpc</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Avro RPC</name>
+    <description>Integration tests for Camel Quarkus Avro RPC extension</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom-test</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-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>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-integration-test-support</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-avro-rpc-deployment</artifactId>
+            <version>${project.version}</version>
+            <type>pom</type>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>native</id>
+            <activation>
+                <property>
+                    <name>native</name>
+                </property>
+            </activation>
+            <properties>
+                <quarkus.package.type>native</quarkus.package.type>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <!-- Profile for generation of protocol files into package `org.apache.camel.quarkus.component.avro.rpc.it.specific.generated` -->
+        <profile>
+            <id>avro</id>
+            <activation>
+                <property>
+                    <name>avro</name>

Review comment:
       This should either be active by default (and inactive in `quickly`) or we should at least document here under which circumstances should the classes be regenerated.

##########
File path: integration-tests/avro-rpc/src/main/java/org/apache/camel/quarkus/component/avro/rpc/it/AvroRpcResource.java
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.rpc.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestPojo;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestReflection;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.impl.TestReflectionImpl;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Key;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.KeyValueProtocol;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Value;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.impl.KeyValueProtocolImpl;
+
+@Path("/avro-rpc")
+@ApplicationScoped
+public class AvroRpcResource {
+
+    public static final String REFLECTIVE_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.httpServerReflection.port";
+    public static final String REFLECTIVE_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.nettyServerReflection.port";
+    public static final String SPECIFIC_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.httpServerReflection.port";
+    public static final String SPECIFIC_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.nettyServerReflection.port";
+    public static final String REFLECTIVE_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.httpTransceiverReflection.port";
+    public static final String REFLECTIVE_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.nettyTransceiverReflection.port";
+    public static final String SPECIFIC_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.httpTransceiverReflection.port";
+    public static final String SPECIFIC_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.nettyTransceiverReflection.port";
+
+    private TestReflection httpTestReflection = new TestReflectionImpl(),
+            nettyTestReflection = new TestReflectionImpl();
+    private KeyValueProtocol httpKeyValue = new KeyValueProtocolImpl(),
+            nettyKeyValue = new KeyValueProtocolImpl();
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/reflectionProducerSet")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    public void reflectionProducerSet(@QueryParam("protocol") ProtocolType protocol, String name) throws Exception {
+        Object[] request = { name };
+        producerTemplate.requestBody(String.format(
+                "avro:%s:localhost:{{%s}}/setName?protocolClassName=%s&singleParameter=true",

Review comment:
       I'd vote for configuring the endpoint in the same way here and in `AvroRpcRouteBuilder`. I personally find the `@ConfigProperty` fields in `AvroRpcRouteBuilder` a bit better readable than Camel property expansion.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#discussion_r530179261



##########
File path: integration-tests/avro-rpc/pom.xml
##########
@@ -0,0 +1,154 @@
+<?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-integration-tests</artifactId>
+        <version>1.5.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>camel-quarkus-integration-test-avro-rpc</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Avro RPC</name>
+    <description>Integration tests for Camel Quarkus Avro RPC extension</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom-test</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-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>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-integration-test-support</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-avro-rpc-deployment</artifactId>
+            <version>${project.version}</version>
+            <type>pom</type>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>*</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>native</id>
+            <activation>
+                <property>
+                    <name>native</name>
+                </property>
+            </activation>
+            <properties>
+                <quarkus.package.type>native</quarkus.package.type>
+            </properties>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <!-- Profile for generation of protocol files into package `org.apache.camel.quarkus.component.avro.rpc.it.specific.generated` -->
+        <profile>
+            <id>avro</id>
+            <activation>
+                <property>
+                    <name>avro</name>

Review comment:
       I've made it active by default (and inactive in `quickly)`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on a change in pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on a change in pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#discussion_r529654986



##########
File path: pom.xml
##########
@@ -41,6 +41,8 @@
         <ahc.version>2.12.1</ahc.version>
         <animal-sniffer.version>1.18</animal-sniffer.version>
         <antlr3.version>3.5.2</antlr3.version><!-- Spark, Stringtemplate and probably others -->
+	    <avro-ipc-jetty-version>1.10.0</avro-ipc-jetty-version>
+        <avro-ipc-netty-version>1.10.0</avro-ipc-netty-version>

Review comment:
       If these ipc deps are always going to have the same version, lets have a single property for them.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#discussion_r530179612



##########
File path: pom.xml
##########
@@ -41,6 +41,8 @@
         <ahc.version>2.12.1</ahc.version>
         <animal-sniffer.version>1.18</animal-sniffer.version>
         <antlr3.version>3.5.2</antlr3.version><!-- Spark, Stringtemplate and probably others -->
+	    <avro-ipc-jetty-version>1.10.0</avro-ipc-jetty-version>
+        <avro-ipc-netty-version>1.10.0</avro-ipc-netty-version>

Review comment:
       I changed it into single property




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#discussion_r530165431



##########
File path: integration-tests/avro-rpc/src/main/java/org/apache/camel/quarkus/component/avro/rpc/it/AvroRpcResource.java
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.rpc.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestPojo;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestReflection;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.impl.TestReflectionImpl;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Key;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.KeyValueProtocol;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Value;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.impl.KeyValueProtocolImpl;
+
+@Path("/avro-rpc")
+@ApplicationScoped
+public class AvroRpcResource {
+
+    public static final String REFLECTIVE_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.httpServerReflection.port";
+    public static final String REFLECTIVE_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.nettyServerReflection.port";
+    public static final String SPECIFIC_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.httpServerReflection.port";
+    public static final String SPECIFIC_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.nettyServerReflection.port";
+    public static final String REFLECTIVE_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.httpTransceiverReflection.port";
+    public static final String REFLECTIVE_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.nettyTransceiverReflection.port";
+    public static final String SPECIFIC_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.httpTransceiverReflection.port";
+    public static final String SPECIFIC_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.nettyTransceiverReflection.port";
+
+    private TestReflection httpTestReflection = new TestReflectionImpl(),
+            nettyTestReflection = new TestReflectionImpl();
+    private KeyValueProtocol httpKeyValue = new KeyValueProtocolImpl(),
+            nettyKeyValue = new KeyValueProtocolImpl();
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/reflectionProducerSet")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    public void reflectionProducerSet(@QueryParam("protocol") ProtocolType protocol, String name) throws Exception {
+        Object[] request = { name };
+        producerTemplate.requestBody(String.format(
+                "avro:%s:localhost:{{%s}}/setName?protocolClassName=%s&singleParameter=true",

Review comment:
       @ppalaga I'm not sure, what do you mean.
   Here is endpoint form `AvroRpcResource.java`
   >String.format(
                   "avro:%s:localhost:{{%s}}/setName?protocolClassName=%s&singleParameter=true",
                   protocol,
                   protocol == ProtocolType.http ? REFLECTIVE_HTTP_SERVER_PORT_PARAM : REFLECTIVE_NETTY_SERVER_PORT_PARAM,
                   TestReflection.class.getCanonicalName())
   
   Here is a route definition from 'AvroRpcRouteBuilder'
   >from(String.format("avro:http:localhost:%d/setTestPojo?protocolClassName=%s&singleParameter=true", httpPort,
                   TestReflection.class.getCanonicalName()))
                           ....
   
   I don't see much difference here. May I ask you for more information?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton merged pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
jamesnetherton merged pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#discussion_r530213249



##########
File path: integration-tests/avro-rpc/src/main/java/org/apache/camel/quarkus/component/avro/rpc/it/AvroRpcResource.java
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.rpc.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestPojo;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestReflection;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.impl.TestReflectionImpl;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Key;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.KeyValueProtocol;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Value;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.impl.KeyValueProtocolImpl;
+
+@Path("/avro-rpc")
+@ApplicationScoped
+public class AvroRpcResource {
+
+    public static final String REFLECTIVE_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.httpServerReflection.port";
+    public static final String REFLECTIVE_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.nettyServerReflection.port";
+    public static final String SPECIFIC_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.httpServerReflection.port";
+    public static final String SPECIFIC_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.nettyServerReflection.port";
+    public static final String REFLECTIVE_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.httpTransceiverReflection.port";
+    public static final String REFLECTIVE_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.nettyTransceiverReflection.port";
+    public static final String SPECIFIC_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.httpTransceiverReflection.port";
+    public static final String SPECIFIC_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.nettyTransceiverReflection.port";
+
+    private TestReflection httpTestReflection = new TestReflectionImpl(),
+            nettyTestReflection = new TestReflectionImpl();
+    private KeyValueProtocol httpKeyValue = new KeyValueProtocolImpl(),
+            nettyKeyValue = new KeyValueProtocolImpl();
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/reflectionProducerSet")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    public void reflectionProducerSet(@QueryParam("protocol") ProtocolType protocol, String name) throws Exception {
+        Object[] request = { name };
+        producerTemplate.requestBody(String.format(
+                "avro:%s:localhost:{{%s}}/setName?protocolClassName=%s&singleParameter=true",

Review comment:
       done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on a change in pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on a change in pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#discussion_r530202323



##########
File path: integration-tests/avro-rpc/src/main/java/org/apache/camel/quarkus/component/avro/rpc/it/AvroRpcResource.java
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.rpc.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestPojo;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestReflection;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.impl.TestReflectionImpl;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Key;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.KeyValueProtocol;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Value;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.impl.KeyValueProtocolImpl;
+
+@Path("/avro-rpc")
+@ApplicationScoped
+public class AvroRpcResource {
+
+    public static final String REFLECTIVE_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.httpServerReflection.port";
+    public static final String REFLECTIVE_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.nettyServerReflection.port";
+    public static final String SPECIFIC_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.httpServerReflection.port";
+    public static final String SPECIFIC_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.nettyServerReflection.port";
+    public static final String REFLECTIVE_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.httpTransceiverReflection.port";
+    public static final String REFLECTIVE_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.nettyTransceiverReflection.port";
+    public static final String SPECIFIC_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.httpTransceiverReflection.port";
+    public static final String SPECIFIC_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.nettyTransceiverReflection.port";
+
+    private TestReflection httpTestReflection = new TestReflectionImpl(),
+            nettyTestReflection = new TestReflectionImpl();
+    private KeyValueProtocol httpKeyValue = new KeyValueProtocolImpl(),
+            nettyKeyValue = new KeyValueProtocolImpl();
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/reflectionProducerSet")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    public void reflectionProducerSet(@QueryParam("protocol") ProtocolType protocol, String name) throws Exception {
+        Object[] request = { name };
+        producerTemplate.requestBody(String.format(
+                "avro:%s:localhost:{{%s}}/setName?protocolClassName=%s&singleParameter=true",

Review comment:
       ok, now I understand and agree, thanks




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] ppalaga commented on a change in pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
ppalaga commented on a change in pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#discussion_r530180976



##########
File path: integration-tests/avro-rpc/src/main/java/org/apache/camel/quarkus/component/avro/rpc/it/AvroRpcResource.java
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.rpc.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestPojo;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.TestReflection;
+import org.apache.camel.quarkus.component.avro.rpc.it.reflection.impl.TestReflectionImpl;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Key;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.KeyValueProtocol;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.generated.Value;
+import org.apache.camel.quarkus.component.avro.rpc.it.specific.impl.KeyValueProtocolImpl;
+
+@Path("/avro-rpc")
+@ApplicationScoped
+public class AvroRpcResource {
+
+    public static final String REFLECTIVE_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.httpServerReflection.port";
+    public static final String REFLECTIVE_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.reflective.nettyServerReflection.port";
+    public static final String SPECIFIC_HTTP_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.httpServerReflection.port";
+    public static final String SPECIFIC_NETTY_SERVER_PORT_PARAM = "camel.avro-rpc.test.generated.nettyServerReflection.port";
+    public static final String REFLECTIVE_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.httpTransceiverReflection.port";
+    public static final String REFLECTIVE_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.nettyTransceiverReflection.port";
+    public static final String SPECIFIC_HTTP_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.httpTransceiverReflection.port";
+    public static final String SPECIFIC_NETTY_TRANSCEIVER_PORT_PARAM = "camel.avro-rpc.test.specific.nettyTransceiverReflection.port";
+
+    private TestReflection httpTestReflection = new TestReflectionImpl(),
+            nettyTestReflection = new TestReflectionImpl();
+    private KeyValueProtocol httpKeyValue = new KeyValueProtocolImpl(),
+            nettyKeyValue = new KeyValueProtocolImpl();
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Path("/reflectionProducerSet")
+    @POST
+    @Consumes(MediaType.TEXT_PLAIN)
+    public void reflectionProducerSet(@QueryParam("protocol") ProtocolType protocol, String name) throws Exception {
+        Object[] request = { name };
+        producerTemplate.requestBody(String.format(
+                "avro:%s:localhost:{{%s}}/setName?protocolClassName=%s&singleParameter=true",

Review comment:
       My point is that there's perhaps much more future readers of this code who know MicroProfile config that those who know Camel property expansion `{{my.property}}`. So you could do here what you do in `AvroRpcRouteBuilder`:
   
   1. Add at the ConfigProperty fields
   
   ```
   @ConfigProperty(name = AvroRpcResource.REFLECTIVE_HTTP_TRANSCEIVER_PORT_PARAM)
       Integer httpPort;
   
   @ConfigProperty(name = AvroRpcResource.REFLECTIVE_NETTY_TRANSCEIVER_PORT_PARAM)
       Integer nettyPort;
   ```
   
   2. Change the handler
   
   ```
   producerTemplate.requestBody(String.format(
                   "avro:%s:localhost:%d/setName?protocolClassName=%s&singleParameter=true",
                   protocol,
                   protocol == ProtocolType.http ? httpPort: nettyPort,
                   TestReflection.class.getCanonicalName()), request);
   ```
   
   WDYT?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] JiriOndrusek commented on pull request #2025: Camel Avro RPC component native support #1941

Posted by GitBox <gi...@apache.org>.
JiriOndrusek commented on pull request #2025:
URL: https://github.com/apache/camel-quarkus/pull/2025#issuecomment-733687268


   Current build problem does not reate wit avro-rpc - https://github.com/apache/camel-quarkus/pull/2025/checks?check_run_id=1453121702#step:10:1528


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org