Software Engineering Asked by kashive on December 3, 2021
We have multiple producers that publish messages to the same SQS queue. We have a single consumer that processes the messages. The producers do not care about the response. It is more like a broadcast message.
We are evaluating several options of how the producers are going to publish to the queue.
I’ve come up with three options. Here are the pros/cons of each I can think of:
1. Producers directly connect to the SQS endpoint and publish the message.
Pros
Cons
We cannot control the message content that goes to the queue. Let’s say there is a bug in a producer that leads to invalid message being put in the queue which has to be handled by the consumer. Some options include isolating bad messages in a dead letter queue or ignoring it since it is not a valid message altogether.
If we wanted to switch the distributed queue provider, then we would have to change all the producers to publish to a different endpoint.
2. Create a REST service with an API that validates the request and forwards it to the queue. All producers call the API.
Pros
Cons
3. Expose a client library to the producers that connects to the queue endpoint and publishes the message.
Pros
Cons
I am leaning towards option 3. It has the pros of options 1 and 2. Also, most of our producers are microservices written in a particular language and I don’t think we will be experimenting with newer languages anytime soon.
According to my understanding these are your main concerns:
As you have listed you can put this logic into
This concern could be evaluated by asking the following questions?
Answered by Peter Csala on December 3, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP