Current-approach: For Spring Boot app, in AWS environment:
- The service-layer spawns 5 threads, using ExecutorService --> Callable-Future for concurrent processing.
- On completion, each callable-future task, returns a response.
- The 5 responses, from the 5 threads, are received by a
single calling class using future.get() and are then analyzed further.
All this works fine.
Questions:
In AWS, how can AWS-SQS/SNS be used to implement the above ?
Issue using SQS: Per My Analysis
A) SNS or SQS can process a message, but cannot respond with a value.
B) The only way it can send back a response is by posting the response, to another queue or using a callback
C) With the 5 separate callbacks, it is difficult to combine the 5 responses for further analysis
.
Any thoughts please, on whether, technically, there is a way to use SQS or even Kafka for this?
Additional-Info:
- Threadpool is set to 15 for testing
- Each thread takes around 1 sec to 3 sec to process
- Frequency is 30-API calls a minute thanks