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/09/07 13:50:10 UTC

[GitHub] [camel-quarkus] zbendhiba opened a new pull request #1715: Weather native support fixes #1631

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


   


----------------------------------------------------------------
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] zbendhiba commented on a change in pull request #1715: Weather native support fixes #1631

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



##########
File path: integration-tests/weather/src/main/java/org/apache/camel/quarkus/component/weather/it/WeatherResource.java
##########
@@ -0,0 +1,152 @@
+/*
+ * 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.weather.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.weather.WeatherConstants;
+import org.jboss.logging.Logger;
+
+@Path("/weather")
+@ApplicationScoped
+public class WeatherResource {
+
+    private static final Logger LOG = Logger.getLogger(WeatherResource.class);
+
+    private static final String COMPONENT_WEATHER = "weather";
+    @Inject
+    CamelContext context;
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Inject
+    ConsumerTemplate consumerTemplate;
+
+    @Path("load/component/weather")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response loadComponentWeather() throws Exception {
+        /* This is an autogenerated test */
+        if (context.getComponent(COMPONENT_WEATHER) != null) {
+            return Response.ok().build();
+        }
+        LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_WEATHER);
+        return Response.status(500, COMPONENT_WEATHER + " could not be loaded from the Camel context").build();
+    }
+
+    @Path("location/{location}")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response getWeatherByLocation(@PathParam("location") String location) {
+        LOG.infof("Retrieve weather with location : %s", location);
+        final String response = producerTemplate.requestBodyAndHeader(
+                "weather:foo?location=random&appid=9162755b2efa555823cfe0451d7fff38&geolocationAccessKey=test&geolocationRequestHostIP=test",

Review comment:
       Only the appid is mandatory. It doesn't have a label security and it is used in the get URI call for openweather API (https://openweathermap.org/appid). The 2 others are not mandatory, they are used only if we want to determine the current geoLocation. I'll remove them from my REST endpoints.




----------------------------------------------------------------
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 pull request #1715: Weather native support fixes #1631

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


   Perfect, thanks, @zbendhiba !


----------------------------------------------------------------
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 merged pull request #1715: Weather native support fixes #1631

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


   


----------------------------------------------------------------
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] zbendhiba commented on a change in pull request #1715: Weather native support fixes #1631

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



##########
File path: integration-tests/weather/src/main/java/org/apache/camel/quarkus/component/weather/it/WeatherResource.java
##########
@@ -0,0 +1,152 @@
+/*
+ * 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.weather.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.weather.WeatherConstants;
+import org.jboss.logging.Logger;
+
+@Path("/weather")
+@ApplicationScoped
+public class WeatherResource {
+
+    private static final Logger LOG = Logger.getLogger(WeatherResource.class);
+
+    private static final String COMPONENT_WEATHER = "weather";
+    @Inject
+    CamelContext context;
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Inject
+    ConsumerTemplate consumerTemplate;
+
+    @Path("load/component/weather")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response loadComponentWeather() throws Exception {
+        /* This is an autogenerated test */
+        if (context.getComponent(COMPONENT_WEATHER) != null) {
+            return Response.ok().build();
+        }
+        LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_WEATHER);
+        return Response.status(500, COMPONENT_WEATHER + " could not be loaded from the Camel context").build();
+    }
+
+    @Path("location/{location}")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response getWeatherByLocation(@PathParam("location") String location) {
+        LOG.infof("Retrieve weather with location : %s", location);
+        final String response = producerTemplate.requestBodyAndHeader(
+                "weather:foo?location=random&appid=9162755b2efa555823cfe0451d7fff38&geolocationAccessKey=test&geolocationRequestHostIP=test",

Review comment:
       it was the one from camel integration tests. 
   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] zbendhiba commented on a change in pull request #1715: Weather native support fixes #1631

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



##########
File path: extensions/weather/runtime/pom.xml
##########
@@ -56,6 +56,40 @@
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-weather</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-annotations</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-databind</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.httpcomponents</groupId>
+                    <artifactId>httpclient</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-jackson</artifactId>

Review comment:
       yes. quarkus-jackson is enough. I'll change that 




----------------------------------------------------------------
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] zbendhiba commented on a change in pull request #1715: Weather native support fixes #1631

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



##########
File path: integration-tests/weather/src/test/java/org/apache/camel/quarkus/component/weather/it/WeatherTest.java
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.weather.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.Matchers.containsString;
+
+@QuarkusTest
+class WeatherTest {
+
+    @Test
+    public void loadComponentWeather() {
+        /* A simple autogenerated test */
+        RestAssured.get("/weather/load/component/weather")
+                .then()
+                .statusCode(200);
+    }
+
+    @Test
+    public void loadByLocationName() {
+        RestAssured.given()
+                .get("/weather/location/London,uk")
+                .then()
+                .statusCode(200)
+                .body(containsString("name\":\"London\""), containsString("\"country\":\"GB\""), containsString("weather"),

Review comment:
       done!! Thanks!! I've changed that.




----------------------------------------------------------------
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 #1715: Weather native support fixes #1631

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



##########
File path: integration-tests/weather/src/main/java/org/apache/camel/quarkus/component/weather/it/WeatherResource.java
##########
@@ -0,0 +1,152 @@
+/*
+ * 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.weather.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.weather.WeatherConstants;
+import org.jboss.logging.Logger;
+
+@Path("/weather")
+@ApplicationScoped
+public class WeatherResource {
+
+    private static final Logger LOG = Logger.getLogger(WeatherResource.class);
+
+    private static final String COMPONENT_WEATHER = "weather";
+    @Inject
+    CamelContext context;
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Inject
+    ConsumerTemplate consumerTemplate;
+
+    @Path("load/component/weather")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response loadComponentWeather() throws Exception {
+        /* This is an autogenerated test */
+        if (context.getComponent(COMPONENT_WEATHER) != null) {
+            return Response.ok().build();
+        }
+        LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_WEATHER);
+        return Response.status(500, COMPONENT_WEATHER + " could not be loaded from the Camel context").build();
+    }

Review comment:
       This can be removed as long as we have other proper tests.

##########
File path: integration-tests/weather/src/main/java/org/apache/camel/quarkus/component/weather/it/WeatherResource.java
##########
@@ -0,0 +1,152 @@
+/*
+ * 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.weather.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.weather.WeatherConstants;
+import org.jboss.logging.Logger;
+
+@Path("/weather")
+@ApplicationScoped
+public class WeatherResource {
+
+    private static final Logger LOG = Logger.getLogger(WeatherResource.class);
+
+    private static final String COMPONENT_WEATHER = "weather";
+    @Inject
+    CamelContext context;
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Inject
+    ConsumerTemplate consumerTemplate;
+
+    @Path("load/component/weather")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response loadComponentWeather() throws Exception {
+        /* This is an autogenerated test */
+        if (context.getComponent(COMPONENT_WEATHER) != null) {
+            return Response.ok().build();
+        }
+        LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_WEATHER);
+        return Response.status(500, COMPONENT_WEATHER + " could not be loaded from the Camel context").build();
+    }
+
+    @Path("location/{location}")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response getWeatherByLocation(@PathParam("location") String location) {
+        LOG.infof("Retrieve weather with location : %s", location);
+        final String response = producerTemplate.requestBodyAndHeader(
+                "weather:foo?location=random&appid=9162755b2efa555823cfe0451d7fff38&geolocationAccessKey=test&geolocationRequestHostIP=test",

Review comment:
       (As lazy as I am to look myself, sorry) are the constants in `appid=9162755b2efa555823cfe0451d7fff38&geolocationAccessKey=test&geolocationRequestHostIP=test` really necessary? Aren't those supposed to be secrets?

##########
File path: integration-tests/weather/src/test/java/org/apache/camel/quarkus/component/weather/it/WeatherTest.java
##########
@@ -0,0 +1,111 @@
+/*
+ * 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.weather.it;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.Matchers.containsString;
+
+@QuarkusTest
+class WeatherTest {
+
+    @Test
+    public void loadComponentWeather() {
+        /* A simple autogenerated test */
+        RestAssured.get("/weather/load/component/weather")
+                .then()
+                .statusCode(200);
+    }
+
+    @Test
+    public void loadByLocationName() {
+        RestAssured.given()
+                .get("/weather/location/London,uk")
+                .then()
+                .statusCode(200)
+                .body(containsString("name\":\"London\""), containsString("\"country\":\"GB\""), containsString("weather"),

Review comment:
       BTW, restassured allows for matching JSON payload attribs against Matchers https://github.com/rest-assured/rest-assured/wiki/Usage#example-1---json It would perhaps suit here too.




----------------------------------------------------------------
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] zbendhiba commented on a change in pull request #1715: Weather native support fixes #1631

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



##########
File path: integration-tests/weather/src/main/java/org/apache/camel/quarkus/component/weather/it/WeatherResource.java
##########
@@ -0,0 +1,152 @@
+/*
+ * 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.weather.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.weather.WeatherConstants;
+import org.jboss.logging.Logger;
+
+@Path("/weather")
+@ApplicationScoped
+public class WeatherResource {
+
+    private static final Logger LOG = Logger.getLogger(WeatherResource.class);
+
+    private static final String COMPONENT_WEATHER = "weather";
+    @Inject
+    CamelContext context;
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Inject
+    ConsumerTemplate consumerTemplate;
+
+    @Path("load/component/weather")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response loadComponentWeather() throws Exception {
+        /* This is an autogenerated test */
+        if (context.getComponent(COMPONENT_WEATHER) != null) {
+            return Response.ok().build();
+        }
+        LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_WEATHER);
+        return Response.status(500, COMPONENT_WEATHER + " could not be loaded from the Camel context").build();
+    }

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] jamesnetherton commented on a change in pull request #1715: Weather native support fixes #1631

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



##########
File path: extensions/weather/runtime/pom.xml
##########
@@ -56,6 +56,40 @@
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-weather</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-annotations</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-databind</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.httpcomponents</groupId>
+                    <artifactId>httpclient</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-jackson</artifactId>

Review comment:
       Do we need to pull in `camel-jackson` or would it be enough to simply have `quarkus-jackson`?




----------------------------------------------------------------
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 #1715: Weather native support fixes #1631

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



##########
File path: integration-tests/weather/src/main/java/org/apache/camel/quarkus/component/weather/it/WeatherResource.java
##########
@@ -0,0 +1,152 @@
+/*
+ * 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.weather.it;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ConsumerTemplate;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.weather.WeatherConstants;
+import org.jboss.logging.Logger;
+
+@Path("/weather")
+@ApplicationScoped
+public class WeatherResource {
+
+    private static final Logger LOG = Logger.getLogger(WeatherResource.class);
+
+    private static final String COMPONENT_WEATHER = "weather";
+    @Inject
+    CamelContext context;
+
+    @Inject
+    ProducerTemplate producerTemplate;
+
+    @Inject
+    ConsumerTemplate consumerTemplate;
+
+    @Path("load/component/weather")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response loadComponentWeather() throws Exception {
+        /* This is an autogenerated test */
+        if (context.getComponent(COMPONENT_WEATHER) != null) {
+            return Response.ok().build();
+        }
+        LOG.warnf("Could not load [%s] from the Camel context", COMPONENT_WEATHER);
+        return Response.status(500, COMPONENT_WEATHER + " could not be loaded from the Camel context").build();
+    }
+
+    @Path("location/{location}")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public Response getWeatherByLocation(@PathParam("location") String location) {
+        LOG.infof("Retrieve weather with location : %s", location);
+        final String response = producerTemplate.requestBodyAndHeader(
+                "weather:foo?location=random&appid=9162755b2efa555823cfe0451d7fff38&geolocationAccessKey=test&geolocationRequestHostIP=test",

Review comment:
       Hm... what appid is that then? Your personal or perhaps copied from Camel? In any case, I think we should consider putting the appid into the `application.properties` and comment there that it is Camel community's (or whoever else's) testing appid that people should change when copying the code to their apps.




----------------------------------------------------------------
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] zbendhiba commented on a change in pull request #1715: Weather native support fixes #1631

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



##########
File path: extensions/weather/runtime/pom.xml
##########
@@ -56,6 +56,40 @@
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-weather</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-core</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-annotations</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>com.fasterxml.jackson.core</groupId>
+                    <artifactId>jackson-databind</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.apache.httpcomponents</groupId>
+                    <artifactId>httpclient</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-jackson</artifactId>

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