Need advice about which tool to choose?Ask the StackShare community!
Amazon SQS vs MSMQ: What are the differences?
Key Differences between Amazon SQS and MSMQ
Introduction
In this article, we will explore the key differences between Amazon Simple Queue Service (SQS) and Microsoft Message Queue (MSMQ).
-
Architecture and Management:
- Amazon SQS is a fully-managed service provided by AWS, which means that the infrastructure and maintenance tasks are handled by AWS. It utilizes a distributed architecture to ensure high availability and fault tolerance.
- MSMQ, on the other hand, is a software-based application that needs to be installed and managed on a server. It relies on the server's resources for its functioning and does not provide built-in high availability or fault tolerance features.
-
Messaging Patterns:
- Amazon SQS supports both standard and FIFO (First-In-First-Out) messaging patterns, giving developers the flexibility to choose the most appropriate pattern for their use case. FIFO queues ensure that the order in which messages are sent and received is strictly preserved.
- MSMQ only supports the standard messaging pattern, where messages are delivered in a best-effort manner without any guarantees on ordering or message delivery.
-
Scalability and Throughput:
- Amazon SQS is designed to handle a virtually unlimited number of messages and offers high throughput capabilities. It automatically scales based on the workload and can handle bursty traffic patterns effectively.
- MSMQ has limitations on scalability and throughput, as it relies on the resources of the server it is installed on. It may require additional capacity planning and configuration to handle increased workloads.
-
Message Size and Visibility Timeout:
- Amazon SQS allows messages of up to 256 KB in size. It also provides a visibility timeout feature, which allows a message to be temporarily invisible to other consumers after it has been fetched from the queue, preventing multiple consumers from processing the same message concurrently.
- MSMQ has a message size limit of 4 MB and does not include a built-in visibility timeout mechanism. Developers need to implement custom logic to handle message visibility and preventing duplicate processing.
-
Integration with Serverless and Event-Driven Architectures:
- Amazon SQS is seamlessly integrated with various AWS services, making it a suitable choice for serverless and event-driven architectures. It can be easily integrated with AWS Lambda, Amazon SNS, and other services to build scalable and event-driven systems.
- MSMQ is primarily designed for use within on-premises Windows environments and does not offer native integration with cloud-based serverless architectures. It may require additional integration efforts to integrate with cloud-based services.
-
Pricing Models:
- Amazon SQS pricing is based on the number of requests made, the message data size, and additional features like dead-letter queues. It offers a pay-as-you-go model, allowing users to pay only for the resources they consume.
- MSMQ is a part of the Windows operating system and does not have separate pricing. However, the cost of managing and maintaining the underlying server infrastructure needs to be considered.
In summary, Amazon SQS is a fully-managed, scalable, and highly available messaging service with support for various messaging patterns and seamless integration with cloud services. MSMQ, on the other hand, is a software-based application that needs to be managed and may have limitations on scalability and integration with cloud-based architectures.
I want to schedule a message. Amazon SQS provides a delay of 15 minutes, but I want it in some hours.
Example: Let's say a Message1 is consumed by a consumer A but somehow it failed inside the consumer. I would want to put it in a queue and retry after 4hrs. Can I do this in Amazon MQ? I have seen in some Amazon MQ videos saying scheduling messages can be done. But, I'm not sure how.
Mithiridi, I believe you are talking about two different things. 1. If you need to process messages with delays of more 15m or at specific times, it's not a good idea to use queues, independently of tool SQM, Rabbit or Amazon MQ. you should considerer another approach using a scheduled job. 2. For dead queues and policy retries RabbitMQ, for example, doesn't support your use case. https://medium.com/@kiennguyen88/rabbitmq-delay-retry-schedule-with-dead-letter-exchange-31fb25a440fc I'm not sure if that is possible SNS/SQS support, they have a maximum delay for delivery (maxDelayTarget) in seconds but it's not clear the number. You can check this out: https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html
Pros of Amazon SQS
- Easy to use, reliable62
- Low cost40
- Simple28
- Doesn't need to maintain it14
- It is Serverless8
- Has a max message size (currently 256K)4
- Triggers Lambda3
- Easy to configure with Terraform3
- Delayed delivery upto 15 mins only3
- Delayed delivery upto 12 hours3
- JMS compliant1
- Support for retry and dead letter queue1
- D1
Pros of MSMQ
- Easy to learn2
- Cloud not needed1
Sign up to add or upvote prosMake informed product decisions
Cons of Amazon SQS
- Has a max message size (currently 256K)2
- Proprietary2
- Difficult to configure2
- Has a maximum 15 minutes of delayed messages only1
Cons of MSMQ
- Windows dependency1