Git Product home page Git Product logo

sms-sender's Introduction

Simple Java EE SMS sender with automatic failover

This demonstration uses CDI to discover @SmsProviders on the application classpath and then randomly fails over between them.

This is a very simple implementation that doesn't use any sophisticated statistical analysis for failover.

If for any reason any reason an attempt to send SMS via a provider fails (e.g HTTP error), a failover is triggered. For example, if you run out of units on a provider, a failover happens.

Every 5 minutes, the system also tries to check if text messages actually got delivered to the phone they are destined for. This is done by sampling 5 sent messages (evenly picked); if at least 3 of them didn't get delivered to their destination phone (e.g due to DND restriction on the route), a failover is also triggered.

This isn't a sophisticated strategy. For example, it could have been that those phones were actually switched off or that specific providers are not able to deliver to specific telcos; but it works for simple scenarios.


Sample usage:

Kotlin

@Inject 
private lateinit var handler: SmsHandler

// Don't care about which provider is actually used
handler.sendSms(phone, title, message)

Java

@Inject
private SmsHandler handler;

handler.sendSms(phone, title, message);

sms-sender's People

Contributors

oluwasayo avatar

Stargazers

Emmanuel O. Adegbite avatar

Watchers

James Cloos 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.