Amazon SQS (aws-sqs) is an easy queuing service with which you can easily send or receive 1-10 messages at a time. SQS support has been in jclouds since version 1.5.0.

Creating a queue

You can lookup a queue by name or create one on demand. Here's a common pattern for that:

URI queue = queueApi.get(queueName);
if (queue == null) {
  queue = queueApi.create(queueName);

Getting an api connection to a queue

In SQS, once you discover or create a queue, you can focus a connection to to that, by supplying the queue's url.

queueApi = context.getApi().getMessageApiForQueue(queueURI);

sending a message

Sending a message is simple, just supply the text you wish to send.

queueApi.send("my message");

receiving a message

Receiving a message is also simple: invoke receive and if your result is not null, you have a message!

message = queueApi.receive();

sending many messages

You can check whether bulk message requests came back, by checking the status result

BatchResult<MessageIdAndMD5> acks = api.send(ImmutableMap.<String, String> builder()
        .put("id1", "test message one")
        .put("id2", "test message two")
        .put("id3", "test message two")

receiving many messages

Note that you can receive the same message twice even in the same request!. Hence we use List, not Set.

List<Message> messages = api.receive(10);