Giter Club home page Giter Club logo

codechallenge's Introduction

CodeChallenge

Overview:

Assumption: The Producer and Consumer will be deployed in a Linux box.

  • Producer: Simulates raw data provided from an eye tracker, and sends messages to the consumer (at 60 to ~1000 messages per second, configurable value), through the TransportManager

  • TransportManager: This is an API that wraps the transport configuration, and the RabbitMQ logic to send and receive messages. TransportManager exposes methods to send messages, to initialize configurations, and allows the implementation of the logic to process the messages after they are dequeued. If a different messaging broker/library such as Kafka or any other needs to be implemented, the Producer and the Consumer will not be required any code changes, only configuration changes will be needed.

  • Consumer: Receives and process messages by writing them to a text file (eyeTrackerData.txt)

  • ValueObjects: Contains the Message object

  • The transport broker used in the project is RabbitMQ

General instructions:

  1. Install RabbitMQ
  2. Start the RabbitMQ server
  3. Deploy the Producer and Consumer in a Linux box
  4. Run the Producer
  5. Run the Consumer

How to install RabbitMQ in a Linux box:

Linux Steps:

  1. install homebrew. If it is already installed, run: brew update if not run: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  2. Once homebrew is installed, install rabbitMQ. Run: brew install rabbitmq

  3. To start rabbitmq run: brew services start rabbitmq

  4. in the browser go to: http://localhost:15672/ RabbitMQ server should be running

  5. User: guest, Password: guest

How to run the Producer and Consumer:

After deploying Producer and Consumer in the Linux box:

To start the Producer go to /Producer/bin and run ./Producer.sh start To stop the Producer go to /Producer/bin and run ./Producer.sh stop The log file will be generated under /Producer/logs/producer.log Property files will be under /Producer/etc

To start the Consumer go to /Consumer/bin and run ./Consumer.sh start To stop the Consumer go to /Consumer/bin and run ./Consumer.sh stop The log file will be generated under /Consumer/logs/consumer.log The output file will be generated under /Consumer/eyeTrackerData.txt Property files will be under /Consumer/etc

After starting the Producer, it will be generating ~1000 per second. The number of messages per second can be modified in the /Producer/etc/Producer.properties when changing the value of the property period=1, after changing that value, bounce the application.

After starting the Consumer, it will be writing the messages dequeued into the /Consumer/eyeTrackerData.txt

The queue information such as depth and queue performance can be monitored in the RabbitMQ console http://localhost:15672/ the queue name is EYETRACKER.MESSAGES

References:

To install homebrew: https://github.com/homebrew/install

Rabbitmq install https://www.rabbitmq.com/install-homebrew.html

codechallenge's People

Contributors

jimluis avatar

Watchers

 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.