Java Springboot service to resend request to another service for testing and presentation purposes.
317
This simplistic service helps to exemplify how istio service mesh works.
This service as one endpoint (/hello), this endpoint does a request to a url provided
via the environment variable upstreamUrl (http://time.jsontest.com by default) and
the response is a text/plain which contains
the serviceName environment value the request destination and the response.
backend -> http://time.jsontest.com/
{
"date": "10-15-2019",
"milliseconds_since_epoch": 1571148446016,
"time": "02:07:26 PM"
}
This service comes with an option to response with a an http status 500.
This is possible with the header fail and a number less than 100 which indicates
the percentage of probability to get the error status, below example shows a query
with a probability of 40% to obtain a 500 status response.
curl -H'fail:40' http://localhost:8080/hello
This service will call an specified URL, if there is not a specified URL the query will go
to http://time.jsontest.com.
To specify a URL use the environment variable upstreamUrl.
By default the service name is test-svc and this will part of the response.
This name can be changed via the environment variable serviceName.
For test proposes, a header can be resend from the request to the "downstream" service,
by default the header bypassed are fail and version.
This header can be customized via the environment variable passthroughsHeaders, this
value is a list of header separated by comma.
Content type
Image
Digest
Size
119.6 MB
Last updated
almost 7 years ago
docker pull pablobastidasv/transmitter