在开发过程中模拟 Amazon SQS
我对使用 Amazon SQS 开始一些开发非常感兴趣,也许还有 SimpleDB,我的问题是,是否有任何开源解决方案可以模仿功能,仅用于开发目的。我已经遇到过用于创建 EC 式的 Eucalyptus 项目 (http://open.eucalyptus.com)云。
我在谷歌上没有取得任何成功,我怀疑这是因为进入成本太便宜了,但是,有人知道这样的事情吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
对于 SQS,我编写了 ElasticMQ,您可以嵌入式运行(它是用 Scala 编写的,因此在 JVM 上运行)或独立运行。它具有持久模式和内存模式,第一种适合开发,第二种适合测试。
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.
如果您需要的测试替身不仅仅用于 SQS,您可以尝试 LocalStack。
为了模拟 SQS,它在内部使用 adamw 提到的 ElasticMQ。
例如,您可以通过 Docker 启动 LocalStack,它将启动以下服务:
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:
一些 Amazon SDK 具有“模拟”模式,即:
对于 SQS,Perl 和 PHP SDK 似乎具有模拟模式。我知道Amazon RDS的.NET SDK也有模拟模式。
Java SDK 不包含模拟实现:
如果您要使用的 SDK 没有可用的模拟模式,您可能可以创建自己的类似类型的东西,它返回预配置的响应,而不是实际启动服务。
请参阅此处了解更多信息
Some of the Amazon SDKs have "mock" mode, which is:
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:
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
GoAws - https://github.com/p4tin/goaws - 刚刚作为测试版发布。 (免责声明 - 我是开发商)。
GoAws - https://github.com/p4tin/goaws - was just released as beta. (disclaimer - I am the developer).
关于Java SDK,它不再包含模拟实现:
Regarding the Java SDK, it does no longer contain mock implementations:
如果您使用 .NET 或 Mono,您可以尝试 Stratosphere。它具有模仿 SimpleDB、SQS 和 S3 的本地实现。对于 SimpleDB 模拟实现,它使用 SQLite,对于 SQS 和 S3,它在文件系统中存储消息/对象。
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.
如果您需要模拟 SNS 以及 SQS,您可以查看:Yopa
if you need to simulate SNS as well as SQS you can check out: Yopa