Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 66 additions & 1 deletion .doc_gen/metadata/sqs_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ sqs_Scenario_TopicsAndQueues:
sqs_Scenario_WorkWithTags:
title: Work with queue tags and &SQS; using an &AWS; SDK
title_abbrev: Work with queue tags
synopsis: perform tagging operation with &SQS;
synopsis: perform tagging operation with &SQS;.
category: Scenarios
languages:
Java:
Expand All @@ -1130,3 +1130,68 @@ sqs_Scenario_WorkWithTags:
- sqs.java2.tag-examples
services:
sqs: {TagQueue, ListQueueTags, UntagQueue}
sqs_Scenario_UseJMS:
title: Use the &SQS; Java Messaging Library to work with the Java Message Service (JMS) interface for &SQS;
title_abbrev: Use the &SQS; Java Messaging Library to work with the JMS interface
synopsis: use the &SQS; Java Messaging Library to work with the JMS interface.
category: Scenarios
languages:
Java:
versions:
- sdk_version: 2
github: javav2/example_code/sqs
sdkguide:
excerpts:
- description: >-
The following examples work with standard &SQS; queues and include:</para>
<itemizedlist>
<listitem>
<para>Sending a text message.</para>
</listitem>
<listitem>
<para>Receiving messages synchronously.</para>
</listitem>
<listitem>
<para>Receiving messages asynchronously.</para>
</listitem>
<listitem>
<para>Receiving messages using CLIENT_ACKNOWLEDGE mode.</para>
</listitem>
<listitem>
<para>Receiving messages using the UNORDERED_ACKNOWLEDGE mode.</para>
</listitem>
<listitem>
<para>Using Spring to inject dependencies.</para>
</listitem>
<listitem>
<para>A utility class that provides common methods used by the other examples.</para>
</listitem>
</itemizedlist>
<para>For more information on using JMS with &SQS;, see the
<ulink type="documentation" url="AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-java-message-service-jms-client.html">&SQS; Developer Guide</ulink>.
</para><para>Sending a text message.
snippet_tags:
- sqs-jms.java2.send-text-message
- description: Receiving messages synchronously.
snippet_tags:
- sqs-jms.java2.receive-message-sync
- description: Receiving messages asynchronously.
snippet_tags:
- sqs-jms.java2.receive-message-async
- description: Receiving messages using CLIENT_ACKNOWLEDGE mode.
snippet_tags:
- sqs-jms.java2.receive-message-sync-client-ack
- description: Receiving messages using the UNORDERED_ACKNOWLEDGE mode.
snippet_tags:
- sqs-jms.java2.receive-message-sync-unordered-ack
- description: Using Spring to inject dependencies.
snippet_tags:
- sqs-jms.java2.spring
- description: Spring bean definitions.
snippet_files:
- javav2/example_code/sqs-jms/src/main/resources/SpringExampleConfiguration.xml.txt
- description: A utility class that provides common methods used by the other examples.
snippet_files:
- javav2/example_code/sqs-jms/src/main/java/com/example/sqs/jms/SqsJmsExampleUtils.java
services:
sqs: {CreateQueue, DeleteQueue}
124 changes: 124 additions & 0 deletions javav2/example_code/sqs-jms/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SQSJMSJ2Project</groupId>
<artifactId>SQSJMSJ2Project</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.29.24</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.23.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>amazon-sqs-java-messaging-lib</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sso</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>ssooidc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
</dependency>
<!-- Spring Core and Context (Needed for XML-based configuration) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>6.1.14</version> <!-- Use the latest compatible version -->
</dependency>

<!-- Spring Beans (Required for bean configuration) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>6.1.14</version>
</dependency>

<!-- Spring Core (Provides core utilities) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>6.1.14</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.12.0</version>
<scope>test</scope>
</dependency>

<!-- Adding the apache-client compile-time dependency in order to exclude commons-logging.
This exclusion stops this statement emitted by Spring:
"Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts" -->
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache-client</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

</dependencies>
</project>
Loading
Loading