introduction to tubewarder | templated message gateway

24
Tubewarder INTRODUCTION | EN | 2016-04-30 WEWEAVE.NET

Upload: weweave-gbr

Post on 13-Apr-2017

124 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Introduction to Tubewarder | Templated Message Gateway

TubewarderINTRODUCTION | EN | 2016-04-30WEWEAVE.NET

Page 2: Introduction to Tubewarder | Templated Message Gateway

At a glance

A central outbound message hub Suited for applications sending messages automatically Abstracts from concrete channels (email, sms, etc.) Includes powerful template engine (Apache FreeMarker) Cares for archiving, retrying, access mgmt. and error handling Extensible via easy-to-use Java API Declutters your applications!

Page 3: Introduction to Tubewarder | Templated Message Gateway

Do your applications send mail to various channels?

Page 4: Introduction to Tubewarder | Templated Message Gateway

Symptoms?

Channel-specifics implemented in the applications Any-to-any connections (sending applications to channels) Therefore: Duplicate code Higher complexity Maintenance gets more expensive Applications dealing with stuff not being their main business

Page 5: Introduction to Tubewarder | Templated Message Gateway

Tubewarder cleans it up

Page 6: Introduction to Tubewarder | Templated Message Gateway

Architecture

Core

Output Handlers (API for extensibility)Scheduler (queue polling, retrying, etc.)

Send API (SOAP/REST)

Web Interface (AngularJS)

Page 7: Introduction to Tubewarder | Templated Message Gateway

System requirements

Java 1.8 or later Recommended: Static IP address Optional: MySQL Database Optional: PostgreSQL Database Optional: Maven 3 (if you want to build from source) Optional: Git (if you want to build from source)

Page 8: Introduction to Tubewarder | Templated Message Gateway

Getting it up and running

Java 8 required. Launch with:java -jar tubewarder-swarm.jar

Page 9: Introduction to Tubewarder | Templated Message Gateway

Accessing the web interface

Default login:admin/admin

Default port:8080

Page 10: Introduction to Tubewarder | Templated Message Gateway

App Tokens

Mandatory for every application accessing the Send API Used for unique identification & access management

Page 11: Introduction to Tubewarder | Templated Message Gateway

Channels

Channels are routes to send an outbound message by using a specific configuration of an Output Handler.

Examples: HTML emails via corporate’s SMTP server Text messages via external web service

Based on Output Handlers, which do the actual work (e.g. Email, Web Service, Console Output) Extensible via Java API

Page 12: Introduction to Tubewarder | Templated Message Gateway

Channels

Page 13: Introduction to Tubewarder | Templated Message Gateway

Templates

Templates are concrete messages you want to send Can contain variables (placeholders) and control structures Can be bound to one or more channels Example:

New User Welcome Message via HTML-Email New User Welcome Message via Text Message (SMS)

Template Engine: Apache FreeMarker

Page 14: Introduction to Tubewarder | Templated Message Gateway

Templates

Page 15: Introduction to Tubewarder | Templated Message Gateway

Send API

The heart of Tubewarder: Send messages from applications via a generic API to Tubewarder – don’t care about channel specifics!

Endpoints: SOAP: /ws/send (WSDL available at /ws/send?wsdl) REST: /rs/send

Detailed information:http://tubewarder.readthedocs.io/en/latest/Send-API/

Page 16: Introduction to Tubewarder | Templated Message Gateway

Example Request (REST API){ "token": "00000000-0000-0000-0000-000000000000", "keyword": "DOI", "details": "", "echo": true, "template": "DOI", "channel": "sms", "recipient": { "name": "Unknown", "address": "+49000000000000" }, "model": [ {"key": "firstname", "value": "John"}, {"key": "lastname", "value": "Doe"}, {"key": "code", "value": "1234567890"}, {"key": "includeDisclaimer", "value": false} ], "attachments": [ { "filename": "Terms.pdf", "contentType": "application/pdf", "payload": "..." } ]}

Page 17: Introduction to Tubewarder | Templated Message Gateway

Example Response(REST API){ "error": 0, "subject": "Hi John, thanks for signing up!", "content": "Dear John Doe, here's your activation code: 1234567890", "queueId": "00000000-0000-0000-0000-000000000000"}

Page 18: Introduction to Tubewarder | Templated Message Gateway

Send API Tester

Web Interface features Send API Tester for building and testing API calls click-by-click (REST API)

Page 19: Introduction to Tubewarder | Templated Message Gateway

What happens when sending a message

Page 20: Introduction to Tubewarder | Templated Message Gateway

Logs

Every message sent via the Send API gets logged Important details: Timestamp, subject and content, sending

application, recipient, statistical information (freely definable keyword and details), and more

Complies with legal regulations You can browse through the logs using the Web Interface

Page 21: Introduction to Tubewarder | Templated Message Gateway

High availability

Run multiple instances of Tubewarder behind an HTTP load balancer to establish high availability

Use the same database in all of your instances Instances will find each other automatically If one instance fails, the others will automatically process

dangling send queue items

Page 22: Introduction to Tubewarder | Templated Message Gateway

Docker Container

Docker container is available at weweave/tubewarder MySQL database pre-installed HTTP interface exposed at port 8080

Page 23: Introduction to Tubewarder | Templated Message Gateway

Output Handlers

API available for developing custom output handlers Output Handlers are developed in Java as POJOs Maven dependency:

<dependency> <groupId>net.weweave.tubewarder</groupId> <artifactId>outputhandler-api</artifactId> <version>1.0-Beta1</version></dependency>

See maven repository for latest version Deployment: Place compiled JAR in libs/ folder – will be found and

loaded automatically