Code Monkey home page Code Monkey logo

mage's Introduction

RapidPro Message Mage

High performance Dropwizard based webserver for receiving incoming messages on behalf of RapidPro.

Building

Without tests:

mvn clean package -DskipTests=true

Building with tests requires that Postgresql and Redis servers are running, then:

testdb/init.sh temba  # setup the test database based on schema from given database
mvn clean package     # run the build with tests against the test database

Running

The Mage configuration file contains several references to environment variables which must be defined on your system. This can be done easily in a wrapper shell script which sets the variables, e.g.

#!/bin/bash
export PRODUCTION=0
export DATABASE_URL=...
export REDIS_HOST=localhost
export REDIS_DATABASE=8
export TEMBA_HOST=localhost:8000
export TEMBA_AUTH_TOKEN=...
export TWITTER_API_KEY=...
export TWITTER_API_SECRET=...
export SEGMENTIO_WRITE_KEY=
export SENTRY_DSN=
export LIBRATO_EMAIL=
export LIBRATO_API_TOKEN=
exec "$@"

And then is invoked like:

./env.sh java -jar `ls target/mage-*.jar` server config.yml

Logging

To enable logging of Twitter stream messages, update the logging section of config.yml

logging:
    appenders:
      - type: console
        threshold: DEBUG
        target: stdout
    loggers:
        "com.sun.jersey.api.container.filter.LoggingFilter": DEBUG
        "io.rapidpro.mage.twitter.TwitterClients": DEBUG

Debugging

In IntelliJ:

  1. Add new run configuration of type Application
  2. Set main class to io.rapidpro.mage.MageApplication
  3. Set program arguments to server config.yml

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.