Skip to content

Instantly share code, notes, and snippets.

@JakubOboza
Last active July 6, 2016 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JakubOboza/1219d0fdc5ee0948e8a11731cc46dfec to your computer and use it in GitHub Desktop.
Save JakubOboza/1219d0fdc5ee0948e8a11731cc46dfec to your computer and use it in GitHub Desktop.
// Simple bulk only Gateway
// url is for DR (Delivery Reports)
case class Service(name: String, url: String)
// Params your API gets in
case class HttpMessage(service: String, originator: String, msisdn: String, body: String)
// Handles MT's and MO's (maybe should contain service name for sake of simplicity)
case class MQMessage(guid: String, msisdn: String, originator: String, body: String)
// Types of DR's you could send
case class OkDrMessage(guid: String, response: String)
case class ErrorDrMessage(guid: String, reason: String, error_code: String)
case class IntermediateDrMessage(guid: String, reason: String, code: String)
// Flow
// 1) Get request via HTTP api
// 2) Validate client and message. Instant response if errors
// 3) Generate guid and create a message
// 4) Put message into queue to Router
// 5) Router picks message and decides where it should and how be send
// 6) Put it on right node queue
// 7) Operator nodes, Dr nodes or any other nodes picks message and perform task putting result into the result Queue
// 7*) MO flow = message is being submit from operator to the gateway
// 7**) figure out service, generate guid, put it into MO queueu to Router
// HTTP API -> Q -> ROUTER -> Q -> OPERATION NODE -> Q -> DR DELIVERY NODE
// OPERATION NODE -> Q -> DR DELIVERY NODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment