/ttc-connectors-ranking

Activiti Cloud BluePrint: Trending Topic Campaigns Connectors Ranking

Primary LanguageJavaApache License 2.0Apache-2.0

BluePrint - Trending Topic Campaigns: Ranking Service Connector

This project is an implementation of an Activiti Cloud Connector, which is a simple bi-directional 3rd party system-to-system integration using Spring Cloud Streams.

This project provides the integration mechanisms against a Mock Ranking Service. This Activiti Cloud Connector listen to events generated by Runtime Bundles (Campaigns for this example) and interacts with the Ranking Service to serve multiple Marketing campaigns.

Run

In order to run this project locally, you need to clone the source code and then run inside the root directory

mvn -Dserver.port=808x spring-boot:run

Note: replace "x" for your desired port number

You can use the following docker-compose file in order to start Rabbit MQ so the service can connect and send messages.

Endpoints

Campaign Rankings Format

Ranked Topics -> GET /rank/

[
    "activiti-positive",
    "activiti-negative",
    "activiti-neutral"
]

Example Ranked Activiti topic / positive attitude

[
    {
        "nroOfTweets": 52,
        "userName": "NapoleonHill"
    },
    {
        "nroOfTweets": 34,
        "userName": "RichardBach"
    },
    {
        "nroOfTweets": 20,
        "userName": "BenjaminFranklin"
    },
    {
        "nroOfTweets": 19,
        "userName": "LeonardodaVinci"
    }
]