This small application uses ElasticMQ + An express script to simulate the SNS-SQS interaction we see in a production or deployed environment.
docker run -it --rm -p 9325:9325 -p 9324:9324 zix99/snssqs-mock:latest
Two ports are exposed by the docker container:
- 9324: SQS Mock (ElasticMQ)
- 9325: SNS Mock
Publishing to a topic
There are 3 ways to publish to a SNS topic:
- Publish to the REST endpoint with the topic in the route, eg
- Public to the REST endpoint with a valid ARN in the SNS topic, which will be parsed and the topic found
- No topic will result in the topic
Topic and Queue Creation
By default, if a queue is not found for a given topic, a queue will automatically be generated with the topic name.
You can also export
SNS_TOPIC_MAP in the following format on the
docker run call:
Every time a topic is published to, it will route to one or more named queues. By defining the topic
map, the topic will no longer follow the default logic of publishing to a queue by the topic name.
Copyright 2016 Cimpress
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.