Public Repository

Last pushed: a year ago
Short Description
Mocks AWS SNS+SQS publishing/queueing system.
Full Description

SNS-SQS Mock

This small application uses ElasticMQ + An express script to simulate the SNS-SQS interaction we see in a production or deployed environment.

Using

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 http://localhost:9325/mytopic
  • 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 undefined

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:

-e SNS_TOPIC_MAP=topic1:queue1,topic1:queue2,topic2:queue3

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.

License

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

http://www.apache.org/licenses/LICENSE-2.0

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.

Docker Pull Command
Owner
zix99

Comments (0)