Wiremock standalone HTTP server Docker image
By default, Wiremock is not configured to handle an heavy load. Here is what is changed in the configuration :
--no-request-journal --> By default, Wiremock keep all requests logs in the Java heap, so a memory exhaust happen, fast. We disabled it--async-response-enabled=true --> By default, request responses are synchronous, here asyncdocker pull rbillon59/wiremock-loadtest
docker run --rm -p 8080:8080 -v "${PWD}/samples/stubs":/home/wiremock rbillon59/wiremock-loadtest
docker-compose up --scale wiremock=5 -d
Doing this you will spawn 5 instances of the mock behind a nginx reverse proxy which will load balance across the instances. It's useful to quickly launch multiple instance across a single host.
Update the Kubernetes configmap to add your stubs then :
kubectl apply -f kubernetes.yaml
The kubernetes.yaml file contains a definition of the wiremock deployment and a load balancer service to expose wiremock (no need for a specifif nginx). You can deploy this inside your kubernetes cluster to mock direcly beside your application.
The horizontal auto scaler will scale up the replicas if the CPU threshold is reached
Two examples mappings are available in the samples/stubs/mappings folder. /static is a pre-defined json body while /dynamic take the path to create the json response.
Access http://localhost:8080/static to show static json message
Access http://localhost:8080/dynamic/whatever to show dynamic json message
Content type
Image
Digest
sha256:9f9b99d4b…
Size
130.8 MB
Last updated
almost 2 years ago
docker pull rbillon59/wiremock-loadtest