elasticmq 是一个使用 scala 编写的简单消息队列系统。当前使用嵌入式数据库 h2 来存储消息。elasticmq 实现了 sqs rest 接口的子集,提供一个 sqs 的可选方案。 ElasticMQ 0.2 最值得关注的就是支持延迟队列和消息,另外实现了 Amazon SQS 接口。 // First
elasticmq 是一个使用 scala 编写的简单消息队列系统。当前使用嵌入式数据库 h2 来存储消息。elasticmq 实现了 sqs rest 接口的子集,提供一个 sqs 的可选方案。
ElasticMQ 0.2 最值得关注的就是支持延迟队列和消息,另外实现了 Amazon SQS 接口。
// 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()
本文来自:开源中国社区
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号