{"id":13615590,"url":"https://github.com/softwaremill/elasticmq","last_synced_at":"2025-05-13T18:09:48.178Z","repository":{"id":37493045,"uuid":"1951336","full_name":"softwaremill/elasticmq","owner":"softwaremill","description":"In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.","archived":false,"fork":false,"pushed_at":"2025-04-20T16:56:23.000Z","size":4889,"stargazers_count":2643,"open_issues_count":23,"forks_count":197,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-05-08T13:02:28.366Z","etag":null,"topics":["amazon-sqs","aws","aws-sqs","elasticmq","messaging","scala","sqs-interface"],"latest_commit_sha":null,"homepage":"https://softwaremill.com/open-source/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softwaremill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-06-25T07:36:38.000Z","updated_at":"2025-05-06T06:25:03.000Z","dependencies_parsed_at":"2023-02-15T11:01:19.564Z","dependency_job_id":"6b6f11c5-7147-4db2-b339-05bb6dbf973e","html_url":"https://github.com/softwaremill/elasticmq","commit_stats":null,"previous_names":["adamw/elasticmq"],"tags_count":140,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Felasticmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Felasticmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Felasticmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaremill%2Felasticmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softwaremill","download_url":"https://codeload.github.com/softwaremill/elasticmq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000851,"owners_count":21997441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-sqs","aws","aws-sqs","elasticmq","messaging","scala","sqs-interface"],"created_at":"2024-08-01T20:01:15.487Z","updated_at":"2025-05-13T18:09:48.148Z","avatar_url":"https://github.com/softwaremill.png","language":"Scala","readme":"![ElasticMQ](https://github.com/softwaremill/elasticmq/raw/master/banner.png)\n\n[![Ideas, suggestions, problems, questions](https://img.shields.io/badge/Discourse-ask%20question-blue)](https://softwaremill.community/c/elasticmq)\n[![ CI ](https://github.com/softwaremill/elasticmq/workflows/ElasticMQ%20tests/badge.svg)](https://github.com/softwaremill/elasticmq/actions?query=workflow%3A%22ElasticMQ+tests%22)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.elasticmq/elasticmq-rest-sqs_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.elasticmq/elasticmq-rest-sqs_2.12/)\n\n# tl;dr\n\n* in-memory message queue system\n* runs stand-alone, via [Docker](https://hub.docker.com/r/softwaremill/elasticmq-native/) or embedded\n* [Amazon SQS](http://aws.amazon.com/sqs/)-compatible interface\n* fully asynchronous implementation, no blocking calls\n* optional UI, queue persistence\n* created and maintained by:\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://softwaremill.com\"\u003e\u003cimg src=\"https://files.softwaremill.com/logo/logo.png\" alt=\"SoftwareMill logo\" height=\"100\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Summary\n\nElasticMQ is a message queue system, offering an actor-based Scala and an [SQS](http://aws.amazon.com/sqs/)-compatible\nREST (query) interface.\n\nElasticMQ follows the semantics of SQS. Messages are received by polling the queue.\nWhen a message is received, it is blocked for a specified amount of time (the visibility timeout).\nIf the message isn't deleted during that time, it will be again available for delivery.\nMoreover, queues and messages can be configured to always deliver messages with a delay.\n\nThe focus in SQS (and ElasticMQ) is to make sure that the messages are delivered.\nIt may happen, however, that a message is delivered twice (if, for example, a client dies after receiving a message and\nprocessing it, but before deleting). That's why clients of ElasticMQ (and Amazon SQS) should be idempotent.\n\nAs ElasticMQ implements a subset of the [SQS](http://aws.amazon.com/sqs/) query (REST) interface, it is a great SQS\nalternative both for testing purposes (ElasticMQ is easily embeddable) and for creating systems which work both within\nand outside of the Amazon infrastructure.\n\nA simple UI is available for viewing real-time queue statistics.\n\n# Community\n\n* [Issues](https://github.com/adamw/elasticmq/issues)\n* [Discussions \u0026 help](https://softwaremill.community/c/elasticmq/7)\n\n# Installation: stand-alone\n\nYou can download the stand-alone distribution here:\n```bash\nwget https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-$VERSION.jar\n```\n\nJava 8 or above is required for running the server.\n\nSimply run the jar and you should get a working server, which binds to `localhost:9324`:\n    \n```\njava -jar elasticmq-server-$VERSION.jar\n```\n\nElasticMQ uses [Typesafe Config](https://github.com/typesafehub/config) for configuration. To specify custom\nconfiguration values, create a file (e.g. `custom.conf`), fill it in with the desired values, and pass it to the server:\n\n```\njava -Dconfig.file=custom.conf -jar elasticmq-server-$VERSION.jar\n```\n\nThe config file may contain any configuration for Akka and ElasticMQ. Current ElasticMQ configuration values are:\n\n```\ninclude classpath(\"application.conf\")\n\n# What is the outside visible address of this ElasticMQ node\n# Used to create the queue URL (may be different from bind address!)\nnode-address {\n  protocol = http\n  host = localhost\n  port = 9324\n  context-path = \"\"\n}\n\nrest-sqs {\n  enabled = true\n  bind-port = 9324\n  bind-hostname = \"0.0.0.0\"\n  # Possible values: relaxed, strict\n  sqs-limits = strict\n}\n\nrest-stats {\n  enabled = true\n  bind-port = 9325\n  bind-hostname = \"0.0.0.0\"\n}\n\n# Should the node-address be generated from the bind port/hostname\n# Set this to true e.g. when assigning port automatically by using port 0.\ngenerate-node-address = false\n\nqueues {\n  # See next sections\n}\n\nqueues-storage {\n  # See next sections\n}\n\n# Region and accountId which will be included in resource ids\naws {\n  region = us-west-2\n  accountId = 000000000000\n}\n```\n\nYou can also provide an alternative [Logback](http://logback.qos.ch/) configuration file (the\n[default](server/src/main/resources/logback.xml) is configured to\nlog INFO logs and above to the console):\n\n```\njava -Dlogback.configurationFile=my_logback.xml -jar elasticmq-server-$VERSION.jar\n```\n\n# How are queue URLs created\n\nSome of the responses include a queue URL. By default, the URLs will use `http://localhost:9324` as the base URL.\nTo customize, you should properly set the protocol/host/port/context in the `node-address` setting (see above).\n\nYou can also set `node-address.host` to a special value, `\"*\"`, which will cause any queue URLs created during a request\nto use the path of the incoming request. This might be useful e.g. in containerized (Docker) deployments.\n\nNote that changing the `bind-port` and `bind-hostname` settings do not affect the queue URLs in any way unless\n`generate-node-address` is `true`. In that case, the bind host/port are used to create the node address. This is\nuseful when the port should be automatically assigned (use port `0` in such case, the selected port will be\nvisible in the logs).\n\n# Automatically creating queues on startup\n\nQueues can be automatically created on startup by providing appropriate configuration:\n\nThe queues are specified in a custom configuration file. For example, create a `custom.conf` file with the following:\n\n````\n# the include should be done only once, at the beginning of the custom configuration file\ninclude classpath(\"application.conf\")\n\nqueues {\n  queue1 {\n    defaultVisibilityTimeout = 10 seconds\n    delay = 5 seconds\n    receiveMessageWait = 0 seconds\n    deadLettersQueue {\n      name = \"queue1-dead-letters\"\n      maxReceiveCount = 3 // from 1 to 1000\n    }\n    fifo = false\n    contentBasedDeduplication = false\n    copyTo = \"audit-queue-name\"\n    moveTo = \"redirect-queue-name\"\n    tags {\n      tag1 = \"tagged1\"\n      tag2 = \"tagged2\"\n    }\n  }\n  queue1-dead-letters { }\n  audit-queue-name { }\n  redirect-queue-name { }\n}\n````\n\nAll attributes are optional (except `name` and `maxReceiveCount` when a `deadLettersQueue` is defined).\n`copyTo` and `moveTo` attributes allow to achieve behavior that might be useful primarily for integration testing scenarios -\nall messages could be either duplicated (using `copyTo` attribute) or redirected (using `moveTo` attribute) to another queue.\n\n### FIFO queue creation\nTo create FIFO queue set value of `fifo` config parameter to `true`.\nYou can add `.fifo` suffix to queue name yourself (a name containing `.` has to be surrounded with quotes), for example:\n```\nqueues {\n  \"testQueue.fifo\" {\n    fifo = true\n    contentBasedDeduplication = true\n  }\n}\n```\nIf not then suffix will be added automatically during queue creation.\n\n# Persisting queues configuration\n\nQueues configuration can be persisted in an external config file in the [HOCON](https://en.wikipedia.org/wiki/HOCON) \nformat. Note that only the queue metadata (which queues are created, and with what attributes) will be stored, without \nany messages.\n\nTo enable the feature, create a custom configuration file with the following content:\n\n````\n# the include should be done only once, at the beginning of the custom configuration file\ninclude classpath(\"application.conf\")\n\nqueues-storage {\n  enabled = true\n  path = \"/path/to/storage/queues.conf\"\n}\n````\n\nAny time a queue is created, deleted, or its metadata change, the given file will be updated. \n\nOn startup, any queues defined in the given file will be created. Note that the persisted queues configuration takes \nprecedence over queues defined in the main configuration file (as described in the previous section) in the `queues`\nsection.\n\n# Persisting queues and messages to SQL database\n\nQueues and their messages can be persisted to SQL database in runtime.\nAll events like queue or message creation, deletion or update will be stored in H2 in-file database,\nso that the entire ElasticMQ state can be restored after server restart.\n\nTo enable the feature, create a custom configuration file with the following content:\n\n````\n# the include should be done only once, at the beginning of the custom configuration file\ninclude classpath(\"application.conf\")\n\nmessages-storage {\n  enabled = true\n}\n````\n\nBy default, the database file is stored in `/data/elasticmq.db`. In order to change it,\ncustom JDBC uri needs to be provided:\n\n````\n# the include should be done only once, at the beginning of the custom configuration file\ninclude classpath(\"application.conf\")\n\nmessages-storage {\n  enabled = true\n  uri = \"jdbc:h2:/home/me/elasticmq\"\n}\n````\n\nOn startup, any queues and their messages persisted in the database will be recreated.\nNote that the persisted queues take precedence over the queues defined\nin the main configuration file (as described in the previous section) in the `queues` section.\n\n# ElasticMQ dependencies in SBT\n\n```scala\n// Scala 2.13 and 2.12\nval elasticmqSqs        = \"org.elasticmq\" %% \"elasticmq-rest-sqs\" % Version\n```\n\nIf you don't want the SQS interface, but just use the actors directly, you can add a dependency only to the `core`\nmodule:\n\n```scala\nval elasticmqCore       = \"org.elasticmq\" %% \"elasticmq-core\" % Version\n```\n\nIf you want to use a snapshot version, you will need to add the [https://oss.sonatype.org/content/repositories/snapshots/](https://oss.sonatype.org/content/repositories/snapshots/) repository to your configuration.\n\n# ElasticMQ dependencies in Maven\n\nDependencies:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.elasticmq\u003c/groupId\u003e\n    \u003cartifactId\u003eelasticmq-rest-sqs_2.12\u003c/artifactId\u003e\n    \u003cversion\u003e${version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIf you want to use a snapshot version, you will need to add the [https://oss.sonatype.org/content/repositories/snapshots/](https://oss.sonatype.org/content/repositories/snapshots/) repository to your configuration.\n\n# Logging\n\nElasticMQ uses [Slf4j](http://www.slf4j.org/) for logging. By default, no logger backend is included as a dependency,\nhowever [Logback](http://logback.qos.ch/) is recommended.\n\n# Starting an embedded ElasticMQ server with an SQS interface\n\nAdd ElasticMQ Rest SQS module to `build.sbt` dependencies\n\n```scala\nlibraryDependencies += \"org.elasticmq\" %% \"elasticmq-rest-sqs\" % Version\n```\n\nSimply start the server using custom configuration (see examples above):\n\n```scala\nval config = ConfigFactory.load(\"elasticmq.conf\")\nval server = new ElasticMQServer(new ElasticMQServerConfig(config))\nserver.start()\n```\n\nAlternatively, custom rest server can be built using `SQSRestServerBuilder` provided in `elasticmq-rest-sqs` package:\n\n```scala\nval server = SQSRestServerBuilder.start()\n// ... use ...\nserver.stopAndWait()\n```\n\nIf you need to bind to a different host/port, there are configuration methods on the builder:\n\n```scala\nval server = SQSRestServerBuilder.withPort(9325).withInterface(\"localhost\").start()\n// ... use ...\nserver.stopAndWait()\n```\n\nYou can also set a dynamic port with a port value of `0` or by using the method `withDynamicPort`. To retrieve the port (and other configuration) when using a dynamic port value you can access the server via `waitUntilStarted` for example:\n\n```scala\nval server = SQSRestServerBuilder.withDynamicPort().start()\nserver.waitUntilStarted().localAddress().getPort()\n```\n\nYou can also provide a custom `ActorSystem`; for details see the javadocs.\n\nEmbedded ElasticMQ can be used from any JVM-based language (Java, Scala, etc.).\n\n(Note that the embedded server created with `SQSRestServerBuilder` does not load any configuration files, so you cannot automatically create queues on startup as described above. You can of course create queues programmatically.)\n\n# Using the Amazon Java SDK to access an ElasticMQ Server\n\nTo use [Amazon Java SDK](http://aws.amazon.com/sdkforjava/) as an interface to an ElasticMQ server you just need\nto change the endpoint:\n                      \n```java\nString endpoint = \"http://localhost:9324\";\nString region = \"elasticmq\";\nString accessKey = \"x\";\nString secretKey = \"x\";\nAmazonSQS client = AmazonSQSClientBuilder.standard()\n    .withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))\n    .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, region))\n    .build();\n```    \n\nThe endpoint value should be the same address as the `NodeAddress` provided as an argument to\n`SQSRestServerBuilder` or in the configuration file.\n\nThe `rest-sqs-testing-amazon-java-sdk` module contains some more usage examples.\n\n# Using the Amazon boto (Python) to access an ElasticMQ Server\n\nTo use [Amazon boto](http://docs.pythonboto.org/en/latest/) as an interface to an ElasticMQ server you set up the connection using:\n        \n```python\nregion = boto.sqs.regioninfo.RegionInfo(name='elasticmq',\n                                        endpoint=sqs_endpoint)\nconn = boto.connect_sqs(aws_access_key_id='x',\n                        aws_secret_access_key='x',\n                        is_secure=False,\n                        port=sqs_port,\n                        region=region)\n```\n\nwhere `sqs_endpoint` and `sqs_port` are the host and port.\n\nThe `boto3` interface is different:\n\n```python\nclient = boto3.resource('sqs',\n                        endpoint_url='http://localhost:9324',\n                        region_name='elasticmq',\n                        aws_secret_access_key='x',\n                        aws_access_key_id='x',\n                        use_ssl=False)\nqueue = client.get_queue_by_name(QueueName='queue1')\n```\n\n# ElasticMQ via Docker\n\nA Docker image built using GraalVM's [native-image](https://blog.softwaremill.com/small-fast-docker-images-using-graalvms-native-image-99c0bc92e70b),\nis available as [`softwaremill/elasticmq-native`](https://hub.docker.com/r/softwaremill/elasticmq-native/). \n\nTo start, run (9324 is the default REST-SQS API port; 9325 is the default UI port, exposing it is fully optional):\n\n```\ndocker run -p 9324:9324 -p 9325:9325 softwaremill/elasticmq-native\n```\n\nThe `elasticmq-native` image is much smaller (30MB vs 240MB) and starts up much faster (milliseconds instead of seconds),\ncomparing to the full JVM version (see below).  Custom configuration can be provided by creating a custom\nconfiguration file (see above) and using it when running the container:\n\n```\ndocker run -p 9324:9324 -p 9325:9325 -v `pwd`/custom.conf:/opt/elasticmq.conf softwaremill/elasticmq-native\n```\n\nIf messages storage is enabled, the directory containing database files can also be mapped:\n\n```\ndocker run -p 9324:9324 -p 9325:9325 -v `pwd`/custom.conf:/opt/elasticmq.conf -v `pwd`/data:/data softwaremill/elasticmq-native\n```\n\nIt is possible to specify custom `logback.xml` config as well to enable additional debug logging for example.\nSome logback features, like console coloring, will not work due to missing classes in the native image. This can only be solved by building a custom image.\n\n```\ndocker run -p 9324:9324 -p 9325:9325 -v `pwd`/custom.conf:/opt/elasticmq.conf -v `pwd`/logback.xml:/opt/logback.xml softwaremill/elasticmq-native\n```\n\nAs for now to run `elasticmq-native` docker image on ARM based CPU one have to install `Qemu` docker for `amd64`.\n\n```\ndocker run --privileged --rm tonistiigi/binfmt --install amd64\n```\n\n# ElasticMQ via Docker (full JVM)\n\nA Docker image is built on each release an pushed as [`softwaremill/elasticmq`](https://hub.docker.com/r/softwaremill/elasticmq/). \nRun using:\n\n```\ndocker run -p 9324:9324 -p 9325:9325 softwaremill/elasticmq\n```\n\nThe image uses default configuration. Custom configuration can be provided (e.g. to change the port, or create queues on startup) by creating a custom configuration file (see above) and using it when running the container:\n\n```\ndocker run -p 9324:9324 -p 9325:9325 -v `pwd`/custom.conf:/opt/elasticmq.conf softwaremill/elasticmq\n```\n\nIf messages storage is enabled, the directory containing database files can also be mapped:\n\n```\ndocker run -p 9324:9324 -p 9325:9325 -v `pwd`/custom.conf:/opt/elasticmq.conf -v `pwd`/data:/data softwaremill/elasticmq\n```\n\nTo pass additional java system properties (`-D`) you need to prepare an `application.ini` file. For instance, to set custom `logback.xml` configuration, `application.ini` should look as follows:\n\n```\napplication.ini:\n-Dconfig.file=/opt/elasticmq.conf\n-Dlogback.configurationFile=/opt/docker/conf/logback.xml\n```\n\nTo run container with customized `application.ini` file (and custom `logback.xml` in this particular case) the following command should be used:\n```\ndocker run -v `pwd`/application.ini:/opt/docker/conf/application.ini -v `pwd`/logback.xml:/opt/docker/conf/logback.xml -p 9324:9324 -p 9325:9325 softwaremill/elasticmq\n```\n\nIn case of problems with file mounting on Windows place the `application.ini` and the configuration file `elasticmq.conf` in the same directory then mount this directory to /opt/docker/conf:\n```\n--mount type=bind,source=\"$(pwd)\"/somefolder,target=/opt/docker/conf.\n```\n\nAnother option is to use custom `Dockerfile`:\n\n```\nFROM openjdk:8-jre-alpine\n\nARG ELASTICMQ_VERSION\nENV ELASTICMQ_VERSION ${ELASTICMQ_VERSION}\n\nRUN apk add --no-cache curl ca-certificates\nRUN mkdir -p /opt/elasticmq/log /opt/elasticmq/lib /opt/elasticmq/conf\nRUN curl -sfLo /opt/elasticmq/lib/elasticmq.jar https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-${ELASTICMQ_VERSION}.jar\n\nCOPY ${PWD}/elasticmq.conf /opt/elasticmq/conf/elasticmq.conf\n\nWORKDIR /opt/elasticmq\n\nEXPOSE 9324\n\nENTRYPOINT [ \"/usr/bin/java\", \"-Dconfig.file=/opt/elasticmq/conf/elasticmq.conf\", \"-jar\", \"/opt/elasticmq/lib/elasticmq.jar\" ]\n```\n\nand override the entrypoint passing the required properties.\n\n# Performance\n\nTests done on a 2012 MBP, 2.6GHz, 16GB RAM, no replication. Throughput is in messages per second (messages are\nsmall).\n\nDirectly accessing the client:\n\n```\nRunning test for [in-memory], iterations: 10, msgs in iteration: 100000, thread count: 1.\nOverall in-memory throughput: 21326.054040\n\nRunning test for [in-memory], iterations: 10, msgs in iteration: 100000, thread count: 2.\nOverall in-memory throughput: 26292.956117\n\nRunning test for [in-memory], iterations: 10, msgs in iteration: 100000, thread count: 10.\nOverall in-memory throughput: 25591.155697\n```\n\nThrough the SQS REST interface:\n\n```\nRunning test for [rest-sqs + in-memory], iterations: 10, msgs in iteration: 1000, thread count: 20.\nOverall rest-sqs + in-memory throughput: 2540.553587\n\nRunning test for [rest-sqs + in-memory], iterations: 10, msgs in iteration: 1000, thread count: 40.\nOverall rest-sqs + in-memory throughput: 2600.002600\n```\n\nNote that both the client and the server were on the same machine.\n\nTest class: `org.elasticmq.performance.LocalPerformanceTest`.\n\n# Building, running, and packaging\n\nTo build and run with debug (this will listen for a remote debugger on port 5005):\n```\n~/workspace/elasticmq $ sbt -jvm-debug 5005\n\u003e project server\n\u003e run\n```\n\nTo build a jar-with-dependencies:\n```\n~/workspace/elasticmq $ sbt\n\u003e project server\n\u003e assembly\n```\n\n## Building the native image\n\nDo not forget to adjust the CPU and memory settings for the Docker process. It was checked with 6CPUs, 8GB of memory and 2GB of swap. Also, make sure that you are running sbt with the graalvm java, as the way the jars are composed seem to differ from other java implementations, and affect the native-image process that is run later! To rebuild the native image, run:\n\n```\nsbt \"project nativeServer; clean; assembly; docker:publishLocal\"\n```\n\nGenerating GraalVM config files is a manual process currently. You need to run the fat-jar using the GraalVM VM (w/ native-image installed using `gu`), and then run the following commands to generate the configs:\n\n* `java -agentlib:native-image-agent=config-output-dir=... -jar elasticmq-server-assembly.jar`\n* `java -agentlib:native-image-agent=config-merge-dir=... -Dconfig.file=test.conf -jar elasticmq-server-assembly.jar` (to additionally generate config needed to load custom elasticmq config)\n\nThese files should be placed in `native-server/src/main/resources/META-INF/native-image` and are automatically used by the native-image process.\n\nIn case of issues with running GraalVM with `native-image-agent` it's possible to execute above commands inside of docker container (the image is generated by the sbt command above).\n`graalVmVersion` is defined in `build.sbt`:\n\n```\ndocker run -it -v `pwd`:/opt/graalvm --entrypoint /bin/bash --rm ghcr.io-graalvm-graalvm-ce-native-image:java11-${graalVmVersion}\n```\n\n## Building multi-architecture image\n\nPublishing Docker image for two different platforms: `amd64` and `arm64` is possible with Docker Buildx plugin.\nDocker Buildx is included in Docker Desktop and Docker Linux packages when installed using the DEB or RPM packages. `build.sbt` has following setup:\n\n* `dockerBuildxSettings` creates Docker Buildx instance\n* Docker base image is `openjdk:11-jdk-stretch` which supports multi-arch images\n* `dockerBuildCommand` is extended with operator `buildx`\n* `dockerBuildOptions` has two additional parameters: `--platform=linux/arm64,linux/amd64` and `--push`\n\nFor the native server configuration is the same apart from Docker base image.\n\nParameter `--push` is very crucial. Since `docker buildx build` subcommand is not storing the resulting image in the local `docker image` list, we need that flag to determine where the final image will be stored.\nFlag `--load` makes output destination of type docker. However, this currently works only for single architecture images. Therefore, both sbt commands - `docker:publishLocal` and `docker:publish` are pushing images to a Docker registry.\n\nTo change this - switch parameters for `dockerBuildOptions`:\n\n* from `--push` to `--load` and\n* from `--platform=linux/arm64,linux/amd64` to `--platform=linux/amd64`\n\nTo build images locally:\n\n* switch sbt to module server - `sbt project server` (or `sbt project nativeServer` for module native-server)\n* make sure Docker Buildx is running `docker buildx version`\n* create Docker Buildx instance `docker buildx create --use --name multi-arch-builder`\n* generate the Dockerfile executing `sbt docker:stage` - it will be generated in `server/target/docker/stage`\n* generate multi-arch image and push it to Docker Hub:\n```\ndocker buildx build --platform=linux/arm64,linux/amd64 --push -t softwaremill/elasticmq .\n```\n* or generate single-arch image and load it to docker images locally:\n```\ndocker buildx build --platform=linux/amd64 --load -t softwaremill/elasticmq .\n```\n\n\n# Tests and coverage\n\nTo run the tests:\n```\n~/workspace/elasticmq $ sbt test\n```\n\nTo check the coverage reports:\n```\n~/workspace/elasticmq $ sbt\n\u003e coverage\n\u003e tests\n\u003e coverageReport\n\u003e coverageAggregate\n```\n\nAlthough it's mostly only the core project that is relevant for coverage testing, each project's report can be found\nin their target directory:\n\n * core/target/scala-2.12/scoverage-report/index.html\n * common-test/target/scala-2.12/scoverage-report/index.html\n * rest/rest-sqs/target/scala-2.12/scoverage-report/index.html\n * server/target/scala-2.12/scoverage-report/index.html\n\nThe aggregate report can be found at target/scala-2.12/scoverage-report/index.html\n\n# UI\n\n![ElasticMQ-UI](ui.png)\n\nUI provides real-time information about the state of messages and attributes of queue.\n\n### Using UI in docker image\n\nUI is bundled with both standard and native images. It is exposed on the address that is defined in rest-stats configuration (by default 0.0.0.0:9325).\n\nIn order to turn it off, you have to switch it off via rest-stats.enabled flag.\n\n### Using UI locally\n\nYou can start UI via `yarn start` command in the `ui` directory, which will run on localhost:3000 address.\n\n# MBeans\n\nElasticMQ exposes `Queues` MBean. It contains three operations:\n* `QueueNames` - returns array of names of queues\n* `NumberOfMessagesForAllQueues` - returns tabular data that contains information about number of messages per queue\n* `getNumberOfMessagesInQueue` - returns information about number of messages in specified queue\n\n# Health check endpoint\n\nWhen running the server in a container orchestration environment, it may be useful to have a health check endpoint.\nElasticMQ provides a simple health check endpoint that can be used for this purpose. The endpoint is available at `/health`.\n\n# Technology\n\n* Core: [Scala](http://scala-lang.org) and [Pekko](https://pekko.apache.org/).\n* Rest server: [Pekko HTTP](https://pekko.apache.org/docs/pekko-http/current/), a high-performance,\n  asynchronous, REST/HTTP toolkit.\n* Testing the SQS interface: [Amazon Java SDK](http://aws.amazon.com/sdkforjava/);\n  see the `rest-sqs-testing-amazon-java-sdk` module for the testsuite.\n\n# Commercial Support\n\nWe offer commercial support for ElasticMQ and related technologies, as well as development services. [Contact us](https://softwaremill.com) to learn more about our offer!\n\n# Copyright\n\nCopyright (C) 2011-2021 SoftwareMill [https://softwaremill.com](https://softwaremill.com).\n","funding_links":[],"categories":["Scala","Projects","进程间通信","\u003ca name=\"Scala\"\u003e\u003c/a\u003eScala","🧰 Tools"],"sub_categories":["Message Broker","Open-Source"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwaremill%2Felasticmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwaremill%2Felasticmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwaremill%2Felasticmq/lists"}