Reputation: 165
I am currently working on a microservice system using node and python. We are currently using AWS SQS to process messages between services on queues however in one of the services we send a message to the queue and that same service processes that message. no other microservice handles it. So my question is is it better to handle internal messages through an event bus/event queue inside the same application or container or should the messages be sent to an external service via a network request and processed by a worker.
Application
|-------------------------------------------------------|
| |
| |---------| Send Message |---------||
| | Main |------------------------------>| Internal||
| | App |<------------------------------| Queue ||
| |---------| Emit Message |---------||
| |
|-------------------------------------------------------|
Application
|-----------------|
| |
| | Send Network Message |---------|
| |-------------------------->| External|
| |<--------------------------| Queue |
| | Process Network Message |---------|
| |
|-----------------|
Upvotes: 1
Views: 1461
Reputation: 4055
There are a couple of aspects I would think of before taking a decision:
TL;DR - if you have latency constraints and the queue is used to keep a small number of messages that are consumed fast, then it might make sense to use an internal queue. Otherwise, (and considering the above), an external queue is a better option.
Upvotes: 3