84

I'm quite interested in beginning some development using Amazon SQS, perhaps SimpleDB too, my question is this, are there any open source solutions that mimic the functionality, just for the purposes of development. I've already encountered the Eucalyptus project (http://open.eucalyptus.com) for creating an EC-esque cloud.

I've not had any success with google, I suspect it's because the cost of entry is so inexpensive, but still, does anyone know of anything like this?

Jonik
  • 80,077
  • 70
  • 264
  • 372
Derek Mortimer
  • 1,061
  • 1
  • 8
  • 11

7 Answers7

135

For SQS I wrote ElasticMQ, which you can run either embedded (it's written in Scala, so runs on the JVM) or stand-alone. It has both persistent and in-memory modes, the first being good for dev, second for testing.

adamw
  • 8,038
  • 4
  • 28
  • 32
  • 5
    We used ElasticMQ locally and in our unit/integration tests and it works perfectly. This should be the selected answer. – anataliocs Feb 17 '17 at 22:42
  • 4
    This should be the selected answer indeed. – dlock May 03 '17 at 23:14
  • ElasticMQ nice works for Symfony (PHP) as well, and make sure to also include the credentials in the DSN environment variable when developing locally (any key / secret pair is ok). – Rvanlaak Mar 13 '23 at 15:33
46

If you need a test double for more than just SQS, you can try LocalStack.

To simulate SQS, it internally uses ElasticMQ mentioned by adamw.

You can start LocalStack via Docker, for example, and it will start the following services:

Mifeet
  • 12,949
  • 5
  • 60
  • 108
  • It's a very tiny learning curve, but LocalStack is probably the best and most complete offering for this use case! – ankush981 May 27 '22 at 19:51
41

Some of the Amazon SDKs have "mock" mode, which is:

The mock service is an alternate way to use the sample code. The service doesn't call AWS, but instead returns a set response that you can modify to suit your needs (the XML response files are in the Mock directory). The mock service makes it easy for you to test how your application handles different responses.

For SQS, it appears the Perl and PHP SDKs have mock mode. I know that the .NET SDK for Amazon RDS also has the mock mode.

The Java SDK doesn't contain mock implementations:

The client mock implementations have been removed. Instead, developers are encouraged to use more flexible and full featured mock libraries, such as EasyMock, jMock

If the SDK you will be using doesn't have the mock mode available, you could probably create your own similar type of thing which returns the preconfigured responses instead of actually hitting up the service.

See here for more info

Matthew Simoneau
  • 6,199
  • 6
  • 35
  • 46
BigJoe714
  • 6,732
  • 7
  • 46
  • 50
16

GoAws - https://github.com/p4tin/goaws - was just released as beta. (disclaimer - I am the developer).

Paul A. Fortin
  • 315
  • 2
  • 8
11

Regarding the Java SDK, it does no longer contain mock implementations:

The client mock implementations have been removed. Instead, developers are encouraged to use more flexible and full featured mock libraries, such as EasyMock, jMock

tkotisis
  • 3,442
  • 25
  • 30
3

If you are in .NET or Mono you can try Stratosphere. It has local implementations that mimic SimpleDB, SQS and S3. For SimpleDB mock implementation it uses SQLite, for SQS and S3 it stores messages/objects in file system.

1

if you need to simulate SNS as well as SQS you can check out: Yopa

Paul A. Fortin
  • 315
  • 2
  • 8