This project aims to expose a spring integration based rest API. This rest API receives an address as a single string and sends this string to an activemq endpoint (queue). Since the message arrives in the activemq queue a camel route captures the receiving message and call the google maps geocoding api. The returned xml is marshalled into a pojo containing the formatted address and its location (latitude and longitute).
Before running the project, we need to have an ActiveMQ instance up and running:
- Download ActiveMQ http://activemq.apache.org/activemq-5157-release.html
- Unzip and run
activemq start
in thebin
folder. (Port 61616 will be used)
Run the source code.
- Simply run
./mvnw spring-boot:run -Dgoogle_api_key={{YOUR_GOOGLE_API_KEY}}
under the root folder (Port 8080 will be used). - Test the application: GET <localhost:8080/api/geocode?address=New York, NY>