ElasticMQ 0.2 – 支持延迟队列和消息

jopen 13年前
     <p>ElasticMQ 是一个使用 Scala 编写的简单消息队列系统。当前使用嵌入式数据库 H2 来存储消息。ElasticMQ 实现了 SQS REST 接口的子集,提供一个 SQS 的可选方案。</p>    <p>ElasticMQ 0.2 最值得关注的就是支持延迟队列和消息,另外实现了 <a href="/misc/goto?guid=4958325803750714285">Amazon SQS</a> 接口。</p>    <pre class="brush:java; toolbar: true; auto-links: false;">// 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")    // Now we need to create the sqs client  client = new AmazonSQSClient(new BasicAWSCredentials("x", "x"))  client.setEndpoint("http://localhost:8888")    // Using the client is quite straightforward  val queueUrl = client.createQueue(new CreateQueueRequest("queue1"))        .getQueueUrl  client.sendMessage(new SendMessageRequest(queueUrl, "message1"))    client.shutdown()    // Finally we need to stop the server and the node  server.stop()  node.shutdown()</pre>    <br /> https://github.com/adamw/elasticmq