Skip to content

minixxie/java-springboot-svc

Repository files navigation

Java Springboot

This is to record what need to be done on top of a freshly generated Springboot project, in order to:

  1. Be able to use Makefile to make the commands easier
  2. Be able to use Containerfile to use docker build and run
  3. Be able to use yaml to deploy the application into k8s cluster (with kustomize)
  4. Have a simple RESTful endpoint to return a string as an example

For what can be done with this sample project, just check Makefile:

  1. build the application with docker, with JDK (you'll need to install JDK in advance with make tools):
make build
  1. run the application after building:
make up
  1. test by calling one endpoint:
make curl

Or the above can be done in docker and k8s:

  1. build the application with docker:
make docker-build
  1. deploy the application into k8s:
make k8s-up
  1. test by calling one endpoint:
make k8s-curl

Spring boot

References:

  1. 修改 SpringBoot 默认响应为 utf-8

SLF4J

References:

  1. 使用SLF4J和Logback
  2. Logging in Spring Boot
  3. Spring Boot Logging with application.yml
  4. JSON Logging Best Practices
  5. Disable Spring Boot Banner at Startup
  6. How can I change a key name in the JSON output using Logback?
  7. Logging to Graylog with Spring Boot
  8. Hibernate: Don’t use show_sql to log SQL queries

MyBatis

References:

  1. MyBatis with Spring
  2. 使用IDEA创建SpringBoot+MyBatis+MySql项目实现登录注册功能
  3. How to solve "Mapper method has an unsupported return type"

MyBatis Thymeleaf

References:

  1. MyBatis Thymeleaf User’s Guide
  2. Quick Start
  3. java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class when upgrade from java 11 to 17

Jaeger

References:

  1. opentracing-contrib/java-spring-jaeger

OpenTelemetry

References:

  1. OpenTelemetry Instrumentation for Java
  2. logback输出json格式日志(包括mdc)发送到kafka
  3. Using Micrometer to trace your Spring Boot app
  4. Spring Boot 3 Observability with Grafana
  5. Observability with Spring Boot 3
  6. Leveraging OpenTelemetry For Custom Context Propagation
  7. ADDING HEADERS TO EVERY SPRING BOOT RESPONSE
  8. Capture tracing header for incoming requests
  9. Using instrumentation annotations with a Java agent
  10. Jaeger vs. Helios: Which One Should You Choose?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published