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: us...@infra.apache.org