Code Monkey home page Code Monkey logo

alpine-sqs's Introduction

Alpine SQS (alpine-sqs)

banner

Docker Pulls Docker Pulls standard-readme compliant

Dockerized ElasticMQ server + web UI over Alpine Linux for local development.

Alpine SQS provides a containerized Java implementation of the Amazon Simple Queue Service (AWS-SQS). It is based on ElasticMQ running Alpine Linux and the Oracle Java 8 Server-JRE. It is compatible with AWS's API, CLI as well as the Amazon Java SDK. This allows for quicker local development without having to incurr in infrastructure costs.

The goal of this repository is to maintain an updated Docker environment for ElasticMQ with an integrated web UI for visualizing queues and messages.

Table of Contents

Background

When searching for existing local implementations of SQS I came across a Docker image by @vsouza called docker-SQS-local with over 11K pulls at the time.

This introduced me to ElasticMQ, which this project is based on and is described by it's creators as:

a message queue system, offering an actor-based Scala and an SQS-compatible REST (query) interface.

Using his work as inspiration I decided to improve upon it by implementing the following:

  • Reduce the Docker image foot-print as much as possible.
  • Automatically update to the latest ElasticMQ server.
  • Integrated UI for message-queue visualization.
  • Automatic tests & builds (work in progress).
  • Thorough documentation.

See also

For more information on the different projects this work is based on, please visit:

Install

Pre-requisites

To be able to use this environment, please make sure you have installed the latest version of Docker.

If you intend to build the environment yourself, it is recommended that you also install the latest version of Docker Compose.

Installation methods

You can obtain the environment in two ways; The easiest is to pull the image directly from Docker Hub. Also, you may clone this repository and build/run it using Docker Compose.

1. Pulling from Docker Hub

docker pull roribio16/alpine-sqs

2. Building from scratch

git clone https://github.com/roribio/alpine-sqs.git

Usage

Running the environment

Depending on how you chose to install the environment, you can initialize it in three ways:

1. docker run method

Use this method if you're pulling directly from Docker Hub and do not have a docker-compose.yml file.

docker run --name alpine-sqs -p 9324:9324 -p 9325:9325 -d roribio16/alpine-sqs:latest

Custom configuration files may be used to override default behaviors. You can mount a volume mapping the container's /opt/custom directory to a folder in your host machine where the custom configuration files are stored.

Providing for sake of example that in your host machine directory /opt/alpine-sqs you have both elasticmq.conf and sqs-insight.conf files, you can run the container with:

docker run --name alpine-sqs -p 9324:9324 -p 9325:9325 -v /opt/alpine-sqs:/opt/custom -d roribio16/alpine-sqs:latest

For any configuration file not explicitly included in the container's /opt/custom directory, alpine-sqs will fall back to using the default configuration files listed here.

2. docker-compose up method

If you've cloned the repository you can still take advantage of the image present in Docker Hub by running the container from the default docker-compose.yml file. This will pull the pre-built image from the public registry and run it with the same values stated in the previous method.

docker-compose up -d

3. docker-compose up --build method

To build the image from scratch and then run the corresponding container, use this method.

docker-compose -f docker-compose.build up -d --build

Note: To use any of the Docker Compose methods, you need to clone this repository as well as have Docker Compose installed.

Note 2: Depending on your platform, you may need to adjust how you declare mounted volumes. You can find instructions for your specific platform here.

Working with queues

ElasticMQ provides an Amazon-SQS compatible interface. This means you may use the AWS command-line tool, API calls and the Java SDK, to interact with local queues the same as if interacting with the actual SQS.

Default queue

The default configuration provisions ElasticMQ with a initial queue of the same name at run time. This allows you to start pushing messages to the queue without further configuration.

To make use of this queue, point your client to: http://localhost:9324/queue/default.

Dead letter queue

The default dead letter queue is called dlq, configured in opt/elasticmq.conf

Sending a message

To send messages to a queue you need to specify the new endpoint url and queue url along with the message payload. The following example uses the AWS CLI to send a message to the default queue.

aws --endpoint-url http://localhost:9324 sqs send-message --queue-url http://localhost:9324/queue/default --message-body "Hello, queue!"

Viewing messages

To view messages, navigate to the web UI (sqs-insight) by pointing your web browser to http://localhost:9325.

You can also poll for messages from the command-line like so:

aws --endpoint-url http://localhost:9324 sqs receive-message --queue-url http://localhost:9324/queue/default --wait-time-seconds 10

Creating new queues

You can create new queues by using the command-line or configuring ElasticMQ directly.

AWS CLI
aws --endpoint-url http://localhost:9324 sqs create-queue --queue-name newqueue
Edit ElasticMQ configuration file

Navigate to the directory where the configuration files reside and edit the elasticmq.conf file to add a new entry for each queue to the queue block.

queues {
    default {
        defaultVisibilityTimeout = 10 seconds
        delay = 5 seconds
        receiveMessageWait = 0 seconds
    },
    newqueue {
        defaultVisibilityTimeout = 10 seconds
        delay = 5 seconds
        receiveMessageWait = 0 seconds
    }
}

Note: The configuration directory location inside the container is located at /opt/config. If you mounted that volume onto your host, you can also find the configuration files there.

After editing the elasticmq.conf file, you need to restart the ElasticMQ server by running the supervisorctl restart elasticmq command inside the container. If you're editing the configuration file outside of the container, use this command:

docker exec -it alpine-sqs sh -c "supervisorctl restart elasticmq"

Registering new queues with the UI

To be able to visualize newly created queues, you need to edit the sqs-insight.conf file to register the new queue with the UI server. Edits to this file are automatically detected by the server and does not require a restart.

Configure a new endpoint like this:

"endpoints": [
        {
           "key": "notValidKey",
           "secretKey": "notValidSecret",
           "region": "eu-central-1",
           "url": "http://localhost:9324/queue/default"
        },
        {
           "key": "notValidKey",
           "secretKey": "notValidSecret",
           "region": "eu-central-1",
           "url": "http://localhost:9324/queue/newqueue"
        }
    ]

All the fields, except the url field, are required by sqs-insight to function but are not used when pointing it to a local queue server. This means that the values in those fields are not relevant for the UI to work correctly.

Consult the AWS CLI Command Reference or the AWS SDK for Java guide for more examples and information.

Maintainer

Ronald E. Oribio R. - @roribio.

Contribute

PRs are accepted and encouraged!

Please direct any questions, requests, or comments to the Issues section of this project.

Note: If editing this Readme, please conform to the standard-readme specification.

License

Copyright 2017 Ronald E. Oribio R.

This project is licensed under the GNU General Public License, version 3.0. See the LICENSE file for details.

alpine-sqs's People

Contributors

anandg112 avatar galcohen88 avatar kobim avatar nelsonjchen avatar note avatar phylu avatar roribio avatar sidneibjunior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

alpine-sqs's Issues

Is the license GPL3 or AGPL3?

Readme says GPL3. Repo license file says AGPL3.

As a commentary, some organizations have AGPL on their "absolutely no" list even if the software isn't redistributed. I really doubt this project will be embed into a closed source web application to be served to end users since it's just a local or CI/CD testing/development tool and it might be better to go for the less restrictive license.

Doesn't work, leaks.

Even when configured for local it tries to shoot out onto the internet...

{ UnknownEndpoint: Inaccessible host: `sqs.local.amazonaws.com'. This service may not be available in the `local' region.
    at Request.ENOTFOUND_ERROR (/opt/sqs-insight/node_modules/aws-sdk/lib/event_listeners.js:494:46)
    at Request.callListeners (/opt/sqs-insight/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/opt/sqs-insight/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/opt/sqs-insight/node_modules/aws-sdk/lib/request.js:683:14)
    at ClientRequest.error (/opt/sqs-insight/node_modules/aws-sdk/lib/event_listeners.js:333:22)
    at ClientRequest.<anonymous> (/opt/sqs-insight/node_modules/aws-sdk/lib/http/node.js:96:19)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at emitOne (events.js:116:13)

Is using SQS insight really a good idea? It hasn't been touched since 2015.

Supervisord errors on run

  • Supervisord marks the sqs-init.sh script as FAILED after container starts
  • Supervisorctl fails when run to check status of processes
    error: <class 'socket.error'>, [Errno 99] Address not available: file: /usr/lib/python2.7/socket.py line: 575

AWS Java Client point to local queue

Could you please give some hint how to point aws java client to local queue?
I've tried something like this but apparently client can't find the queue.

AmazonSQSClientBuilder.standard()
                    .withEndpointConfiguration(
                            new AwsClientBuilder.EndpointConfiguration("http://localhost:9324/queue", "notSureWhatRegionPutHere"))
                    .build();

Any help would be appreciated. Thanks!

EDIT
The solution was to fix endpoint by removing queue name from it.
Below version seems to work:

AmazonSQSClientBuilder.standard()
                    .withEndpointConfiguration(
                            new AwsClientBuilder.EndpointConfiguration("http://localhost:9324", "localhost"))
                    .build();

Thanks

Container fails to start after latest docker build

Hello,

This container was working perfectly until this morning. After the latest docker build on the morning of Feb 25, 2019 the container stopped working correctly. Logs show:

2019-02-25 17:23:51,778 INFO Included extra file "/etc/supervisor/conf.d/elasticmq.conf" during parsing
2019-02-25 17:23:51,778 INFO Included extra file "/etc/supervisor/conf.d/insight.conf" during parsing
2019-02-25 17:23:51,778 INFO Included extra file "/etc/supervisor/conf.d/sqs-init.conf" during parsing
2019-02-25 17:23:51,778 INFO Set uid to user 0 succeeded
2019-02-25 17:23:51,787 INFO RPC interface 'supervisor' initialized
2019-02-25 17:23:51,787 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-02-25 17:23:51,788 INFO supervisord started with pid 1
2019-02-25 17:23:52,791 INFO spawned: 'sqs-init' with pid 7
2019-02-25 17:23:52,793 INFO spawned: 'elasticmq' with pid 8
2019-02-25 17:23:52,794 INFO spawned: 'insight' with pid 9
cp: can't stat '/opt/custom/*.conf': No such file or directory
Error: Invalid or corrupt jarfile /opt/elasticmq-server.jar
2019-02-25 17:23:52,799 INFO exited: elasticmq (exit status 1; not expected)

> [email protected] start /opt/sqs-insight
> node index.js

Loading config file from "/opt/sqs-insight/lib/../config/config_local.json"
2019-02-25 17:23:53,799 INFO success: sqs-init entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-02-25 17:23:53,799 INFO success: insight entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-02-25 17:23:53,799 INFO exited: sqs-init (exit status 0; expected)
Unable to load queues for  undefined
2019-02-25 17:23:54,163 INFO spawned: 'elasticmq' with pid 34
Config contains 0 queues.
Error: Invalid or corrupt jarfile /opt/elasticmq-server.jar
2019-02-25 17:23:54,167 INFO exited: elasticmq (exit status 1; not expected)
listening on port 9325
2019-02-25 17:23:56,457 INFO spawned: 'elasticmq' with pid 35
Error: Invalid or corrupt jarfile /opt/elasticmq-server.jar
2019-02-25 17:23:56,464 INFO exited: elasticmq (exit status 1; not expected)
2019-02-25 17:23:59,469 INFO spawned: 'elasticmq' with pid 36
Error: Invalid or corrupt jarfile /opt/elasticmq-server.jar
2019-02-25 17:23:59,474 INFO exited: elasticmq (exit status 1; not expected)
2019-02-25 17:23:59,474 INFO gave up: elasticmq entered FATAL state, too many start retries too quickly
Unable to load queues for  undefined

Custom configs doesn't work

Hi @roribio,

Yesterday you closed #11 but unfortunately it doesn't work for me.

Steps to reproduce:

  1. git clone https://github.com/roribio/alpine-sqs.git
  2. Edit file alpine-sqs/opt/elasticmq.conf to such content:
include classpath("application.conf")

node-address {
    protocol = http
    host = "*"
    port = 9324
    context-path = ""
}

rest-sqs {
    enabled = true
    bind-port = 9324
    bind-hostname = "0.0.0.0"
    // Possible values: relaxed, strict
    sqs-limits = strict
}

queues {
    default {
        defaultVisibilityTimeout = 10 seconds
        delay = 5 seconds
        receiveMessageWait = 0 seconds
    },
    test {
        defaultVisibilityTimeout = 10 seconds
        delay = 5 seconds
        receiveMessageWait = 0 seconds
    }
}
  1. Edit file alpine-sqs/opt/elasticmq.conf to such content:
{
    "port": 9325,
    "rememberMessages": 100,

    "endpoints": [
        {
           "key": "notValidKey",
           "secretKey": "notValidSecret",
           "region": "eu-central-1",
           "url": "http://localhost:9324/queue/default",
           "visibility": 0
        },
        {
           "key": "notValidKey",
           "secretKey": "notValidSecret",
           "region": "eu-central-1",
           "url": "http://localhost:9324/queue/test",
           "visibility": 0
        }
    ]
}
  1. Run docker: docker run -p 9324:9324 -p 9325:9325 -v /Users/moleksyuk/tmp/alpine-sqs/opt:/opt/custom roribio16/alpine-sqs:latest

In logs I see it says only one queue is available:

~/tmp/alpine-sqs/opt   master ●  docker run -p 9324:9324 -p 9325:9325 -v /Users/moleksyuk/tmp/alpine-sqs/opt:/opt/custom roribio16/alpine-sqs:latest
2018-06-21 15:24:25,324 CRIT Set uid to user 0
2018-06-21 15:24:25,324 INFO Included extra file "/etc/supervisor/conf.d/elasticmq.conf" during parsing
2018-06-21 15:24:25,324 INFO Included extra file "/etc/supervisor/conf.d/insight.conf" during parsing
2018-06-21 15:24:25,324 INFO Included extra file "/etc/supervisor/conf.d/sqs-init.conf" during parsing
2018-06-21 15:24:25,330 INFO RPC interface 'supervisor' initialized
2018-06-21 15:24:25,331 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2018-06-21 15:24:25,331 INFO supervisord started with pid 1
2018-06-21 15:24:26,337 INFO spawned: 'sqs-init' with pid 9
2018-06-21 15:24:26,340 INFO spawned: 'elasticmq' with pid 10
2018-06-21 15:24:26,343 INFO spawned: 'insight' with pid 11

> [email protected] start /opt/sqs-insight
> node index.js

15:24:27.187 [main] INFO  org.elasticmq.server.Main$ - Starting ElasticMQ server (0.13.8) ...
Loading config file from "/opt/sqs-insight/lib/../config/config_local.json"
Config contains 1 queues.
Adding consumer for default
2018-06-21 15:24:27,364 INFO success: sqs-init entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-06-21 15:24:27,364 INFO success: elasticmq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-06-21 15:24:27,365 INFO success: insight entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-06-21 15:24:27,365 INFO exited: sqs-init (exit status 0; expected)
listening on port 9325
15:24:28.235 [elasticmq-akka.actor.default-dispatcher-3] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
15:24:29.685 [elasticmq-akka.actor.default-dispatcher-2] INFO  o.e.rest.sqs.TheSQSRestServerBuilder - Started SQS rest server, bind address 0.0.0.0:9324, visible server address * (depends on incoming request path)
15:24:29.755 [elasticmq-akka.actor.default-dispatcher-2] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(test,MillisVisibilityTimeout(10000),PT5S,PT0S,2018-06-21T15:24:29.685Z,2018-06-21T15:24:29.685Z,None,None)
15:24:29.761 [elasticmq-akka.actor.default-dispatcher-2] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(default,MillisVisibilityTimeout(10000),PT5S,PT0S,2018-06-21T15:24:29.761Z,2018-06-21T15:24:29.761Z,None,None)
15:24:29.763 [main] INFO  org.elasticmq.server.Main$ - === ElasticMQ server (0.13.8) started in 3241 ms ===

And SQS-Insight also shows only default queue.
screen shot 2018-06-21 at 18 45 22

Is it bug or my config is wrong?

Queue fails to deliver messages

Hello!

I’m trying to set up the sqs queue but when initializing it, it shows the following logs:

22:31:37.421 [main] INFO  org.elasticmq.server.Main$ - === ElasticMQ server (0.15.0) started in 10675 ms ===
22:35:08.540 [elasticmq-akka.actor.default-dispatcher-8] INFO  akka.actor.DeadLetterActorRef - Message [org.elasticmq.MessageData] from Actor[akka://elasticmq/user/$a/$a#42008919] to Actor[akka://elasticmq/deadLetters] was not delivered. [1] dead letters encountered. If this is not an expected behavior, then [Actor[akka://elasticmq/deadLetters]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

2021-07-21 22:53:08,909 INFO exited: elasticmq (terminated by SIGKILL; not expected)
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
2021-07-21 22:53:09,008 INFO spawned: 'elasticmq' with pid 148
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
2021-07-21 22:53:10,184 INFO success: elasticmq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
22:53:11.533 [main] INFO  org.elasticmq.server.Main$ - Starting ElasticMQ server (0.15.0) ...
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
22:53:13.431 [elasticmq-akka.actor.default-dispatcher-2] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324

Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "default": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
Error on queue "dlq": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
22:53:17.178 [elasticmq-akka.actor.default-dispatcher-4] INFO  o.e.rest.sqs.TheSQSRestServerBuilder - Started SQS rest server, bind address 0.0.0.0:9324, visible server address * (depends on incoming request path) 
22:53:17.435 [elasticmq-akka.actor.default-dispatcher-2] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(dlq,MillisVisibilityTimeout(10000),PT5S,PT0S,2021-07-21T22:53:17.285Z,2021-07-21T22:53:17.285Z,None,false,false,None,None,Map())
22:53:17.530 [elasticmq-akka.actor.default-dispatcher-2] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(default,MillisVisibilityTimeout(10000),PT5S,PT0S,2021-07-21T22:53:17.529Z,2021-07-21T22:53:17.529Z,Some(DeadLettersQueueData(dlq,3)),false,false,None,None,Map())
22:53:17.541 [main] INFO  org.elasticmq.server.Main$ - === ElasticMQ server (0.15.0) started in 7821 ms ===

12:30:27.979 [elasticmq-akka.actor.default-dispatcher-2] INFO  org.elasticmq.actor.queue.QueueActor - default: Clearing queue

12:30:31.889 [elasticmq-akka.actor.default-dispatcher-8] INFO  akka.actor.DeadLetterActorRef - Message [org.elasticmq.MessageData] from Actor[akka://elasticmq/user/$a/$a#-1665137407] to Actor[akka://elasticmq/deadLetters] was not delivered. [8] dead letters encountered. If this is not an expected behavior, then [Actor[akka://elasticmq/deadLetters]] may have terminated unexpectedly, This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.

12:30:46.067 [elasticmq-akka.actor.default-dispatcher-6] INFO  org.elasticmq.actor.queue.QueueActor - default: Clearing queue

No messages are being delivered to my clients. I’m running this using Docker compose with the following config:

(... other config)
alpine-sqs:
    container_name: transactional-queue
    image: roribio16/alpine-sqs:latest
    # volumes:
    # - /dist/sqs-data:/opt/custom
    restart: always
    ports:
      - '9324:9324'
      - '9325:9325'

Can't receive messages

Hi, I have been using both this project and the docker-sqs-local, and in both cases I manage to push messages on the queue, using both the php sdk or the awscli, but everytime I try to fetch the messages it comes back empty.
Do you know if is something related to this Docker image or is the something that has to do with the latest elasticmq that this project pulls?

Is there a way I can find out?

SQS send_messages method response different from AWS resource

The following code:

import boto3


sqs_resource = boto3.resource('sqs', region_name='us-west-1')
sqs_queue = sqs_resource.get_queue_by_name(QueueName='test-queue')

res = sqs_queue.send_messages(Entries=[
    {'Id': '1', 'MessageBody': json.dumps({'body': 'the body'})},
    {'Id': '2', 'MessageBody': json.dumps({'body': 'the body'})},
    {'Id': '3', 'MessageBody': json.dumps({'body': 'the body'})}
])

gives a different response from the one given when using a real AWS resource:

{'ResponseMetadata': {'RequestId': '00000000-0000-0000-0000-000000000000', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'akka-http/10.1.3', 'date': 'Wed, 17 Apr 2019 09:48:34 GMT', 'content-type': 'text/plain; charset=UTF-8', 'content-length': '356'}, 'RetryAttempts': 0}}

real-resource response:

{'ResponseMetadata': {'HTTPHeaders': {'content-length': '861',
                                      'content-type': 'text/xml',
                                      'date': 'Thu, 18 Apr 2019 10:10:42 GMT',
                                      'x-amzn-requestid': '17e336a0-0649-5dc1-8c0f-6392492b6b4a'},
                      'HTTPStatusCode': 200,
                      'RequestId': '17e336a0-0649-5dc1-8c0f-6392492b6b4a',
                      'RetryAttempts': 0},
 'Successful': [{'Id': '1',
                 'MD5OfMessageBody': '1b36e5c2aa17fe938e3fa648099afac7',
                 'MessageId': '510f82e2-6bc5-4ca5-acda-e74f7166782a'},
                {'Id': '2',
                 'MD5OfMessageBody': '1b36e5c2aa17fe938e3fa648099afac7',
                 'MessageId': '3fd7c53e-ced4-48e1-8ed5-4402e0b7865b'},
                {'Id': '3',
                 'MD5OfMessageBody': '1b36e5c2aa17fe938e3fa648099afac7',
                 'MessageId': '8be0c543-e77f-42d0-a297-62b289481ea2'}]}

Use tag with your docker-image

Hello,

Can you please use tag with your repo and docker images ?

We want to integrate this image but some build break so we need versioning with tag.

Thank you in advance.

Regards,

Update elasticmq release version parsing

The elasticmq project changed it's tagging scheme and new builds of alpine-sqs are pulling down an outdated version of it.

Current version is v0.14.6 while alpine-sqs latest is running v0.13.8

Queue is not working when launching

Hi,
I used that SQS Local queue to consume locally my messages.
But I still get a recurrent error :
xx_api | [2022-10-04T11:40:35.657809+00:00][e31f6be][API] app.INFO: Try #1 after 917ms: Idle timeout reached for "http://169.254.169.254/latest/meta-data/iam/security-credentials". {"count":1,"delay":917} {"env":"dev","url":"/event/zelty","ip":"172.18.0.1","http_method":"POST","server":"localhost","referrer":null,"process_id":65,"memory_usage":"4 MB","memory_peak_usage":"4 MB"} xx_api | [2022-10-04T11:40:36.659672+00:00][e31f6be][CISAPI app.INFO: Try #2 after 2197ms: Idle timeout reached for "http://169.254.169.254/latest/meta-data/iam/security-credentials". {"count":2,"delay":2197} {"env":"dev","url":"/event/zelty","ip":"172.18.0.1","http_method":"POST","server":"localhost","referrer":null,"process_id":65,"memory_usage":"4 MB","memory_peak_usage":"4 MB"} xx_api | [2022-10-04T11:40:37.663658+00:00][e31f6be][API] app.INFO: Try #3 after 3872ms: Idle timeout reached for "http://169.254.169.254/latest/meta-data/iam/security-credentials". {"count":3,"delay":3872} {"env":"dev","url":"/event/zelty","ip":"172.18.0.1","http_method":"POST","server":"localhost","referrer":null,"process_id":65,"memory_usage":"4 MB","memory_peak_usage":"4 MB"} xx_api | [2022-10-04T11:40:38.669569+00:00][e31f6be][API] app.INFO: Failed to fetch Profile from Instance Metadata. {"exception":{"message":"Idle timeout reached for \"http://169.254.169.254/latest/meta-data/iam/security-credentials\".","file":"/usr/share/cis/vendor/symfony/http-client/Chunk/ErrorChunk.php","line":62,"code":0}} {"env":"dev","url":"/event/zelty","ip":"172.18.0.1","http_method":"POST","server":"localhost","referrer":null,"process_id":65,"memory_usage":"4 MB","memory_peak_usage":"4 MB"} xx_api | [2022-10-04T11:40:38.748923+00:00][e31f6be][API] app.DEBUG: EventPayloadMessage dispatched {"payload_id":"01GEHCRCAYNZDGCJXTW17G86T4","provider_id":"4491","provider":"zelty","event_type":"product_updated"} {"env":"dev","url":"/event/zelty","ip":"172.18.0.1","http_method":"POST","server":"localhost","referrer":null,"process_id":65,"memory_usage":"4 MB","memory_peak_usage":"4 MB"}

Plus, when I try to consume the messages in the queue :
[2022-10-04T11:42:06.158620+00:00][628219c][CIS] app.INFO: Try #1 after 1038ms: Idle timeout reached for "http://169.254.169.254/latest/meta-data/iam/security-credentials". {"count":1,"delay":1038} {"env":"dev","process_id":128,"memory_usage":"20 MB","memory_peak_usage":"20 MB"} [2022-10-04T11:42:07.162062+00:00][628219c][CIS] app.INFO: Try #2 after 1957ms: Idle timeout reached for "http://169.254.169.254/latest/meta-data/iam/security-credentials". {"count":2,"delay":1957} {"env":"dev","process_id":128,"memory_usage":"20 MB","memory_peak_usage":"20 MB"} [2022-10-04T11:42:08.164022+00:00][628219c][CIS] app.INFO: Try #3 after 3927ms: Idle timeout reached for "http://169.254.169.254/latest/meta-data/iam/security-credentials". {"count":3,"delay":3927} {"env":"dev","process_id":128,"memory_usage":"20 MB","memory_peak_usage":"20 MB"} [2022-10-04T11:42:09.167994+00:00][628219c][CIS] app.INFO: Failed to fetch Profile from Instance Metadata. {"exception":{"message":"Idle timeout reached for \"http://169.254.169.254/latest/meta-data/iam/security-credentials\".","file":"/usr/share/cis/vendor/symfony/http-client/Chunk/ErrorChunk.php","line":62,"code":0}} {"env":"dev","process_id":128,"memory_usage":"20 MB","memory_peak_usage":"20 MB"}
That's my service docker-compose.yml :

alpine-sqs:
        image: roribio16/alpine-sqs:latest
        container_name: alpine_sqs
        hostname: sqs
        ports:
            - "9324:9324"
            - "9325:9325"
        stdin_open: true
        tty: true

Anyone can help me to resolve that issue ?

Support for JSON protocol

First of all, thank you for your great work on this project!

Recently AWS introduced support for JSON protocol for SQS. Unfortunately, this is a problem when upgrading AWS SDK because there is no way of switching between protocols. It would be nice to eventually support the JSON format as well.

Relevant links:

about init queue

  1. I update the sqs-insight.conf, and run it with docker (the conf at the below)
  2. I use aws cli to list the queue, and only the default queue
aws --endpoint-url http://192.168.1.104:9324 sqs list-queues
{
    "QueueUrls": [
        "http://192.168.1.104:9324/queue/default"
    ]
}
  1. But I could see the queue tube on the http://localhost:9325 ...

sqs-insight.conf

{
    "port": 9325,
    "rememberMessages": 100,

    "endpoints": [
        {
           "key": "notValidKey",
           "secretKey": "notValidSecret",
            "region": "us-east-1",
            "url": "http://localhost:9324/queue/newqueue"
        }
    ],

    "dynamicEndpoints": [
        {
           "key": "notValidKey",
           "secretKey": "notValidSecret",
           "region": "us-east-1",
           "url": "http://localhost:9324",
           "visibility": 0
        }
    ]
}

CPU over 100% when queues are not empty

I think the title says it all.

using docker stats when my queues are empty, CPU reports around 3%

If I use the following command ONCE, the CPU jumps to 130%

aws --endpoint-url http://localhost:9324 sqs send-message --queue-url http://localhost:9324/queue/my_queue --message-body "Hello, queue"

Is this a known issue? Any ideas on how to fix it?

roribio16/alpine-sqs:latest not working wie apple silicon

I am trying to launch roribio16/alpine-sqs:latest but I keeps crashing due to a segmentation fault SIGSEGV.

Expected behavior
It should rund the alpine-sqs queue

Actual behavior
Crashing on launch

Information
macOS Version: macOS Big Sur 11.1 (20C69)
Diagnostic logs

08:43:48.844 [main] INFO org.elasticmq.server.Main$ - Starting ElasticMQ server (0.15.0) ...
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
2021-01-15 08:43:49,037 INFO exited: elasticmq (terminated by SIGSEGV; not expected)
listening on port 9325
2021-01-15 08:43:49,179 INFO spawned: 'elasticmq' with pid 90
Error on queue "dev_third-party": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
2021-01-15 08:43:50,438 INFO success: elasticmq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-01-15 08:43:50,441 INFO exited: elasticmq (terminated by SIGSEGV; not expected)
Error on queue "dev_mail": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
2021-01-15 08:43:50,951 INFO spawned: 'elasticmq' with pid 107
Error on queue "dev_ticket": SQS receive message failed: connect ECONNREFUSED 127.0.0.1:9324
2021-01-15 08:43:51,956 INFO success: elasticmq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
2021-01-15 08:43:52,155 INFO exited: elasticmq (terminated by SIGSEGV; not expected)
2021-01-15 08:43:53,115 INFO spawned: 'elasticmq' with pid 124
2021-01-15 08:43:53,116 WARN received SIGTERM indicating exit request
2021-01-15 08:43:53,117 INFO waiting for insight, elasticmq to die
2021-01-15 08:43:53,131 INFO stopped: insight (terminated by SIGTERM)
2021-01-15 08:43:53,132 INFO stopped: elasticmq (terminated by SIGTERM)

Docker for Mac: Docker-AppleSilicon-Preview7

Steps to reproduce the behavior
Get roribio16/alpine-sqs:latest
Launch Docker image

FIFO queue deduplication ID doesn't work

I tried sending a message with the same message-deduplication-id multiple times, and all of them got processed by my queue consumer. They all had the same message-group-id too.

Is JSON Response supported ?

I am wondering if there is a config I am missing in order the queue to respond with a JSON instead of a String. I send a JSON with aws and the queue registers it just fine but I receive a String when I try to get it from the queue with @SqsListener(Java and Spring).

Thank you.

Expose elasticmq logs

Elasticmq output is being hidden by the docker container. The intention is to expose said logs so users can debug elasticmq issues.

Insight Startup Issue with extra queues

I have created a new queues via a custom elasticmq.conf. I copy and pasted the default and dlq queues and twaeked the names.

That seems to start up fine.

However, when I look at localhost:9325 to see the queues it doesn't show much. Just a blank page with a line at the top, assuming for the menu.

In the logs something is unable to load logs, but I don't know what that is or why it is having a hard time loading.

I also noticed Config contains 0 queues., but not sure what that is referecing as well.

This is the output from my docker-compose file

version: "3"

services:
  elasticmq:
    image: roribio16/alpine-sqs:latest
    ports:
      - 9324:9324
      - 9325:9325
    volumes:
      - .sqsconfig:/opt/custom
[+] Running 1/1
 ⠿ Container pdf-server-elasticmq-1  Recreated                                                                                                                                                                                                                                                   0.1s
Attaching to pdf-server-elasticmq-1
pdf-server-elasticmq-1  | 2021-10-19 16:46:50,418 INFO Included extra file "/etc/supervisor/conf.d/elasticmq.conf" during parsing
pdf-server-elasticmq-1  | 2021-10-19 16:46:50,418 INFO Included extra file "/etc/supervisor/conf.d/insight.conf" during parsing
pdf-server-elasticmq-1  | 2021-10-19 16:46:50,418 INFO Included extra file "/etc/supervisor/conf.d/sqs-init.conf" during parsing
pdf-server-elasticmq-1  | 2021-10-19 16:46:50,418 INFO Set uid to user 0 succeeded
pdf-server-elasticmq-1  | 2021-10-19 16:46:50,429 INFO RPC interface 'supervisor' initialized
pdf-server-elasticmq-1  | 2021-10-19 16:46:50,429 CRIT Server 'unix_http_server' running without any HTTP authentication checking
pdf-server-elasticmq-1  | 2021-10-19 16:46:50,429 INFO supervisord started with pid 1
pdf-server-elasticmq-1  | 2021-10-19 16:46:51,436 INFO spawned: 'sqs-init' with pid 9
pdf-server-elasticmq-1  | 2021-10-19 16:46:51,438 INFO spawned: 'elasticmq' with pid 10
pdf-server-elasticmq-1  | 2021-10-19 16:46:51,442 INFO spawned: 'insight' with pid 11
pdf-server-elasticmq-1  |
pdf-server-elasticmq-1  | > [email protected] start /opt/sqs-insight
pdf-server-elasticmq-1  | > node index.js
pdf-server-elasticmq-1  |
pdf-server-elasticmq-1  | 16:46:52.322 [main] INFO  org.elasticmq.server.Main$ - Starting ElasticMQ server (0.15.0) ...
pdf-server-elasticmq-1  | 2021-10-19 16:46:52,456 INFO success: sqs-init entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
pdf-server-elasticmq-1  | 2021-10-19 16:46:52,456 INFO success: elasticmq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
pdf-server-elasticmq-1  | 2021-10-19 16:46:52,456 INFO success: insight entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
pdf-server-elasticmq-1  | 2021-10-19 16:46:52,456 INFO exited: sqs-init (exit status 0; expected)
pdf-server-elasticmq-1  | Loading config file from "/opt/sqs-insight/lib/../config/config_local.json"
pdf-server-elasticmq-1  | 16:46:53.160 [elasticmq-akka.actor.default-dispatcher-3] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
pdf-server-elasticmq-1  | Unable to load queues for  undefined
pdf-server-elasticmq-1  | Unable to load queues for  undefined
pdf-server-elasticmq-1  | Unable to load queues for  undefined
pdf-server-elasticmq-1  | Config contains 0 queues.
pdf-server-elasticmq-1  | listening on port 9325
pdf-server-elasticmq-1  | 16:46:54.828 [elasticmq-akka.actor.default-dispatcher-4] INFO  o.e.rest.sqs.TheSQSRestServerBuilder - Started SQS rest server, bind address 0.0.0.0:9324, visible server address * (depends on incoming request path)
pdf-server-elasticmq-1  | 16:46:54.915 [elasticmq-akka.actor.default-dispatcher-4] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(pdfgenerationdlq,MillisVisibilityTimeout(10000),PT5S,PT0S,2021-10-19T16:46:54.841Z,2021-10-19T16:46:54.841Z,None,false,false,None,None,Map())
pdf-server-elasticmq-1  | 16:46:54.946 [elasticmq-akka.actor.default-dispatcher-4] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(pdfgeneration,MillisVisibilityTimeout(10000),PT5S,PT0S,2021-10-19T16:46:54.945Z,2021-10-19T16:46:54.945Z,Some(DeadLettersQueueData(pdfgenerationdlq,3)),false,false,None,None,Map())
pdf-server-elasticmq-1  | 16:46:54.947 [elasticmq-akka.actor.default-dispatcher-4] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(pdfgenresponsedlq,MillisVisibilityTimeout(10000),PT5S,PT0S,2021-10-19T16:46:54.947Z,2021-10-19T16:46:54.947Z,None,false,false,None,None,Map())
pdf-server-elasticmq-1  | 16:46:54.948 [elasticmq-akka.actor.default-dispatcher-4] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(pdfgenresponse,MillisVisibilityTimeout(10000),PT5S,PT0S,2021-10-19T16:46:54.948Z,2021-10-19T16:46:54.948Z,Some(DeadLettersQueueData(pdfgenresponsedlq,3)),false,false,None,None,Map())
pdf-server-elasticmq-1  | 16:46:54.957 [elasticmq-akka.actor.default-dispatcher-4] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(defaultdlq,MillisVisibilityTimeout(10000),PT5S,PT0S,2021-10-19T16:46:54.957Z,2021-10-19T16:46:54.957Z,None,false,false,None,None,Map())
pdf-server-elasticmq-1  | 16:46:54.959 [elasticmq-akka.actor.default-dispatcher-4] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(default,MillisVisibilityTimeout(10000),PT5S,PT0S,2021-10-19T16:46:54.958Z,2021-10-19T16:46:54.958Z,Some(DeadLettersQueueData(defaultdlq,3)),false,false,None,None,Map())
pdf-server-elasticmq-1  | 16:46:54.965 [main] INFO  org.elasticmq.server.Main$ - === ElasticMQ server (0.15.0) started in 3355 ms ===
pdf-server-elasticmq-1  | 16:47:23.237 [elasticmq-akka.actor.default-dispatcher-8] WARN  o.e.r.s.TheSQSRestServerBuilder$$anon$1 - Unknown action: ListQueues
pdf-server-elasticmq-1  | 16:47:23.237 [elasticmq-akka.actor.default-dispatcher-9] WARN  o.e.r.s.TheSQSRestServerBuilder$$anon$1 - Unknown action: ListQueues
pdf-server-elasticmq-1  | 16:47:23.237 [elasticmq-akka.actor.default-dispatcher-6] WARN  o.e.r.s.TheSQSRestServerBuilder$$anon$1 - Unknown action: ListQueues
pdf-server-elasticmq-1  | Unable to load queues for  undefined
pdf-server-elasticmq-1  | Unable to load queues for  undefined
pdf-server-elasticmq-1  | Unable to load queues for  undefined

Anyone have any insights on seeing some insights...

Value default for parameter MessageGroupId is invalid

Flaskcelery code which is working with AWS SQS fifo Queue giving this error
botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the SendMessage operation: Value default for parameter MessageGroupId is invalid. The request include parameter that is not valid for this queue type

i created the Queue using command line
aws --endpoint-url http://localhost:9324 sqs create-queue --queue-name queue_name.fifo --attributes '{"FifoQueue": "True", "ContentBasedDeduplication":"True"}'

Req body

{'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'User-Agent': 'Boto3/1.17.112 Python/3.8.9 Darwin/18.7.0 Botocore/1.20.112'}, 'body': {'Action': 'SendMessage', 'Version': '2012-11-05', 'QueueUrl': 'http://localhost:9324/queue/queue-send-email-task.fifo', 'MessageBody': 'eyJib2R5Ijo...4a1d353e7'}, 'url': 'http://localhost:9324/', 'context': {'client_region': 'eu-central-1', 'client_config': <botocore.config.Config object at 0x10a7d84f0>, 'has_streaming_input': False, 'auth_type': None}}

Change credentials

Hello.

I am using boto3 and I have to set the AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID to an empty string. Is it possible to configure alpine-sqs to use different values for the credentials?

Dead Letter Queue fails

Using config as set below:

queues {
    default {
        defaultVisibilityTimeout = 10 seconds
        delay = 5 seconds
        receiveMessageWait = 0 seconds
        deadLettersQueue {
            name = "queue1-dead-letters"
            maxReceiveCount = 3 // from 1 to 1000
        }
    }
    queue1-dead-letters { }
}

When sending a message to default , it will automatically go to queue1-dead-letters.

I am using docker image roribio16/alpine-sqs and running it locally. Sending and receiving message commands same as README.

Have also tried same config with docker image softwaremill/elasticmq and it works. Not really sure what was wrong but help will be very much appreciated :D

support FIFO q?

Hi
Does this awesome project support FIFO feature?
And How should I use it?

Service startup errors

Upon booting the container up via docker-composer there is errors until something fully initializes:

$ docker-compose up
Starting alpine-sqs ... done
Attaching to alpine-sqs
alpine-sqs    | 2018-11-23 05:07:57,782 INFO Included extra file "/etc/supervisor/conf.d/elasticmq.conf" during parsing
alpine-sqs    | 2018-11-23 05:07:57,782 INFO Included extra file "/etc/supervisor/conf.d/insight.conf" during parsing
alpine-sqs    | 2018-11-23 05:07:57,782 INFO Included extra file "/etc/supervisor/conf.d/sqs-init.conf" during parsing
alpine-sqs    | 2018-11-23 05:07:57,782 INFO Set uid to user 0 succeeded
alpine-sqs    | 2018-11-23 05:07:57,790 INFO RPC interface 'supervisor' initialized
alpine-sqs    | 2018-11-23 05:07:57,791 CRIT Server 'unix_http_server' running without any HTTP authentication checking
alpine-sqs    | 2018-11-23 05:07:57,791 INFO supervisord started with pid 1
alpine-sqs    | 2018-11-23 05:07:58,793 INFO spawned: 'sqs-init' with pid 9
alpine-sqs    | 2018-11-23 05:07:58,794 INFO spawned: 'elasticmq' with pid 10
alpine-sqs    | 2018-11-23 05:07:58,796 INFO spawned: 'insight' with pid 11
alpine-sqs    | cp: can't stat '/opt/custom/*.conf': No such file or directory
alpine-sqs    | 
alpine-sqs    | > [email protected] start /opt/sqs-insight
alpine-sqs    | > node index.js
alpine-sqs    | 
alpine-sqs    | 2018-11-23 05:07:59,803 INFO success: sqs-init entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
alpine-sqs    | 2018-11-23 05:07:59,803 INFO success: elasticmq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
alpine-sqs    | 2018-11-23 05:07:59,803 INFO success: insight entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
alpine-sqs    | 2018-11-23 05:07:59,803 INFO exited: sqs-init (exit status 0; expected)
alpine-sqs    | Loading config file from "/opt/sqs-insight/lib/../config/config_local.json"
alpine-sqs    | 05:08:00.080 [main] INFO  org.elasticmq.server.Main$ - Starting ElasticMQ server (0.14.6) ...
alpine-sqs    | Unable to load queues for  undefined
alpine-sqs    | Error: No endpoints configured
alpine-sqs    |     at /opt/sqs-insight/lib/index.js:61:15
alpine-sqs    |     at _fulfilled (/opt/sqs-insight/node_modules/q/q.js:854:54)
alpine-sqs    |     at self.promiseDispatch.done (/opt/sqs-insight/node_modules/q/q.js:883:30)
alpine-sqs    |     at Promise.promise.promiseDispatch (/opt/sqs-insight/node_modules/q/q.js:816:13)
alpine-sqs    |     at /opt/sqs-insight/node_modules/q/q.js:624:44
alpine-sqs    |     at runSingle (/opt/sqs-insight/node_modules/q/q.js:137:13)
alpine-sqs    |     at flush (/opt/sqs-insight/node_modules/q/q.js:125:13)
alpine-sqs    |     at _combinedTickCallback (internal/process/next_tick.js:131:7)
alpine-sqs    |     at process._tickDomainCallback (internal/process/next_tick.js:218:9)
alpine-sqs    | bye bye.
alpine-sqs    | npm ERR! code ELIFECYCLE
alpine-sqs    | npm ERR! errno 1
alpine-sqs    | npm ERR! [email protected] start: `node index.js`
alpine-sqs    | npm ERR! Exit status 1
alpine-sqs    | npm ERR! 
alpine-sqs    | npm ERR! Failed at the [email protected] start script.
alpine-sqs    | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
alpine-sqs    | 
alpine-sqs    | npm ERR! A complete log of this run can be found in:
alpine-sqs    | npm ERR!     /root/.npm/_logs/2018-11-23T05_08_00_389Z-debug.log
alpine-sqs    | 2018-11-23 05:08:00,413 INFO exited: insight (exit status 1; not expected)
alpine-sqs    | 05:08:01.327 [elasticmq-akka.actor.default-dispatcher-4] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
alpine-sqs    | 2018-11-23 05:08:01,329 INFO spawned: 'insight' with pid 64
alpine-sqs    | 
alpine-sqs    | > [email protected] start /opt/sqs-insight
alpine-sqs    | > node index.js
alpine-sqs    | 
alpine-sqs    | Loading config file from "/opt/sqs-insight/lib/../config/config_local.json"
alpine-sqs    | 2018-11-23 05:08:02,509 INFO success: insight entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
alpine-sqs    | Unable to load queues for  undefined
alpine-sqs    | Error: No endpoints configured
alpine-sqs    |     at /opt/sqs-insight/lib/index.js:61:15
alpine-sqs    |     at _fulfilled (/opt/sqs-insight/node_modules/q/q.js:854:54)
alpine-sqs    |     at self.promiseDispatch.done (/opt/sqs-insight/node_modules/q/q.js:883:30)
alpine-sqs    |     at Promise.promise.promiseDispatch (/opt/sqs-insight/node_modules/q/q.js:816:13)
alpine-sqs    |     at /opt/sqs-insight/node_modules/q/q.js:624:44
alpine-sqs    |     at runSingle (/opt/sqs-insight/node_modules/q/q.js:137:13)
alpine-sqs    |     at flush (/opt/sqs-insight/node_modules/q/q.js:125:13)
alpine-sqs    |     at _combinedTickCallback (internal/process/next_tick.js:131:7)
alpine-sqs    |     at process._tickDomainCallback (internal/process/next_tick.js:218:9)
alpine-sqs    | bye bye.
alpine-sqs    | npm ERR! code ELIFECYCLE
alpine-sqs    | npm ERR! errno 1
alpine-sqs    | npm ERR! [email protected] start: `node index.js`
alpine-sqs    | npm ERR! Exit status 1
alpine-sqs    | npm ERR! 
alpine-sqs    | npm ERR! Failed at the [email protected] start script.
alpine-sqs    | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
alpine-sqs    | 
alpine-sqs    | npm ERR! A complete log of this run can be found in:
alpine-sqs    | npm ERR!     /root/.npm/_logs/2018-11-23T05_08_02_956Z-debug.log
alpine-sqs    | 2018-11-23 05:08:02,978 INFO exited: insight (exit status 1; not expected)
alpine-sqs    | 05:08:03.341 [elasticmq-akka.actor.default-dispatcher-3] INFO  o.e.rest.sqs.TheSQSRestServerBuilder - Started SQS rest server, bind address 0.0.0.0:9324, visible server address * (depends on incoming request path) 
alpine-sqs    | 2018-11-23 05:08:03,343 INFO spawned: 'insight' with pid 86
alpine-sqs    | 05:08:03.445 [elasticmq-akka.actor.default-dispatcher-3] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(default,MillisVisibilityTimeout(10000),PT5S,PT0S,2018-11-23T05:08:03.359Z,2018-11-23T05:08:03.359Z,None,false,false,None,None,Map())
alpine-sqs    | 05:08:03.489 [main] INFO  org.elasticmq.server.Main$ - === ElasticMQ server (0.14.6) started in 4451 ms ===
alpine-sqs    | 
alpine-sqs    | > [email protected] start /opt/sqs-insight
alpine-sqs    | > node index.js
alpine-sqs    | 
alpine-sqs    | Loading config file from "/opt/sqs-insight/lib/../config/config_local.json"
alpine-sqs    | 2018-11-23 05:08:04,375 INFO success: insight entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
alpine-sqs    | Config contains 1 queues.
alpine-sqs    | Adding consumer for default
alpine-sqs    | listening on port 9325

Docs for using with AWSSDK

I'm trying to use this to do local development since our org locks down our AWS account (even our dev). If it isn't deployed through our ops terraform and scripts it can't interact with AWS. This means that the AWS CLI is impractical. Hence, this image is a godsend for individuals like me who are forced to mock AWS services.

The problem I'm running into is that all of my .NET Core usage of the AWSSDK errors with "Operation timeout". I know this isn't this service's fault as I was able to beg/borrow/steal some credentials for a bit to use the CLI and I was able to create a ~/.aws/credentials file that let me run the AWS CLI commands listed in the README.MD. I was also able to give the .NET appsettings.json the profile name and it too was able to push a message to the service.

Is there a way to do this with faked AWS credentials (I know mine are going to expire at some point) seeing that I'm not really doing anything with AWS to communicate with this service? Could a quick document or link be given to point to this info?

I've used a S3 mock service before but I don't recall having to have a profile and credentials setup to get the AWSSDK to be tricked into using it.

Sorry if this isn't the place for this but I don't see any discussion forum other than an issue.

Again, thanks for providing this image for those of us who don't have access into AWS!

Delete message, creates another one

Hello, my problem with this docker is about delete message from aws cli.

When I send a message to a queue using this command:
aws --endpoint-url http://localhost:9324 sqs send-message --queue-url http://localhost:9324/queue/default --message-body "Hello, queue!"
Everything is ok. On the UI I see that message.
Receive message is alright too, because when I use this command:
aws sqs receive-message --endpoint-url http://localhost:9324 --queue-url http://localhost:9324/queue/default
I get a JSON object with MessageId, ReceiptHndle, Md5OfBody and Body properties.
Problem is when I trying to delete this message from a queue.

I send this command:
aws sqs delete-message --endpoint-url http://localhost:9324 --queue-url http://localhost:9324/queue/ShadowsDats.fifo --receipt-handle <value> as a value I put a ReceiptHandle property from before "Receive message"

This command not working. I see this message still. I don't have any response from that command.

Second problem is when I create a new queue using this command:
aws --endpoint-url http://localhost:9324 sqs create-queue --queue-name test --attributes FifoQueue=true,ContentBasedDeduplication=true,ReceiveMessageWaitTimeSeconds=20,VisibilityTimeout=3600

Sending message works fine, but when I trying to delete message which I receive before, then on my queue still see that message and (what is more important) i get a duplicate of message on that queue.
I test it on the AWS real service and that CLI commands works fine. Delete too.
Is I do something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.