Skip to content

discoverfinancial/spring-http-conn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Http Client Demo

This repo contains two projects:

  • test-api - simple Spring Boot servlet based app to act as a "Downstream API"
  • test-client - Spring Boot servlet based app with multiple Http Client configurations to consume 'test-api'

The below diagram depicts the setup (Running Prometheus is optional)

Demo

Setup

  1. Clone this repo
  2. Start test-api in one terminal window
    cd test api
    ./gradlew bootRun
    
  3. Start test-client in another terminal window
    cd test-client
    ./gradlew bootRun
    
  4. (Optional) Start Prometheus, see below for more info
  5. Run a test, samples below (the later 2 require autocannon)
    • Single Request: curl localhost:8081/rc/test/0
    • Parallel Requests: ./parallel.sh 2 - send two parallel requests
    • Load test: ./load-test.sh

Prometheus setup

  1. Download Prometheus for your OS.
  2. Update prometheus.yml - adding a snippet in the scrape_configs to scrape from the Prometheus Actuator in the config file:
    scrape_configs:
    - job_name: 'spring boot scrape'
        metrics_path: '/actuator/prometheus'
        scrape_interval: 5s
        static_configs:
        - targets: ['localhost:8081']
  3. Start prometheus
  4. Load Console: http://localhost:9090/targets - make sure you see 'spring boot scrape'
  5. Check out the Prometheus page for some queries

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published