Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mfvanek/spring5-mvc-with-embedded-tomcat
Spring 5 MVC demo app with embedded Tomcat and Jaeger Tracing (without Spring Boot)
https://github.com/mfvanek/spring5-mvc-with-embedded-tomcat
embedded-tomcat-server gradle gradle-8 jaeger java java-17 kotlin-dsl opentracing spring spring-mvc tomcat tomcat9 tracing
Last synced: about 1 month ago
JSON representation
Spring 5 MVC demo app with embedded Tomcat and Jaeger Tracing (without Spring Boot)
- Host: GitHub
- URL: https://github.com/mfvanek/spring5-mvc-with-embedded-tomcat
- Owner: mfvanek
- License: apache-2.0
- Created: 2020-07-29T15:07:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-02T06:05:47.000Z (7 months ago)
- Last Synced: 2024-05-02T18:51:49.471Z (7 months ago)
- Topics: embedded-tomcat-server, gradle, gradle-8, jaeger, java, java-17, kotlin-dsl, opentracing, spring, spring-mvc, tomcat, tomcat9, tracing
- Language: Java
- Homepage:
- Size: 274 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spring5-mvc-with-embedded-tomcat
Spring 5 MVC demo app with embedded Tomcat (without Spring Boot!) and OpenTracing## Open in Browser
* http://localhost:8080/api/v1/demo
* http://localhost:8080/api/v1/demoException
* http://localhost:8080/api/v1/welcome## Swagger
* http://localhost:8080/v2/api-docs
* http://localhost:8080/swagger-ui/
* http://localhost:8080/swagger-ui/index.html## Build Docker image
```shell
./gradlew dockerBuildImage
```## Run in Docker
```shell
docker run --name spring5-mvc-with-embedded-tomcat -d -p 8080:8080 spring5-mvc-with-embedded-tomcat:latest
```## Run Jaeger in Docker
```shell
docker run -d --name jaeger \
-e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
-e COLLECTOR_OTLP_ENABLED=true \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 4317:4317 \
-p 4318:4318 \
-p 14250:14250 \
-p 14268:14268 \
-p 14269:14269 \
-p 9411:9411 \
jaegertracing/all-in-one:1.36
```Jaeger UI will start at [http://localhost:16686](http://localhost:16686)
## Useful Commands
### Create uber jar
```shell
./gradlew shadowJar
```### Run uber jar
```shell
# export JAEGER_AGENT_HOST=localhost
# export JAEGER_AGENT_PORT=6831
export JAEGER_ENDPOINT=http://localhost:14268/api/traces
java -jar build/libs/spring5-mvc-with-embedded-tomcat-2.0.0.jar
```