Menu
Amazon Simple Queue Service
Developer Guide

Using JMS with Amazon SQS

The Amazon SQS Java Messaging Library is a JMS interface for Amazon SQS that lets you take advantage of Amazon SQS in applications that already use JMS. The interface lets you use Amazon SQS as the JMS provider with minimal code changes. Together with the AWS SDK for Java, the Amazon SQS Java Messaging Library lets you create JMS connections and sessions, as well as producers and consumers that send and receive messages to and from Amazon SQS queues.

The library supports sending and receiving messages to a queue (the JMS point-to-point model) according to the JMS 1.1 specification. The library supports sending text, byte, or object messages synchronously to Amazon SQS queues. The library also supports receiving objects synchronously or asynchronously.

For information about features of the Amazon SQS Java Messaging Library that support the JMS 1.1 specification, see Supported JMS 1.1 Implementations and the Amazon SQS FAQs.

Prerequisites

Before you begin, you must have the following prerequisites:

  • SDK for Java

    There are two ways to include the SDK for Java in your project:

    • Download and install the SDK for Java.

    • Use Maven to get the Amazon SQS Java Messaging Library. (The SDK for Java is included as a dependency. The SDK for Java and Amazon SQS Java Messaging Library require J2SE Development Kit 7.0 or later.)

      For information about downloading the SDK for Java, see SDK for Java.

  • Amazon SQS Java Messaging Library

    If you do not use Maven, you must add the package file amazon-sqs-java-messaging-lib.jar to the Java build class path. For information about downloading the library, see Amazon SQS Java Messaging Library.

    Note

    The Amazon SQS Java Messaging Library includes support for Maven and the Spring Framework.

    For code samples that use Maven, the Spring Framework, and the Amazon SQS Java Messaging Library, see Code Examples.

    Copy
    <dependency> <groupId>com.amazonaws</groupId> <artifactId>amazon-sqs-java-messaging-lib</artifactId> <version>1.0.3</version> <type>jar</type> </dependency>
  • Amazon SQS Queue

    Create a queue using the AWS Management Console for Amazon SQS, the CreateQueue API, or the wrapped Amazon SQS client included in the Amazon SQS Java Messaging Library.

On this page: