ElasticMQ is a simple messaging system, exposing an SQS-compatible REST interface. It can run using an in-memory H2 database (ideal for testing), or backed by a normal database (e.g. MySQL).
Using ElasticMQ can’t get much simpler, just include the dependency and: (the code below is Scala, but it is just as easy to use from Java)
1 2 3 4 5 6 7 8 9 10 11 12
// First we need to create a Node val node = NodeBuilder.withInMemoryStorage().build() // Then we can expose the native client using the SQS REST interface val server = SQSRestServerFactory.start(node.nativeClient, 8888, "http://localhost:8888") // ... use: http://localhost:8888 exposes the full SQS interface ... // Finally we need to stop the server and the node server.stop() node.shutdown()
ElasticMQ is written entirely in Scala, leveraging the Squeryl library for ORM and Netty for implementing the REST server.
The 0.1 release contains support for all SQS actions, providing a fully-functional SQS replacement. A tiny fraction message attributes is still not supported (e.g.
Moreover, ElasticMQ will soon see its first production usage, serving as the messaging system behind one of the services we develop. The service used to be deployed on US-based servers, and it then successfully used the US-East SQS service. However, after moving the servers to Australia, as there’s no local AWS center, the communication delays with US and Singapore SQS servers became unacceptable; hence the need for a local SQS installation.