0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ローカルでAWS SQSをモックぽく使いたい→ElasticMQがあるよ!

Posted at

TL;DR

テストコードの実行時にAWS SQSと同じ振る舞いをするモックが欲しくなったので調べたらElasticMQでイケたぞという話し。

手順:

最新のelasticMQを取得

$ cd /path/to/project/
$ wget https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.14.1.jar
$ java -jar elasticmq-server-0.14.1.jar

あとは java -jar elasticmq-server.jar みたいなコマンドを実行してあげるだけ。
やったぜ!
……とは残念ながらぼくの場合いかなかった。

エラーが出た:

こんな感じのエラーが出たらOpenJDKが古い可能性があるので最新を取得してインストール。

12:51:07.175 [main] INFO  org.elasticmq.server.Main$ - Starting ElasticMQ server (0.14.1) ...
12:51:07.684 [main] ERROR org.elasticmq.server.Main$ - Uncaught exception in thread: main
java.lang.VerifyError: Uninitialized object exists on backward branch 209
Exception Details:
...

$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11) # ←のバージョンがインストールしたものになってればOK
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

感想:

ElasticMQ使えるようになり、テストの依存性を綺麗になくせたのでよかったです(こなみかん)

参考URL:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?