You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Gandhi, Vineet" <vi...@optum.com> on 2019/01/09 14:26:50 UTC

Camel weather component

Hi,

I was going through this component and checked the https://openweathermap.org/api.
Some new API’s are introduced like
https://openweathermap.org/api/uvi

https://openweathermap.org/api/pollution/co

I was thinking of adding those support. Also code can be made more robust I feel.
Please revert back.

Regards,
Vineet

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.

Re: Camel weather component

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

There could be a weather-uv and weather-airpollution component in the
same JAR, eg camel-weather.
Then they can be a bit more separated, and have different options if needed.

I assume the UV and airpollution json data is diffrent than the
weather data, and therefore it can be make sense as you suggest to
create new components. But we can just keep them in the same JAR.

On Thu, Jan 10, 2019 at 2:06 PM Gandhi, Vineet <vi...@optum.com> wrote:
>
> Hi,
>
> While implementing the mentioned API’s I have a doubt in terms of design.
>
>
>   1.  If we see the component it says component will provide weather details using some 3rd party API. Now UV Index and air pollution don’t exactly fit in the component description say as subcomponent of weather.
>   2.  If we see the weatherConsumer example :
>
> from("weather:foo?location=Madrid,Spain&period=7 days&appid=APIKEY").to("jms:queue:weather");
> here options signify filtering to be done for weather i.e. current location, zipcode, bbox.
> Now in order to support the new API’s for UV and air pollution it doesn’t sound right in my perspective to give them as an option parameter
> or even if we do we have to give something like “isUV=true”.
>
> URI for weather : api.openweathermap.org/data/2.5/weather?q={city name},{country code}
> URI for UV Index : http://api.openweathermap.org/data/2.5/uvi?appid={appid}&lat={lat}&lon={lon}
>
> As we see above the path is different.
> Please guide for the correct behaviour.
>
> Regards,
> Vineet
>
> From: Andrea Cosentino <an...@yahoo.com>
> Reply-To: "ancosen1985@yahoo.com" <an...@yahoo.com>
> Date: Wednesday, 9 January 2019 at 10:48 PM
> To: "dev@camel.apache.org" <de...@camel.apache.org>, "Gandhi, Vineet" <vi...@optum.com>, "dev@camel.apache.org" <de...@camel.apache.org>
> Subject: R: Camel weather component
>
> Contributions are always welcome :-)
> Inviato da Yahoo Mail su Android<https://go.onelink.me/107872968?pid=InProduct&c=Global_Internal_YGrowth_AndroidEmailSig__AndroidUsers&af_wl=ym&af_sub1=Internal&af_sub2=Global_YGrowth&af_sub3=EmailSignature>
>
> Il mer, 9 gen, 2019 alle 17:54, Gandhi, Vineet
> <vi...@optum.com> ha scritto:
> Hi,
>
> I was going through this component and checked the https://openweathermap.org/api.
> Some new API’s are introduced like
> https://openweathermap.org/api/uvi
>
> https://openweathermap.org/api/pollution/co
>
> I was thinking of adding those support. Also code can be made more robust I feel.
> Please revert back.
>
> Regards,
> Vineet
>
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity
> to which it is addressed. If the reader of this e-mail is not the intended
> recipient or his or her authorized agent, the reader is hereby notified
> that any dissemination, distribution or copying of this e-mail is
> prohibited. If you have received this e-mail in error, please notify the
> sender by replying to this message and delete this e-mail immediately.
>
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity
> to which it is addressed. If the reader of this e-mail is not the intended
> recipient or his or her authorized agent, the reader is hereby notified
> that any dissemination, distribution or copying of this e-mail is
> prohibited. If you have received this e-mail in error, please notify the
> sender by replying to this message and delete this e-mail immediately.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel weather component

Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
There is no need to post the same message multiple times...

You'll probably need to set a flag for different kind of queries and use a filter somewhere.

This is not completely easy to do, weather component is really old and it's not very keen to improvement/enhancement/new features introduction.

--
Andrea Cosentino 
----------------------------------
Apache Camel PMC Chair
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ancosen1985@yahoo.com
Twitter: @oscerd2
Github: oscerd






On Thursday, January 10, 2019, 2:06:08 PM GMT+1, Gandhi, Vineet <vi...@optum.com> wrote: 





Hi,

While implementing the mentioned API’s I have a doubt in terms of design.


  1.  If we see the component it says component will provide weather details using some 3rd party API. Now UV Index and air pollution don’t exactly fit in the component description say as subcomponent of weather.
  2.  If we see the weatherConsumer example :

from("weather:foo?location=Madrid,Spain&period=7 days&appid=APIKEY").to("jms:queue:weather");
here options signify filtering to be done for weather i.e. current location, zipcode, bbox.
Now in order to support the new API’s for UV and air pollution it doesn’t sound right in my perspective to give them as an option parameter
or even if we do we have to give something like “isUV=true”.

URI for weather : api.openweathermap.org/data/2.5/weather?q={city name},{country code}
URI for UV Index : http://api.openweathermap.org/data/2.5/uvi?appid={appid}&lat={lat}&lon={lon}

As we see above the path is different.
Please guide for the correct behaviour.

Regards,
Vineet

From: Andrea Cosentino <an...@yahoo.com>
Reply-To: "ancosen1985@yahoo.com" <an...@yahoo.com>
Date: Wednesday, 9 January 2019 at 10:48 PM
To: "dev@camel.apache.org" <de...@camel.apache.org>, "Gandhi, Vineet" <vi...@optum.com>, "dev@camel.apache.org" <de...@camel.apache.org>
Subject: R: Camel weather component

Contributions are always welcome :-)
Inviato da Yahoo Mail su Android<https://go.onelink.me/107872968?pid=InProduct&c=Global_Internal_YGrowth_AndroidEmailSig__AndroidUsers⁡_wl=ym⁡_sub1=Internal⁡_sub2=Global_YGrowth⁡_sub3=EmailSignature>

Il mer, 9 gen, 2019 alle 17:54, Gandhi, Vineet
<vi...@optum.com> ha scritto:
Hi,

I was going through this component and checked the https://openweathermap.org/api.
Some new API’s are introduced like
https://openweathermap.org/api/uvi

https://openweathermap.org/api/pollution/co

I was thinking of adding those support. Also code can be made more robust I feel.
Please revert back.

Regards,
Vineet

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.

Re: Camel weather component

Posted by "Gandhi, Vineet" <vi...@optum.com>.
Hi,

Thanks for the guidance.

Currently I am going ahead with creating two components approach as weather-uv and weather-airpollution.

I will be pushing the common code in one package and extend the specific attributes in packages specific to weather,UV and pollution components.

I was also trying to think is there any way we can write the enpoint side code decoupled to the actual vendor used for getting weather information i.e openweathermap currently?

I see the configuration object(WeatherConfiguration) is coupled to the inputs required by the vendor filters required.
I was thinking of creating a middleware i.e. a service say, WeatherService which fetches the data and client and specify the filters for the data which can then be added to the URI (http://api.openweathermap.org/data/2.5/).

Maybe this is not how things work in camel. So any guidance will make things more clear to me.

Regards,
Vineet

From: "Gandhi, Vineet" <vi...@optum.com>
Date: Thursday, 10 January 2019 at 5:00 PM
To: "ancosen1985@yahoo.com" <an...@yahoo.com>, "dev@camel.apache.org" <de...@camel.apache.org>
Subject: Re: Camel weather component

Hi,

While implementing the mentioned API’s I have a doubt in terms of design.


  1.  If we see the component it says component will provide weather details using some 3rd party API. Now UV Index and air pollution don’t exactly fit in the component description say as subcomponent of weather.
  2.  If we see the weatherConsumer example :

from("weather:foo?location=Madrid,Spain&period=7 days&appid=APIKEY").to("jms:queue:weather");
here options signify filtering to be done for weather i.e. current location, zipcode, bbox.
Now in order to support the new API’s for UV and air pollution it doesn’t sound right in my perspective to give them as an option parameter
or even if we do we have to give something like “isUV=true”.

URI for weather : api.openweathermap.org/data/2.5/weather?q={city name},{country code}
URI for UV Index : http://api.openweathermap.org/data/2.5/uvi?appid={appid}&lat={lat}&lon={lon}

As we see above the path is different.
Please guide for the correct behaviour.

Regards,
Vineet

From: Andrea Cosentino <an...@yahoo.com>
Reply-To: "ancosen1985@yahoo.com" <an...@yahoo.com>
Date: Wednesday, 9 January 2019 at 10:48 PM
To: "dev@camel.apache.org" <de...@camel.apache.org>, "Gandhi, Vineet" <vi...@optum.com>, "dev@camel.apache.org" <de...@camel.apache.org>
Subject: R: Camel weather component

Contributions are always welcome :-)
Inviato da Yahoo Mail su Android<https://go.onelink.me/107872968?pid=InProduct&c=Global_Internal_YGrowth_AndroidEmailSig__AndroidUsers&af_wl=ym&af_sub1=Internal&af_sub2=Global_YGrowth&af_sub3=EmailSignature>

Il mer, 9 gen, 2019 alle 17:54, Gandhi, Vineet
<vi...@optum.com> ha scritto:
Hi,

I was going through this component and checked the https://openweathermap.org/api.
Some new API’s are introduced like
https://openweathermap.org/api/uvi

https://openweathermap.org/api/pollution/co

I was thinking of adding those support. Also code can be made more robust I feel.
Please revert back.

Regards,
Vineet

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.

Re: Camel weather component

Posted by "Gandhi, Vineet" <vi...@optum.com>.
Hi,

While implementing the mentioned API’s I have a doubt in terms of design.


  1.  If we see the component it says component will provide weather details using some 3rd party API. Now UV Index and air pollution don’t exactly fit in the component description say as subcomponent of weather.
  2.  If we see the weatherConsumer example :

from("weather:foo?location=Madrid,Spain&period=7 days&appid=APIKEY").to("jms:queue:weather");
here options signify filtering to be done for weather i.e. current location, zipcode, bbox.
Now in order to support the new API’s for UV and air pollution it doesn’t sound right in my perspective to give them as an option parameter
or even if we do we have to give something like “isUV=true”.

URI for weather : api.openweathermap.org/data/2.5/weather?q={city name},{country code}
URI for UV Index : http://api.openweathermap.org/data/2.5/uvi?appid={appid}&lat={lat}&lon={lon}

As we see above the path is different.
Please guide for the correct behaviour.

Regards,
Vineet

From: Andrea Cosentino <an...@yahoo.com>
Reply-To: "ancosen1985@yahoo.com" <an...@yahoo.com>
Date: Wednesday, 9 January 2019 at 10:48 PM
To: "dev@camel.apache.org" <de...@camel.apache.org>, "Gandhi, Vineet" <vi...@optum.com>, "dev@camel.apache.org" <de...@camel.apache.org>
Subject: R: Camel weather component

Contributions are always welcome :-)
Inviato da Yahoo Mail su Android<https://go.onelink.me/107872968?pid=InProduct&c=Global_Internal_YGrowth_AndroidEmailSig__AndroidUsers&af_wl=ym&af_sub1=Internal&af_sub2=Global_YGrowth&af_sub3=EmailSignature>

Il mer, 9 gen, 2019 alle 17:54, Gandhi, Vineet
<vi...@optum.com> ha scritto:
Hi,

I was going through this component and checked the https://openweathermap.org/api.
Some new API’s are introduced like
https://openweathermap.org/api/uvi

https://openweathermap.org/api/pollution/co

I was thinking of adding those support. Also code can be made more robust I feel.
Please revert back.

Regards,
Vineet

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.

R: Camel weather component

Posted by Andrea Cosentino <an...@yahoo.com.INVALID>.
Contributions are always welcome :-)

Inviato da Yahoo Mail su Android 
 
  Il mer, 9 gen, 2019 alle 17:54, Gandhi, Vineet<vi...@optum.com> ha scritto:   Hi,

I was going through this component and checked the https://openweathermap.org/api.
Some new API’s are introduced like
https://openweathermap.org/api/uvi

https://openweathermap.org/api/pollution/co

I was thinking of adding those support. Also code can be made more robust I feel.
Please revert back.

Regards,
Vineet

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.