Skip to content
Jacek Spólnik edited this page Mar 13, 2016 · 17 revisions

Running Trading Office on your machine

Before starting

  • Install JDK8
  • Install git
  • Install RabbitMQ
  • Install Mongodb
  • Prepare directory where you will clone all repositories, and run below from it. We will refer to it as TRADING_OFFICE_DIRECTORY
  • Clone repositories (you can paste it to terminal, it will clone all repo to your current dir):
git clone https://github.com/spolnik/trading-office-allocation-message-receiver.git 
git clone https://github.com/spolnik/trading-office-allocation-enricher.git 
git clone https://github.com/spolnik/trading-office-confirmation-sender.git 
git clone https://github.com/spolnik/trading-office-market-data-service.git 
git clone https://github.com/spolnik/trading-office-confirmation-service.git 
git clone https://github.com/spolnik/trading-office-counterparty-service.git 
git clone https://github.com/spolnik/trading-office-eureka-server.git 
git clone https://github.com/spolnik/trading-office-api-gateway.git
git clone https://github.com/spolnik/trading-office.git

Run RabbitMQ

  • open new terminal
  • run RabbitMQ on your machine (default settings)
  • Mac OS X: /usr/local/sbin/rabbitmq-server
  • you can verify web console on http://localhost:15672

Run MongoDB

  • open new terminal
  • create custom data dir (to avoid usage of sudo and permissions): mkdir -p ~/data/db
  • run MongoDB on your machine (default settings)
  • Mac OS X: mongod --dbpath ~/data/db

Run Eureka Server

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office-eureka-server
  • ./gradlew bootRun
  • you can verify if service works correctly by going to http://localhost:5000

Run Market Data Service

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office-market-data-service
  • ./gradlew bootRun
  • you can verify if service works correctly by going to http://localhost:9004/health
  • you should be able to find MARKET-DATA-SERVICE on eureka server http://localhost:5000

Run Counterparty Service

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office-coutnerparty-service
  • ./gradlew bootRun
  • you can verify if service works correctly by going to http://localhost:9008/health
  • you should be able to find COUNTERPARTY-SERVICE on eureka server http://localhost:5000

Run Allocation Message Receiver

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office-allocation-message-receiver
  • ./gradlew bootRun
  • you can verify if service works correctly by going to http://localhost:9001/health
  • you should be able to find ALLOCATION-MESSAGE-RECEIVER on eureka server http://localhost:5000

Run Allocation Enricher

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office-allocation-enricher
  • ./gradlew bootRun
  • you can verify if service works correctly by going to http://localhost:9000/health

Run Confirmation Sender

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office-confirmation-sender
  • ./gradlew bootRun
  • you can verify if service works correctly by going to http://localhost:9002/health
  • you can now verify rabbitmq connections (should be 3) on web console http://localhost:15672

Run Confirmation Service

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office-confirmation-service
  • ./gradlew bootRun
  • you can verify if service works correctly by going to http://localhost:9003/health
  • you should be able to find CONFIRMATION-SERVICE on eureka server http://localhost:5000

Run API Gateway

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office-api-gateway
  • ./gradlew bootRun
  • you can verify if service works correctly by going to http://localhost:5001/health
  • you should be able to find API-GATEWAY on eureka server http://localhost:5000

Run End To End Tests

  • open new terminal, go to TRADING_OFFICE_DIRECTORY
  • cd trading-office
  • remove @Ignore from src/test/groovy/com/trading/LocalTradingOfficeSpecification.groovy
  • add @Ignore to src/test/groovy/com/trading/TradingOfficeSpecification.groovy (remember about import import spock.lang.Ignore)
  • ./gradlew clean check
  • if everything passed - you successfully run Trading Office on your machine
  • run mongodb client (mongo) - if you can find inserted confirmations (should be two) - db.confirmation.find()