- Write a service which exposes a Rest API endpoint, Internally this service adds the request to the queue and returns a "200" response. (Acts as message producer to the queue).
- Write a message consumer service which consumes the message and calls a third party API.
- Consumers will have the rate limiter for the calls to third party API.
- Take care of logging to console the status of system, security and performance etc.
This is gradle and springboot based multi module project. Java 13 version is used.
There is only one API post enpoint exposed at http://{ip}:8080/v0/accept
There is a seperate module for consumer of messages. Code for consumer module is in "Consumer" folder.
Other modules such as DTO, Consumer, Converter, Model and Services are shared modules.
#Steps To Run The Project
To run the project from command line go to parent directory i.e Lightbox and run the command
gradle Rest:bootRun
Post:/v0/accept RequestBody: { "msg": "Testing" } Returns 200 Response
To run consumer navigate to parent directory i.e "Lightbox" and run the below command.
gradle Rest:bootRun
If using Intellij, It has the click to run the options in Gradle navigation panel.
A free version of Rabbit MQ is deployed in cloud and can be accessed for a few more days. So you can run the application with java and gradle installed in the system, without any blocker