Oracle WebLogic JMS Queues or AWS Cloud Simple Queue Service (SQS)

This is a shortened extract of my my book Middleware and Cloud Computing.


AWS Simple Queue Service

Amazon’s Simple Queue Service (SQS) is a cloud service for reliable messaging. The SQS service with its queues is located off-host. So, similar to the elastic load balancing service, or the relational database service, you can use the service without having to start an EC2 instance.

Features

SQS is available in all four AWS regions with the same pricing. All regions are independent of each other so messages can never be in-between regions. Queue names have to be unique per region.

Highly available

Queues are highly available: Messages waiting in queues for their delivery are stored redundantly on multiple servers and in multiple data centers.

Unlimited
queue size

There is no limit for the number of messages or the size of a particular queue. One message body can be up to 64 KB of text in any format (default is 8KB). For larger messages you have to store the message somewhere else reliably, e.g. in S3, SimpleDB or RDS, and pass around a reference to the storage location instead of passing the message itself.

Message expiry

When a message remains in a queue (because there is no receiver removing the message from the queue), the message expires after a default of four days (or a configurable maximum of 14 days).

After receiving a message from a queue, the message is locked for a configurable timeout. While the message is locked it is invisible to other receivers. SQS uses this mechanism to ensure that messages are delivered once.

It’s the receiver’s responsibility to explicitly delete the message when it is processed successfully. If the receiver fails before it is able to delete the message, then the message becomes visible again after the timeout, and another receiver can receive it.

Access to queues is restricted to the AWS account owners, but you can specify in an access policy statement that a queue will be shared.

No
compression
or encryption

Encryption is not a built-in SQS feature, but depending on your privacy requirements you can consider encrypting the content of your message at an application level. Also, there is no built-in compression feature, but you can compress large messages at an application level before sending them.

At least once
semantics

The message delivery semantic is engineered to be “at least once”. This means your applications have to cope with message duplicates.

 

Usage

Access to SQS is purely programmatic. Currently, there are no command-line tools from AWS, and there is no integration for SQS into the AWS management console yet.

There are language bindings for Java, PHP, Perl and C#. Also, the Java Typica library supports SQS.

SQS is ideal for decoupling systems or applications running on EC2. From a design perspective, SQS has many features in common with JMS queues. The most important differences between SQS and JMS queues are listed in Table 1.

Table 1: SQS Comparison with WLS Queues

SQS Queues WebLogic JMS Queues
Max queue size Unlimited Limit depends on JVM heap and persistent store
Best Quality of Service At least once Exactly-once
with transactions
Configurable retries No Yes
Persistence Always Optional
Scalability Inherent With distributed queues
Availability Inherent Whole-server migration 

or JMS service migration

Message Order Not guaranteed Can be enforced even for distributed queues
Configurable quotas No Yes
Configurable flow control No Yes
Auto acknowledge No Yes
Time To Live configuration 1h to 14d 1 ms to ca. 2 mio years
Max message size 64 KB Unlimited,
default is 10,000 KB
Compression No Yes
Billing Free usage tier, then charged per request and data transfer amount Included with WLS

Conclusion

To conclude, SQS is an AWS cloud service that could replace WebLogic JMS queues.

Compared to JMS queues, SQS has fewer features, no auto acknowledgement of messages and no support for exactly-once message delivery. The advantage of SQS over JMS queues is SQS’ inherent availability, the virtually unlimited storage for messages and the zero configuration.

The inherent availability is an especially important factor to consider when deciding between SQS or JMS queues, because the built-in features offered by WebLogic for achieving availability of JMS are restricted in today’s clouds.

SQS is implemented off-instance; therefore, its availability is not affected if a particular EC2 instance becomes unavailable.

SNS

Interestingly, there is a cloud service for the counterpart to JMS topics as well. The AWS Simple Notification Service allows you to send messages to more than one receiver using transport protocols such as HTTP, email and even SQS.

SQS vs. OSB

In case you are wondering how this relates to Oracle Service Bus: Comparing SQS with Oracle Service Bus is like comparing apples with oranges, because in addition to the built-in JMS, service bus also supports protocol adaption, message flows with content-based routing, and most importantly, it is configuration driven.

In a nutshell: SQS is a queue service for the AWS cloud to decouple systems with message passing. As a cloud service it abstracts the Java EE specific details of JMS – nevertheless SQS is specific to AWS. Currently there is no cloud messaging service offered for the Rackspace cloud. Using an AWS specific service like SQS increases the effort to migrate to another cloud provider (and limits your possibilities to quickly switch to another cloud provider as a part of a contingency plan).

Pricing

There is a free usage tier for up to 100,000 requests per month. Beyond that, Amazon adds $0.01 per 10,000 SQS requests to your bill.

In addition, you have to pay for the data transfer as shown the figure below. Only data transferred between SQS and EC2 within a single region is free. Data transferred between different regions will be charged at Internet data transfer rates on both ends.

 

 

More details on my Middleware and Cloud Computing book.

 

Comments

  1. Krešimir Popović says

    Hello,

    I have read your article and I like it. It describes Amazon SQS service very simply.
    Maybe you could try (if you have the time) my SQS Administration Tool made

    https://bitbucket.org/Kresimir/awsadmintool/downloads

    Just download AWSAdminTool.air file. It supports all 11 SQS actions.

    Best Regards,
    Krešimir

    • Hello Krešimir,

      thanks for your comment! I will try your tool when I have some time later.
      It’s time for Amazon to provide some SQS integration with the AWS Management Console 🙂

      regards,

      Frank

  2. Steffen Rumpf says

    Hi Frank,

    very nice article 🙂 What you missed to check is error destinations but as I think this is weblogic specific it is not supported by AWS. Just for completeness 😉

    Regards
    Steffen

    • thanks!
      The article is from 2011 – based on the first AWS POCs I did with a bavarian car maker.
      Good to see that people find it still useful.
      More than half a decade of cloud computing now 🙂

      regards!

Speak Your Mind

*