Montag, 3. Februar 2014

Provide location based weather data

OpenWeatherMap.org has a great simple REST API for current weather and weather forecast. My goal was to use this API to provide weather information for the map area wich a user is looking at.

My requirements were:
  1. Asynchronous integration through messaging to avoid any performance impact.
  2. Reduce service calls to OpenWeatherMap.org API, since weather does not change any 10 mintes and is not different any 100 meters. 


There result is the architecture above. The clients are sending geo coordinates to a topic and can fetch the current weather information and weather forecast from a different topic, filtered by their client ID.

Works pretty well, the amount of requests to the OpenWeatherMap API is reduced by approximately 80% by using ehcache. I store weather information as JSON String in-memory in Ehcache which guarantees  very fast data access times.





Keine Kommentare:

Kommentar veröffentlichen