Aws Sdk Java V2 Messaging logo

Aws Sdk Java V2 Messaging

Community
giuseppe-trisciuoglio
aws-sdk-java-v2-messaging

Provides AWS messaging patterns using AWS SDK for Java 2.x for SQS queues and SNS topics. Handles sending/receiving messages, FIFO queues, DLQ, subscriptions, and pub/sub patterns. Use when implementing messaging with SQS or SNS.

Overview

Publishergiuseppe-trisciuoglio
Repositorydeveloper-kit
Skill nameaws-sdk-java-v2-messaging
Stars
345
Forks
41
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by giuseppe-trisciuoglio on GitHub. Read the source before you install it.

Installation

Install the Aws Sdk Java V2 Messaging AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit.git /tmp/developer-kit
mkdir -p .claude/skills
cp -r /tmp/developer-kit/plugins/developer-kit-java/skills/aws-sdk-java-v2-messaging .claude/skills/aws-sdk-java-v2-messaging
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Aws Sdk Java V2 Messaging in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Aws Sdk Java V2 Messaging on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Aws Sdk Java V2 Messaging is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

AWS SDK for Java 2.x - Messaging (SQS & SNS)

Overview

Provides patterns for SQS queues and SNS topics with AWS SDK for Java 2.x: client setup, queue management, message operations, subscriptions, and Spring Boot integration.

When to Use

  • Setting up SQS queues (standard or FIFO) for message buffering
  • Implementing pub/sub with SNS topics and subscriptions
  • Processing messages from SQS queues with long polling
  • Configuring dead letter queues (DLQ) for error handling
  • Integrating AWS messaging with Spring Boot applications
  • Building event-driven architectures with SQS/SNS

Examples

Quick Setup

Dependencies:

xml
<dependency>
    <groupId>software.amazon.awssdk</groupId>
    <artifactId>sqs</artifactId>
</dependency>
<dependency>
    <groupId>software.amazon.awssdk</groupId>
    <artifactId>sns</artifactId>
</dependency>

Client Configuration:

java
SqsClient sqsClient = SqsClient.builder()
    .region(Region.US_EAST_1)
    .credentialsProvider(DefaultCredentialsProvider.create())
    .build();

SnsClient snsClient = SnsClient.builder()
    .region(Region.US_EAST_1)
    .build();

SQS Operations

Create and Send Message:

java
String queueUrl = sqsClient.createQueue(CreateQueueRequest.builder()
    .queueName("my-queue")
    .build()).queueUrl();

String messageId = sqsClient.sendMessage(SendMessageRequest.builder()
    .queueUrl(queueUrl)
    .messageBody("Hello, SQS!")
    .build()).messageId();

Receive and Delete Message:

java
ReceiveMessageResponse response = sqsClient.receiveMessage(ReceiveMessageRequest.builder()
    .queueUrl(queueUrl)
    .maxNumberOfMessages(10)
    .waitTimeSeconds(20)
    .build());

response.messages().forEach(message -> {
    processMessage(message.body());
    sqsClient.deleteMessage(DeleteMessageRequest.builder()
        .queueUrl(queueUrl)
        .receiptHandle(message.receiptHandle())
        .build());
});

FIFO Queue:

java
Map<QueueAttributeName, String> attributes = Map.of(
    QueueAttributeName.FIFO_QUEUE, "true",
    QueueAttributeName.CONTENT_BASED_DEDUPLICATION, "true"
);

String fifoQueueUrl = sqsClient.createQueue(CreateQueueRequest.builder()
    .queueName("my-queue.fifo")
    .attributes(attributes)
    .build()).queueUrl();

sqsClient.sendMessage(SendMessageRequest.builder()
    .queueUrl(fifoQueueUrl)
    .messageBody("Order #12345")
    .messageGroupId("orders")
    .messageDeduplicationId(UUID.randomUUID().toString())
    .build());

SNS Operations

Create Topic and Publish:

java
String topicArn = snsClient.createTopic(CreateTopicRequest.builder()
    .name("my-topic")
    .build()).topicArn();

snsClient.publish(PublishRequest.builder()
    .topicArn(topicArn)
    .subject("Test Notification")
    .message("Hello, SNS!")
    .build());

SNS to SQS Subscription:

java
String queueArn = sqsClient.getQueueAttributes(GetQueueAttributesRequest.builder()
    .queueUrl(queueUrl)
    .attributeNames(QueueAttributeName.QUEUE_ARN)
    .build()).attributes().get(QueueAttributeName.QUEUE_ARN);

snsClient.subscribe(SubscribeRequest.builder()
    .protocol("sqs")
    .endpoint(queueArn)
    .topicArn(topicArn)
    .build());

Spring Boot Integration

java
@Service
@RequiredArgsConstructor
public class OrderNotificationService {
    private final SnsClient snsClient;
    private final ObjectMapper objectMapper;

    @Value("${aws.sns.order-topic-arn}")
    private String orderTopicArn;

    public void sendOrderNotification(Order order) throws JsonProcessingException {
        snsClient.publish(PublishRequest.builder()
            .topicArn(orderTopicArn)
            .subject("New Order Received")
            .message(objectMapper.writeValueAsString(order))
            .messageAttributes(Map.of(
                "orderType", MessageAttributeValue.builder()
                    .dataType("String")
                    .stringValue(order.getType())
                    .build()))
            .build());
    }
}

Instructions

Implement Message Processing (with Validation)

  1. Create queues/topics with appropriate configuration
  2. Send messages and validate messageId is returned
  3. Receive messages with long polling (waitTimeSeconds: 20)
  4. Process messages - validate payload before processing
  5. Delete messages only after successful processing - verify deletion response
  6. Check DLQ periodically for failed messages using redrivePolicy
  7. Verify delivery - monitor CloudWatch NumberOfMessagesSent metric

Validation Checklist:

java
// After send
if (messageId == null || messageId.isEmpty()) {
    throw new MessagingException("Message send failed - no messageId returned");
}

// After receive
if (response.messages().isEmpty()) {
    log.debug("No messages available - normal with long polling");
}

// After delete
if (!deleteResponse.sdkHttpResponse().isSuccessful()) {
    throw new MessagingException("Message deletion failed");
}

Setup Credentials

bash
export AWS_ACCESS_KEY_ID=your-access-key
export AWS_SECRET_ACCESS_KEY=your-secret-key
export AWS_REGION=us-east-1

Monitor and Debug

  • CloudWatch metrics: ApproximateNumberOfMessages, NumberOfMessagesSent, NumberOfMessagesReceived
  • Enable SDK logging: software.amazon.awssdk at DEBUG level
  • Use X-Ray for distributed tracing

Best Practices

SQS:

  • Use long polling (20-40s) to reduce empty responses and costs
  • Always delete messages after successful processing
  • Implement idempotent processing for duplicate handling
  • Configure DLQ (redrivePolicy) for failed messages
  • Use FIFO queues when order matters (300 msg/sec limit)

SNS:

  • Use filter policies to reduce unnecessary deliveries
  • Keep messages under 256KB
  • Implement retry with exponential backoff
  • Monitor NumberOfNotificationFailed metric

General:

  • Use IAM roles over static credentials
  • Reuse clients (they are thread-safe)
  • Test with LocalStack or Testcontainers

Detailed References

Constraints and Warnings

  • Message Size: Maximum 256KB for SQS and SNS
  • Visibility Timeout: Undeleted messages reappear after timeout - always delete after processing
  • Input Validation: Sanitize message body before processing - messages may contain untrusted payloads
  • FIFO Naming: Must end with .fifo suffix
  • FIFO Throughput: 300 msg/sec per queue (use partitioning for higher throughput)
  • Message Retention: SQS retains messages max 14 days
  • DLQ Required: Configure dead letter queue to prevent message loss
  • Region-Specific: SQS queues are region-specific; cross-region requires SNS

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Aws Sdk Java V2 Messaging AI skill do?

Provides AWS messaging patterns using AWS SDK for Java 2.x for SQS queues and SNS topics. Handles sending/receiving messages, FIFO queues, DLQ, subscriptions, and pub/sub patterns. Use when implementing messaging with SQS or SNS.

Why use Aws Sdk Java V2 Messaging on TypingMind?

Because you install it once and use it with any model. Aws Sdk Java V2 Messaging is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Aws Sdk Java V2 Messaging in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/giuseppe-trisciuoglio/developer-kit/tree/main/plugins/developer-kit-java/skills/aws-sdk-java-v2-messaging. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Aws Sdk Java V2 Messaging?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Aws Sdk Java V2 Messaging?

As many as you like. As long as a model supports skills, you can use Aws Sdk Java V2 Messaging with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Aws Sdk Java V2 Messaging AI skill free?

Yes. It is published on GitHub by giuseppe-trisciuoglio under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇