Giter VIP home page Giter VIP logo

notifier's Introduction

Build Status Quality Gate Status Maven Central License: APACHE

Notifications Microservice

The notifications microservice is an independently deployable component intended for sending various types of notifications. It provides a common abstraction layer on top of the various notification types and actual sending, tracking routines.

Supported notification types

Notifier supports the most common notification types and platforms. The project aims to enable the user to only rely on notifier for client messaging/communication. Below are the supported notification types and implementations.

Email Notifications

The microservice supports sending regular emails. The supported transports are:

SMS Notifications

The microservice supports sending SMS notifications. The supported transports are:

Push Notifications

Push notifications to mobile devices are supported. As of now, only one provider is available:

Integration

You can call the notifier's REST API directly or use the provided Java client library. To use the client library add the following maven dependency:

<dependency>
    <groupId>com.sflpro.notifier</groupId>
    <artifactId>api-client-library</artifactId>
    <version>1.7.0</version>
</dependency>

The API is documented using OpenAPI Specification(Swagger) and the documentation JSON is available under /swagger.json once the notifier microservice has been started.

Deployment

Notifier is dockerized and is easy to deploy as a docker container. For more details, see the images on docker hub:
https://hub.docker.com/r/sflpro/notifier-api & https://hub.docker.com/r/sflpro/notifier-worker

Running the application locally

1. Configure POSTGRES datasource

The postgres has official images in docker hub.

docker run --name notifier-postgres -e POSTGRES_PASSWORD=notifier -e POSTGRES_USER=notifier -e POSTGRES_DB=notifier -p 5432:5432 -d postgres:11

2. Configure RabbitMQ queue engine

RabbitMQ has official images in docker hub. Running RabbitMQ with management plugin enabled

docker run -d --hostname notifier-rabbit --name some-rabbit -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq:3-management

3. Prepare properties file for notifier images

# Postgres
spring.datasource.url=jdbc:postgresql://{HOST_IP}:5432/POSTGRES_DB
spring.datasource.username=POSTGRES_USER
spring.datasource.password=POSTGRES_PASSWORD

# Notifier queue engine
notifier.queue.engine=rabbit

# RabbitMQ
spring.rabbitmq.host={HOST_IP}
spring.rabbitmq.username=guest

# Container port
server.port=8080

4. Run notifier-api

Running Notifier-API docker images.

docker run -p 8080:8080 -v {NOTIFIER_-_PROPERTIES_PATH}:/etc/notifier/notifier.properties sflpro/notifier-api:1.7.0 --spring.config.additional-location=etc/notifier/notifier.properties

Running Notifier-Worker docker images

docker run -p 8081:8080 -v {NOTIFIER_-_PROPERTIES_PATH}:/etc/notifier/notifier.properties sflpro/notifier-worker:1.7.0 --spring.config.additional-location=etc/notifier/notifier.properties

5. Testing setup

curl -X POST "localhost:8080/notification/email/create"  -H "accept: application/json" -H "Content-Type: application/json" -d "{\"recipientEmail\":\"[email protected]\",\"senderEmail\":\"[email protected]\",\"subject\":\"testing-subject\",\"templateName\":\"Email template name\"}"

Additional configurations

To externalized application properties add the following command as a program argument

--spring.config.additional-location=/your/location/properties-file.properties

Configure kafka to use SASL_SSL security protocol

kafka.ssl.endpoint.identification.algorithm=https
kafka.sasl.mechanism=PLAIN
kafka.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="<API_KEY>" password="<API_SECRET>";
kafka.security.protocol=SASL_SSL

notifier's People

Contributors

aaramg avatar biacode avatar danielyan11vazgen avatar dependabot[bot] avatar dilanyanruben avatar dnavre avatar hrant2001 avatar louisdega avatar mikron avatar mkrtchyanh avatar nazaretyan avatar progbox888 avatar rubvardanyan avatar syuziko avatar thetealover avatar

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.