You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/07/17 14:35:22 UTC

[camel] branch master updated (a3c1a23 -> a25b425)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from a3c1a23  Upgrade Jose4j to version 0.6.4
     new 097a16c  CAMEL-12658 - camel-weather: Freegeoip service is no longer avaiable, we need to switch to apilayer IPstack
     new 26481fd  CAMEL-12658 - Fixed CS
     new 0fe37ba  CAMEL-12658 - Updated docs and metadata for the new options
     new b2c3e35  CAMEL-12658 - Updated docs
     new a25b425  CAMEL-12658 - Fixed docs with IPStack

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/docs/weather-component.adoc           | 28 ++++++--
 .../camel/component/weather/WeatherComponent.java  | 49 +++++++++----
 .../component/weather/WeatherConfiguration.java    | 84 ++++++++++++++++------
 .../geolocation/FreeGeoIpGeoLocationProvider.java  | 13 +++-
 .../weather/CurrentWeatherConsumerHtmlTest.java    |  2 +-
 .../weather/CurrentWeatherMadridProducerTest.java  |  2 +-
 .../springboot/WeatherComponentConfiguration.java  | 25 +++++++
 7 files changed, 156 insertions(+), 47 deletions(-)


[camel] 03/05: CAMEL-12658 - Updated docs and metadata for the new options

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0fe37bac2e36250ab428f17af4a050c22dbc10c8
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 17 16:30:28 2018 +0200

    CAMEL-12658 - Updated docs and metadata for the new options
---
 components/camel-weather/src/main/docs/weather-component.adoc        | 5 +++--
 .../org/apache/camel/component/weather/WeatherConfiguration.java     | 4 +++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/components/camel-weather/src/main/docs/weather-component.adoc b/components/camel-weather/src/main/docs/weather-component.adoc
index d25f407..e7622e9 100644
--- a/components/camel-weather/src/main/docs/weather-component.adoc
+++ b/components/camel-weather/src/main/docs/weather-component.adoc
@@ -76,7 +76,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (44 parameters):
+==== Query Parameters (45 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -125,7 +125,8 @@ with the following path and query parameters:
 | *proxyAuthUsername* (proxy) | Username for proxy authentication |  | String
 | *proxyHost* (proxy) | The proxy host name |  | String
 | *proxyPort* (proxy) | The proxy port number |  | Integer
-| *geolocationAccessKey* (security) | The geolocation service now needs an accessKey to be used |  | String
+| *geolocationAccessKey* (security) | *Required* The geolocation service now needs an accessKey to be used |  | String
+| *geolocationRequestHostIP* (security) | *Required* The geolocation service now needs to specify the IP associated to the accessKey you're using |  | String
 |===
 // endpoint options: END
 
diff --git a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
index 5c372a0..70ba32f 100644
--- a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
+++ b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
@@ -94,8 +94,10 @@ public class WeatherConfiguration {
     @UriParam(label = "advanced")
     private HttpConnectionManager httpConnectionManager;
     @UriParam(label = "security")
+    @Metadata(required = "true")
     private String geolocationAccessKey;
-    @Metadata(label = "security")
+    @UriParam(label = "security")
+    @Metadata(required = "true")
     private String geolocationRequestHostIP;
 
     public WeatherConfiguration(WeatherComponent component) {


[camel] 05/05: CAMEL-12658 - Fixed docs with IPStack

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a25b4255c349f85e0740b01f2780f46b43706a76
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 17 16:34:28 2018 +0200

    CAMEL-12658 - Fixed docs with IPStack
---
 components/camel-weather/src/main/docs/weather-component.adoc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/components/camel-weather/src/main/docs/weather-component.adoc b/components/camel-weather/src/main/docs/weather-component.adoc
index 5f3fcf1..4d480cb 100644
--- a/components/camel-weather/src/main/docs/weather-component.adoc
+++ b/components/camel-weather/src/main/docs/weather-component.adoc
@@ -38,6 +38,12 @@ Since the 9th of October, an Api Key is required to access the
 openweather service. This key is passed as parameter to the URI
 definition of the weather endpoint using the appid paramĀ !
 
+### Geolocation provider
+
+Since July 2018 FreegeoIP is no longer available. The camel-weather component was using this API.
+We switch to https://github.com/apilayer/freegeoip#readme[IPstack] so you'll need to specify and Access Key and the IP 
+from where you're using the API now on.
+
 ### Options
 
 


[camel] 02/05: CAMEL-12658 - Fixed CS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 26481fd4f1f4d95a464d02d590fce170e8d0d44d
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 17 16:28:43 2018 +0200

    CAMEL-12658 - Fixed CS
---
 .../camel/component/weather/WeatherComponent.java  | 53 ++++++--------
 .../component/weather/WeatherConfiguration.java    | 84 ++++++++++++----------
 .../geolocation/FreeGeoIpGeoLocationProvider.java  |  7 +-
 3 files changed, 69 insertions(+), 75 deletions(-)

diff --git a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherComponent.java b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherComponent.java
index a49cd3a..14f4a23 100644
--- a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherComponent.java
+++ b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherComponent.java
@@ -42,7 +42,6 @@ public class WeatherComponent extends UriEndpointComponent {
     private String geolocationAccessKey;
     private String geolocationRequestHostIP;
 
-
     public WeatherComponent() {
         super(WeatherEndpoint.class);
     }
@@ -53,7 +52,7 @@ public class WeatherComponent extends UriEndpointComponent {
 
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
-    	WeatherConfiguration configuration = new WeatherConfiguration(this);
+        WeatherConfiguration configuration = new WeatherConfiguration(this);
 
         // and then override from parameters
         setProperties(configuration, parameters);
@@ -73,8 +72,7 @@ public class WeatherComponent extends UriEndpointComponent {
         HttpClient httpClient = new HttpClient(connectionManager);
 
         if (configuration.getProxyHost() != null && configuration.getProxyPort() != null) {
-            httpClient.getHostConfiguration().setProxy(configuration.getProxyHost(),
-                    configuration.getProxyPort());
+            httpClient.getHostConfiguration().setProxy(configuration.getProxyHost(), configuration.getProxyPort());
         }
 
         if (configuration.getProxyAuthUsername() != null && configuration.getProxyAuthMethod() == null) {
@@ -83,12 +81,8 @@ public class WeatherComponent extends UriEndpointComponent {
 
         CompositeHttpConfigurer configurer = new CompositeHttpConfigurer();
         if (configuration.getProxyAuthMethod() != null) {
-            configureProxyAuth(configurer,
-                    configuration.getProxyAuthMethod(),
-                    configuration.getProxyAuthUsername(),
-                    configuration.getProxyAuthPassword(),
-                    configuration.getProxyAuthDomain(),
-                    configuration.getProxyAuthHost());
+            configureProxyAuth(configurer, configuration.getProxyAuthMethod(), configuration.getProxyAuthUsername(), configuration.getProxyAuthPassword(),
+                               configuration.getProxyAuthDomain(), configuration.getProxyAuthHost());
         }
 
         configurer.configureHttpClient(httpClient);
@@ -96,12 +90,7 @@ public class WeatherComponent extends UriEndpointComponent {
         return httpClient;
     }
 
-    private HttpClientConfigurer configureProxyAuth(CompositeHttpConfigurer configurer,
-                                    String authMethod,
-                                    String username,
-                                    String password,
-                                    String domain,
-                                    String host) {
+    private HttpClientConfigurer configureProxyAuth(CompositeHttpConfigurer configurer, String authMethod, String username, String password, String domain, String host) {
         // no proxy auth is in use
         if (username == null && authMethod == null) {
             return configurer;
@@ -136,27 +125,27 @@ public class WeatherComponent extends UriEndpointComponent {
         return httpClient;
     }
 
-	public String getGeolocationAccessKey() {
-		return geolocationAccessKey;
-	}
-	
+    public String getGeolocationAccessKey() {
+        return geolocationAccessKey;
+    }
+
     /**
      * The geolocation service now needs an accessKey to be used
      */
-	public void setGeolocationAccessKey(String geolocationAccessKey) {
-		this.geolocationAccessKey = geolocationAccessKey;
-	}
+    public void setGeolocationAccessKey(String geolocationAccessKey) {
+        this.geolocationAccessKey = geolocationAccessKey;
+    }
 
-	public String getGeolocationRequestHostIP() {
-		return geolocationRequestHostIP;
-	}
+    public String getGeolocationRequestHostIP() {
+        return geolocationRequestHostIP;
+    }
 
     /**
-     * The geolocation service now needs to specify the IP associated to the accessKey you're using
+     * The geolocation service now needs to specify the IP associated to the
+     * accessKey you're using
      */
-	public void setGeolocationRequestHostIP(String geolocationRequestHostIP) {
-		this.geolocationRequestHostIP = geolocationRequestHostIP;
-	}
-	
+    public void setGeolocationRequestHostIP(String geolocationRequestHostIP) {
+        this.geolocationRequestHostIP = geolocationRequestHostIP;
+    }
 
-}
\ No newline at end of file
+}
diff --git a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
index 92e90c6..5c372a0 100644
--- a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
+++ b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
@@ -40,9 +40,11 @@ public class WeatherConfiguration {
     private final WeatherComponent component;
     private final WeatherQuery weatherQuery;
 
-    @UriPath(description = "The name value is not used.") @Metadata(required = "true")
+    @UriPath(description = "The name value is not used.")
+    @Metadata(required = "true")
     private String name;
-    @UriParam @Metadata(required = "true")
+    @UriParam
+    @Metadata(required = "true")
     private String appid;
     @UriParam
     private WeatherApi weatherApi;
@@ -108,8 +110,10 @@ public class WeatherConfiguration {
     }
 
     /**
-     * If null, the current weather will be returned, else use values of 5, 7, 14 days.
-     * Only the numeric value for the forecast period is actually parsed, so spelling, capitalisation of the time period is up to you (its ignored)
+     * If null, the current weather will be returned, else use values of 5, 7,
+     * 14 days. Only the numeric value for the forecast period is actually
+     * parsed, so spelling, capitalisation of the time period is up to you (its
+     * ignored)
      */
     public void setPeriod(String period) {
         notNull(period, "period");
@@ -159,11 +163,14 @@ public class WeatherConfiguration {
     }
 
     /**
-     * If null Camel will try and determine your current location using the geolocation of your ip address,
-     * else specify the city,country. For well known city names, Open Weather Map will determine the best fit,
-     * but multiple results may be returned. Hence specifying and country as well will return more accurate data.
-     * If you specify "current" as the location then the component will try to get the current latitude and longitude
-     * and use that to get the weather details. You can use lat and lon options instead of location.
+     * If null Camel will try and determine your current location using the
+     * geolocation of your ip address, else specify the city,country. For well
+     * known city names, Open Weather Map will determine the best fit, but
+     * multiple results may be returned. Hence specifying and country as well
+     * will return more accurate data. If you specify "current" as the location
+     * then the component will try to get the current latitude and longitude and
+     * use that to get the weather details. You can use lat and lon options
+     * instead of location.
      */
     public void setLocation(String location) {
         this.location = location;
@@ -174,7 +181,8 @@ public class WeatherConfiguration {
     }
 
     /**
-     * To store the weather result in this header instead of the message body. This is useable if you want to keep current message body as-is.
+     * To store the weather result in this header instead of the message body.
+     * This is useable if you want to keep current message body as-is.
      */
     public void setHeaderName(String headerName) {
         this.headerName = headerName;
@@ -185,8 +193,8 @@ public class WeatherConfiguration {
     }
 
     /**
-     * Latitude of location. You can use lat and lon options instead of location.
-     * For boxed queries this is the bottom latitude.
+     * Latitude of location. You can use lat and lon options instead of
+     * location. For boxed queries this is the bottom latitude.
      */
     public void setLat(String lat) {
         this.lat = lat;
@@ -197,13 +205,13 @@ public class WeatherConfiguration {
     }
 
     /**
-     * Longitude of location. You can use lat and lon options instead of location.
-     * For boxed queries this is the left longtitude.
+     * Longitude of location. You can use lat and lon options instead of
+     * location. For boxed queries this is the left longtitude.
      */
     public void setLon(String lon) {
         this.lon = lon;
     }
-    
+
     /**
      * APPID ID used to authenticate the user connected to the API Server
      */
@@ -239,8 +247,8 @@ public class WeatherConfiguration {
     }
 
     /**
-     * For boxed queries this is the right longtitude. Needs to be used
-     * in combination with topLat and zoom.
+     * For boxed queries this is the right longtitude. Needs to be used in
+     * combination with topLat and zoom.
      */
     public void setRightLon(String rightLon) {
         this.rightLon = rightLon;
@@ -251,8 +259,8 @@ public class WeatherConfiguration {
     }
 
     /**
-     * For boxed queries this is the top latitude. Needs to be used
-     * in combination with rightLon and zoom.
+     * For boxed queries this is the top latitude. Needs to be used in
+     * combination with rightLon and zoom.
      */
     public void setTopLat(String topLat) {
         this.topLat = topLat;
@@ -263,8 +271,8 @@ public class WeatherConfiguration {
     }
 
     /**
-     * For boxed queries this is the zoom. Needs to be used
-     * in combination with rightLon and topLat.
+     * For boxed queries this is the zoom. Needs to be used in combination with
+     * rightLon and topLat.
      */
     public void setZoom(Integer zoom) {
         this.zoom = zoom;
@@ -382,7 +390,7 @@ public class WeatherConfiguration {
         }
         Iterator<?> it = ObjectHelper.createIterator(id);
         while (it.hasNext()) {
-            String myId = (String) it.next();
+            String myId = (String)it.next();
             ids.add(myId);
         }
     }
@@ -413,26 +421,26 @@ public class WeatherConfiguration {
         this.weatherApi = weatherApi;
     }
 
-	public String getGeolocationAccessKey() {
-		return geolocationAccessKey;
-	}
-
+    public String getGeolocationAccessKey() {
+        return geolocationAccessKey;
+    }
 
     /**
      * The geolocation service now needs an accessKey to be used
      */
-	public void setGeolocationAccessKey(String geolocationAccessKey) {
-		this.geolocationAccessKey = geolocationAccessKey;
-	}
-
-	public String getGeolocationRequestHostIP() {
-		return geolocationRequestHostIP;
-	}
-	
+    public void setGeolocationAccessKey(String geolocationAccessKey) {
+        this.geolocationAccessKey = geolocationAccessKey;
+    }
+
+    public String getGeolocationRequestHostIP() {
+        return geolocationRequestHostIP;
+    }
+
     /**
-     * The geolocation service now needs to specify the IP associated to the accessKey you're using
+     * The geolocation service now needs to specify the IP associated to the
+     * accessKey you're using
      */
-	public void setGeolocationRequestHostIP(String geolocationRequestHostIP) {
-		this.geolocationRequestHostIP = geolocationRequestHostIP;
-	}
+    public void setGeolocationRequestHostIP(String geolocationRequestHostIP) {
+        this.geolocationRequestHostIP = geolocationRequestHostIP;
+    }
 }
diff --git a/components/camel-weather/src/main/java/org/apache/camel/component/weather/geolocation/FreeGeoIpGeoLocationProvider.java b/components/camel-weather/src/main/java/org/apache/camel/component/weather/geolocation/FreeGeoIpGeoLocationProvider.java
index e0ae56b..a896107 100644
--- a/components/camel-weather/src/main/java/org/apache/camel/component/weather/geolocation/FreeGeoIpGeoLocationProvider.java
+++ b/components/camel-weather/src/main/java/org/apache/camel/component/weather/geolocation/FreeGeoIpGeoLocationProvider.java
@@ -45,11 +45,8 @@ public class FreeGeoIpGeoLocationProvider implements GeoLocationProvider {
             throw new IllegalStateException("The geolocation service requires a mandatory geolocationRequestHostIP");
         }
         GetMethod getMethod = new GetMethod("http://api.ipstack.com/" + component.getGeolocationRequestHostIP());
-        getMethod.setQueryString(new NameValuePair[] { 
-        	    new NameValuePair("access_key", component.getGeolocationAccessKey()),
-        	    new NameValuePair("legacy", "1"),
-        	    new NameValuePair("output", "json")
-        	}); 
+        getMethod.setQueryString(new NameValuePair[] {new NameValuePair("access_key", component.getGeolocationAccessKey()), new NameValuePair("legacy", "1"),
+                                                      new NameValuePair("output", "json")});
         try {
             int statusCode = httpClient.executeMethod(getMethod);
             if (statusCode != HttpStatus.SC_OK) {


[camel] 04/05: CAMEL-12658 - Updated docs

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b2c3e3543aba51bbe3f1f7dfe5c055b5838baf39
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 17 16:32:05 2018 +0200

    CAMEL-12658 - Updated docs
---
 components/camel-weather/src/main/docs/weather-component.adoc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/components/camel-weather/src/main/docs/weather-component.adoc b/components/camel-weather/src/main/docs/weather-component.adoc
index e7622e9..5f3fcf1 100644
--- a/components/camel-weather/src/main/docs/weather-component.adoc
+++ b/components/camel-weather/src/main/docs/weather-component.adoc
@@ -157,7 +157,7 @@ In this sample we find the 7 day weather forecast for Madrid, Spain:
 
 [source,java]
 ---------------------------------------------------------------------------------------------
-from("weather:foo?location=Madrid,Spain&period=7 days&appid=APIKEY").to("jms:queue:weather");
+from("weather:foo?location=Madrid,Spain&period=7 days&appid=APIKEY&geolocationAccessKey=IPSTACK_ACCESS_KEY&geolocationRequestHostIP=LOCAL_IP").to("jms:queue:weather");
 ---------------------------------------------------------------------------------------------
 
 To just find the current weather for your current location you can use
@@ -165,7 +165,7 @@ this:
 
 [source,java]
 ---------------------------------------------------------
-from("weather:foo?appid=APIKEY").to("jms:queue:weather");
+from("weather:foo?appid=APIKEY&geolocationAccessKey=IPSTACK_ACCESS_KEY&geolocationRequestHostIP=LOCAL_IP").to("jms:queue:weather");
 ---------------------------------------------------------
 
 And to find the weather using the producer we do:
@@ -173,7 +173,7 @@ And to find the weather using the producer we do:
 [source,java]
 --------------------------------------------------------
 from("direct:start")
-  .to("weather:foo?location=Madrid,Spain&appid=APIKEY");
+  .to("weather:foo?location=Madrid,Spain&appid=APIKEY&geolocationAccessKey=IPSTACK_ACCESS_KEY&geolocationRequestHostIP=LOCAL_IP");
 --------------------------------------------------------
 
 And we can send in a message with a header to get the weather for any


[camel] 01/05: CAMEL-12658 - camel-weather: Freegeoip service is no longer avaiable, we need to switch to apilayer IPstack

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 097a16ca6de1ce878119bc0c0927e69a981f82cc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 17 16:27:04 2018 +0200

    CAMEL-12658 - camel-weather: Freegeoip service is no longer avaiable, we need to switch to apilayer IPstack
---
 .../src/main/docs/weather-component.adoc           | 15 ++++++++--
 .../camel/component/weather/WeatherComponent.java  | 32 +++++++++++++++++++++-
 .../component/weather/WeatherConfiguration.java    | 30 +++++++++++++++++++-
 .../geolocation/FreeGeoIpGeoLocationProvider.java  | 16 +++++++++--
 .../weather/CurrentWeatherConsumerHtmlTest.java    |  2 +-
 .../weather/CurrentWeatherMadridProducerTest.java  |  2 +-
 .../springboot/WeatherComponentConfiguration.java  | 25 +++++++++++++++++
 7 files changed, 114 insertions(+), 8 deletions(-)

diff --git a/components/camel-weather/src/main/docs/weather-component.adoc b/components/camel-weather/src/main/docs/weather-component.adoc
index dc0c155..d25f407 100644
--- a/components/camel-weather/src/main/docs/weather-component.adoc
+++ b/components/camel-weather/src/main/docs/weather-component.adoc
@@ -42,7 +42,17 @@ definition of the weather endpoint using the appid paramĀ !
 
 
 // component options: START
-The Weather component has no options.
+The Weather component supports 3 options, which are listed below.
+
+
+
+[width="100%",cols="2,5,^1,2",options="header"]
+|===
+| Name | Description | Default | Type
+| *geolocationAccessKey* (common) | The geolocation service now needs an accessKey to be used |  | String
+| *geolocationRequestHost IP* (common) | The geolocation service now needs to specify the IP associated to the accessKey you're using |  | String
+| *resolveProperty Placeholders* (advanced) | Whether the component should resolve property placeholders on itself when starting. Only properties which are of String type can use property placeholders. | true | boolean
+|===
 // component options: END
 
 
@@ -66,7 +76,7 @@ with the following path and query parameters:
 |===
 
 
-==== Query Parameters (43 parameters):
+==== Query Parameters (44 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -115,6 +125,7 @@ with the following path and query parameters:
 | *proxyAuthUsername* (proxy) | Username for proxy authentication |  | String
 | *proxyHost* (proxy) | The proxy host name |  | String
 | *proxyPort* (proxy) | The proxy port number |  | Integer
+| *geolocationAccessKey* (security) | The geolocation service now needs an accessKey to be used |  | String
 |===
 // endpoint options: END
 
diff --git a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherComponent.java b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherComponent.java
index 557af0f..a49cd3a 100644
--- a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherComponent.java
+++ b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherComponent.java
@@ -25,6 +25,7 @@ import org.apache.camel.component.weather.http.AuthenticationMethod;
 import org.apache.camel.component.weather.http.CompositeHttpConfigurer;
 import org.apache.camel.component.weather.http.HttpClientConfigurer;
 import org.apache.camel.impl.UriEndpointComponent;
+import org.apache.camel.spi.Metadata;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpConnectionManager;
@@ -38,6 +39,9 @@ import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 public class WeatherComponent extends UriEndpointComponent {
 
     private HttpClient httpClient;
+    private String geolocationAccessKey;
+    private String geolocationRequestHostIP;
+
 
     public WeatherComponent() {
         super(WeatherEndpoint.class);
@@ -49,12 +53,14 @@ public class WeatherComponent extends UriEndpointComponent {
 
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
-        WeatherConfiguration configuration = new WeatherConfiguration(this);
+    	WeatherConfiguration configuration = new WeatherConfiguration(this);
 
         // and then override from parameters
         setProperties(configuration, parameters);
 
         httpClient = createHttpClient(configuration);
+        geolocationAccessKey = configuration.getGeolocationAccessKey();
+        geolocationRequestHostIP = configuration.getGeolocationRequestHostIP();
         WeatherEndpoint endpoint = new WeatherEndpoint(uri, this, configuration);
         return endpoint;
     }
@@ -129,4 +135,28 @@ public class WeatherComponent extends UriEndpointComponent {
     public HttpClient getHttpClient() {
         return httpClient;
     }
+
+	public String getGeolocationAccessKey() {
+		return geolocationAccessKey;
+	}
+	
+    /**
+     * The geolocation service now needs an accessKey to be used
+     */
+	public void setGeolocationAccessKey(String geolocationAccessKey) {
+		this.geolocationAccessKey = geolocationAccessKey;
+	}
+
+	public String getGeolocationRequestHostIP() {
+		return geolocationRequestHostIP;
+	}
+
+    /**
+     * The geolocation service now needs to specify the IP associated to the accessKey you're using
+     */
+	public void setGeolocationRequestHostIP(String geolocationRequestHostIP) {
+		this.geolocationRequestHostIP = geolocationRequestHostIP;
+	}
+	
+
 }
\ No newline at end of file
diff --git a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
index 36feb71..92e90c6 100644
--- a/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
+++ b/components/camel-weather/src/main/java/org/apache/camel/component/weather/WeatherConfiguration.java
@@ -21,6 +21,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Scanner;
 
+import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.component.weather.geolocation.FreeGeoIpGeoLocationProvider;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
@@ -90,11 +91,15 @@ public class WeatherConfiguration {
     private String proxyAuthHost;
     @UriParam(label = "advanced")
     private HttpConnectionManager httpConnectionManager;
+    @UriParam(label = "security")
+    private String geolocationAccessKey;
+    @Metadata(label = "security")
+    private String geolocationRequestHostIP;
 
     public WeatherConfiguration(WeatherComponent component) {
         this.component = notNull(component, "component");
         weatherQuery = new WeatherQuery(this);
-        FreeGeoIpGeoLocationProvider geoLocationProvider = new FreeGeoIpGeoLocationProvider(component);
+        FreeGeoIpGeoLocationProvider geoLocationProvider = new FreeGeoIpGeoLocationProvider(component, geolocationAccessKey);
         weatherQuery.setGeoLocationProvider(geoLocationProvider);
     }
 
@@ -407,4 +412,27 @@ public class WeatherConfiguration {
     public void setWeatherApi(WeatherApi weatherApi) {
         this.weatherApi = weatherApi;
     }
+
+	public String getGeolocationAccessKey() {
+		return geolocationAccessKey;
+	}
+
+
+    /**
+     * The geolocation service now needs an accessKey to be used
+     */
+	public void setGeolocationAccessKey(String geolocationAccessKey) {
+		this.geolocationAccessKey = geolocationAccessKey;
+	}
+
+	public String getGeolocationRequestHostIP() {
+		return geolocationRequestHostIP;
+	}
+	
+    /**
+     * The geolocation service now needs to specify the IP associated to the accessKey you're using
+     */
+	public void setGeolocationRequestHostIP(String geolocationRequestHostIP) {
+		this.geolocationRequestHostIP = geolocationRequestHostIP;
+	}
 }
diff --git a/components/camel-weather/src/main/java/org/apache/camel/component/weather/geolocation/FreeGeoIpGeoLocationProvider.java b/components/camel-weather/src/main/java/org/apache/camel/component/weather/geolocation/FreeGeoIpGeoLocationProvider.java
index 6c41bf3..e0ae56b 100644
--- a/components/camel-weather/src/main/java/org/apache/camel/component/weather/geolocation/FreeGeoIpGeoLocationProvider.java
+++ b/components/camel-weather/src/main/java/org/apache/camel/component/weather/geolocation/FreeGeoIpGeoLocationProvider.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.weather.geolocation;
 import org.apache.camel.component.weather.WeatherComponent;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.NameValuePair;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.codehaus.jackson.JsonNode;
 import org.codehaus.jackson.map.ObjectMapper;
@@ -30,14 +31,25 @@ public class FreeGeoIpGeoLocationProvider implements GeoLocationProvider {
 
     private final WeatherComponent component;
 
-    public FreeGeoIpGeoLocationProvider(WeatherComponent component) {
+    public FreeGeoIpGeoLocationProvider(WeatherComponent component, String accessKey) {
         this.component = component;
     }
 
     @Override
     public GeoLocation getCurrentGeoLocation() throws Exception {
         HttpClient httpClient = component.getHttpClient();
-        GetMethod getMethod = new GetMethod("https://freegeoip.net/json/");
+        if (isEmpty(component.getGeolocationAccessKey())) {
+            throw new IllegalStateException("The geolocation service requires a mandatory geolocationAccessKey");
+        }
+        if (isEmpty(component.getGeolocationRequestHostIP())) {
+            throw new IllegalStateException("The geolocation service requires a mandatory geolocationRequestHostIP");
+        }
+        GetMethod getMethod = new GetMethod("http://api.ipstack.com/" + component.getGeolocationRequestHostIP());
+        getMethod.setQueryString(new NameValuePair[] { 
+        	    new NameValuePair("access_key", component.getGeolocationAccessKey()),
+        	    new NameValuePair("legacy", "1"),
+        	    new NameValuePair("output", "json")
+        	}); 
         try {
             int statusCode = httpClient.executeMethod(getMethod);
             if (statusCode != HttpStatus.SC_OK) {
diff --git a/components/camel-weather/src/test/java/org/apache/camel/component/weather/CurrentWeatherConsumerHtmlTest.java b/components/camel-weather/src/test/java/org/apache/camel/component/weather/CurrentWeatherConsumerHtmlTest.java
index ebb0ec5..8e5317d 100644
--- a/components/camel-weather/src/test/java/org/apache/camel/component/weather/CurrentWeatherConsumerHtmlTest.java
+++ b/components/camel-weather/src/test/java/org/apache/camel/component/weather/CurrentWeatherConsumerHtmlTest.java
@@ -35,7 +35,7 @@ public class CurrentWeatherConsumerHtmlTest extends BaseWeatherConsumerTest {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("weather:foo?mode=HTML&appid=9162755b2efa555823cfe0451d7fff38").to("mock:result");
+                from("weather:foo?mode=HTML&appid=9162755b2efa555823cfe0451d7fff38&geolocationAccessKey=test&geolocationRequestHostIP=test").to("mock:result");
             }
         };
     }
diff --git a/components/camel-weather/src/test/java/org/apache/camel/component/weather/CurrentWeatherMadridProducerTest.java b/components/camel-weather/src/test/java/org/apache/camel/component/weather/CurrentWeatherMadridProducerTest.java
index 61b7dc6..787dff9 100644
--- a/components/camel-weather/src/test/java/org/apache/camel/component/weather/CurrentWeatherMadridProducerTest.java
+++ b/components/camel-weather/src/test/java/org/apache/camel/component/weather/CurrentWeatherMadridProducerTest.java
@@ -89,7 +89,7 @@ public class CurrentWeatherMadridProducerTest extends BaseWeatherConsumerTest {
                 
                 /* The Camel Route uses the apache-camel appid to access the openweathermap service */
                 from("direct:start")
-                    .to("weather:foo?location=Madrid,Spain&appid=9162755b2efa555823cfe0451d7fff38")
+                    .to("weather:foo?location=Madrid,Spain&appid=9162755b2efa555823cfe0451d7fff38&geolocationAccessKey=test&geolocationRequestHostIP=test")
                     .to("mock:result");
             }
         };
diff --git a/platforms/spring-boot/components-starter/camel-weather-starter/src/main/java/org/apache/camel/component/weather/springboot/WeatherComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-weather-starter/src/main/java/org/apache/camel/component/weather/springboot/WeatherComponentConfiguration.java
index 8cf8bb1..1d0ce50 100644
--- a/platforms/spring-boot/components-starter/camel-weather-starter/src/main/java/org/apache/camel/component/weather/springboot/WeatherComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-weather-starter/src/main/java/org/apache/camel/component/weather/springboot/WeatherComponentConfiguration.java
@@ -32,12 +32,37 @@ public class WeatherComponentConfiguration
             ComponentConfigurationPropertiesCommon {
 
     /**
+     * The geolocation service now needs an accessKey to be used
+     */
+    private String geolocationAccessKey;
+    /**
+     * The geolocation service now needs to specify the IP associated to the
+     * accessKey you're using
+     */
+    private String geolocationRequestHostIP;
+    /**
      * Whether the component should resolve property placeholders on itself when
      * starting. Only properties which are of String type can use property
      * placeholders.
      */
     private Boolean resolvePropertyPlaceholders = true;
 
+    public String getGeolocationAccessKey() {
+        return geolocationAccessKey;
+    }
+
+    public void setGeolocationAccessKey(String geolocationAccessKey) {
+        this.geolocationAccessKey = geolocationAccessKey;
+    }
+
+    public String getGeolocationRequestHostIP() {
+        return geolocationRequestHostIP;
+    }
+
+    public void setGeolocationRequestHostIP(String geolocationRequestHostIP) {
+        this.geolocationRequestHostIP = geolocationRequestHostIP;
+    }
+
     public Boolean getResolvePropertyPlaceholders() {
         return resolvePropertyPlaceholders;
     }