Git Product home page Git Product logo

event-tracker's Introduction

event-tracker

Java Spring Boot application implementing JMS and ActiveMq to track and persist application events in the database.

Multi-Module project

a) Microservice1 . event-tracker: Spring Boot application/microservice consisting of a REST API endpoint to send event messages to a queue.(Test-1)

b)event-processor: Spring Boot application/microservice which is consuming messages from the queue and persisting events int the database.(Test-2)

Queue implemented using ActiveMQ.

**Setup(macOS)

  1. clone the project.

  2. Install postgres: brew install postgres.

  3. Start postgres server pg_ctl -D /usr/local/var/postgres start

  4. psql postgres and CREATE ROLE username WITH LOGIN PASSWORD 'quoted password';.

  5. ALTER ROLE username CREATEDB;.

  6. createdb event;

  7. Install activemq brew install activemq. It will run on the default port 61616. Go to http://localhost:8161/admin/ to view the web console.

  8. go to the project directory in a new terminal. cd event-tracker.

  9. Run mvn clean install to check whether it compiles correctly. Then run mvn clean spring-boot run . This will start the event tracker application/microservice which pushes event to the queue.

  10. Go to http://localhost:8090/swagger-ui.html to view the UI of the REST API. (Post endpoint)

  11. Populate the request parameters and execute the request.

  12. Check queue status EventTrackingQueue in the web console http://localhost:8161/admin/. You will the see the pending message which is not consumed yet in the Queues section.

  13. Now in the project structure change directory to event-processor module. This microservice consumes the pending message in the queue and persists it in the event table of postgres db setup earlier.

  14. mvn clean install and mvn clean spring-boot run Look at the event message in the console logs.

  15. Check ActiveMq web cosole the pending message should be consumed.

  16. Check event table ----> the message will be peristed.

Message redelivery option configured in parent project event-tracker > application.properties (maximumRedeliveries=1).

event-tracker's People

Contributors

harshtrivedi134 avatar dependabot[bot] 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.