Giter Club home page Giter Club logo

ttc-query-campaign's Introduction

BluePrint - Trending Topic Campaigns: Query/Read (Aggregate) Campaign Data

This project is a Domain Specific extension of the Activiti Cloud Query Service. This service provides easy and aggregated access across data generated by different Runtime Bundles (Campaigns).

This project provides a mapping between the data generated by the execution of Business Processes and your domain entities, in this case, the filtered set of Tweets that had matched this campaign.

In order to aggregate data from different Campaigns it uses Spring Cloud Streams (and it is configured to work with RabbitMQ) to listen to events generated by each campaign and store all the data into a selected storage. Depending the amount of data and the shape of the data, a SQL or NoSQL storage can be used.

This project implements the Read part of the CQRS pattern.

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

Processed Tweet Feed Format

{
     "_embedded": {
         "tweets": [
             {
                 "text": "Yeah we all shine on, like the moon, and the stars, and the sun.…Also Activiti Cloud is great!",
                 "author": "JohnLennon",
                 "lang": "en",
                 "attitude": "positive",
                 "timestamp": 1528270266321
             },
             {
                 "text": "I destroy my enemies when I make them my friends.… And how good is Activiti Cloud looking?",
                 "author": "AbrahamLincoln",
                 "lang": "en",
                 "attitude": "neutral",
                 "timestamp": 1528270267325
             }
         ]
     },
     "_links": {
         "self": {
             "href": "http://localhost:8090/processed/activiti?page=0&size=100"
         }
     },
     "page": {
         "size": 100,
         "totalElements": 6,
         "totalPages": 1,
         "number": 0
     }
 }

Configuration

This service by default is configured to store data into an in memory DB H2. This can be changed by:

  1. Uncommenting the PostgreSQL JDBC driver into the pom.xml file and setting H2 to scope test
  2. Uncommenting the lines inside the application.properties under the comment # PostgreSQL

ttc-query-campaign's People

Contributors

salaboy avatar flv22 avatar miguelruizdev avatar

Watchers

James Cloos avatar  avatar

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.