introduction to tubewarder | templated message gateway

Post on 13-Apr-2017

124 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

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!

Do your applications send mail to various channels?

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

Tubewarder cleans it up

Architecture

Core

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

Send API (SOAP/REST)

Web Interface (AngularJS)

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)

Getting it up and running

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

Accessing the web interface

Default login:admin/admin

Default port:8080

App Tokens

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

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

Channels

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

Templates

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/

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": "..." } ]}

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"}

Send API Tester

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

What happens when sending a message

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

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

Docker Container

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

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

More information:Heiner Peuser | heiner.peuser@weweave.netweweave.net/products/tubewarder/

top related