Reputation: 427
I'm building a web application using Java/Spring Boot for the backend and uses Angular 5 for the front-end. I don't think the tech stack matters for this question.
The key part is that I have a requirement for the backend to poll several RESTful APIs to retrieve data, store and do various analytics on this data in the future. For now it's mostly just simple reporting.
At the moment I haven't tried to construct a microservices approach. The application is monolithic and I'm using a simple scheduler on the Spring Boot side to poll the APIs. Some example code is this:
@Component
public class RestAPIDataScheduler
{
@Scheduled(fixedRate = <<Polling Rate in Milliseconds>>)
public void pollApis()
{
}
}
I'm after the most appropriate architectural pattern (microservices most likely) that would be better suited for handling this type of application. Is this a simple API gateway pattern as described here http://microservices.io/patterns/apigateway.html?
Upvotes: 0
Views: 512
Reputation: 24
If I understand it right, you are trying to get data from various sources at a given frequency. Can't you use a spring batch for scheduling a timed job?
If the data to be processed is going to become bigger/longer, you could submit the response data to be processed into a Queuing system like RabbitMQ/ Kafka and do it asynchronously.
Upvotes: 1