Skip to content

natanaelmartinezassis/sns-producer

Repository files navigation

SNS Producer image image image

Project for sending notifications to a topic SNS using SpringBoot.

This project makes use of the custom-logging-starter library developed for sending logs to Logstash and/or AWS Kinesis.

Messages sent to the SNS are encapsulated with the automatically generated traceId and spandId and can be injected into the MDC of the application that consumes the message. [See: SQS Consumer]


How To

First Step: build

Build the application to generate the *.jar artifact.

$ ./mvnw clean package

Second Step: docker image

Generate the application docker image.

$ cd docker-compose/
$ docker-compose build sns-producer

Third Step: localstack and application containers

Run localstack and application containers using docker-compose.

$ docker-compose up -d

Fourth Step: create SNS topic

Create the SNS topic for sending notifications.

$ aws --endpoint-url=http://localhost:4566 sns create-topic --name add-foobar-topic

Fifth Step: test

Send a request.

$  curl -X POST \
    --header 'content-type: application/json' \
    --url http://localhost:8080/v1/foobar/add \
    --data '{"foo": "1234567890","bar": "12345678000190","value": 123.45}' \
    -w "%{http_code}\n"

About

Project for sending notifications to a topic SNS using SpringBoot.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published