Skip to content

wlanboy/JavaHttpClient

Repository files navigation

JavaHttpClient

Spring based rest service to test http routes in kubernetes. Showing http status, response, timing and istio envy settings.

Web ui

web ui

Istio tab

istio tab

Swagger

istio tab

build

  • mvn package

docker build

  • docker build -t wlanboy/javahttpclient:latest . --build-arg JAR_FILE=./target/javahttpclient-0.0.1-SNAPSHOT.jar

run container

  • docker run -d --name httpclient --publish 8080:8080 --restart unless-stopped wlanboy/javahttpclient:latest

docker hub

test java http client

curl -L -X POST 'http://127.0.0.1:8080/client' -H 'Content-Type: application/json' \
-d '{"url" : "https://github.com", "copyHeaders": "false"}'

local dev

curl -fsSL https://raw.githubusercontent.com/metalbear-co/mirrord/main/scripts/install.sh | bash

mirrord exec -n javahttpclient --target deployment/javahttpclient -- ./mvnw spring-boot:run

swagger uri

curl calls for mirrorservice

curl -X 'POST' \
  'http://localhost:8080/client' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "http://gmk:8003/resolve/google.com",
  "method": "GET",
  "body": "",
  "copyHeaders": false
}'

curl -X 'POST' \
  'http://localhost:8080/client' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "http://gmk:8003/mirror?request=HalloWelt&statuscode=200&wait=4",
  "method": "GET",
  "body": "",
  "copyHeaders": true
}'

About

Spring based rest service to test http call within k8s and istio

Resources

License

Stars

Watchers

Forks