coffee and software
Youtube @coffeesoftware
Spring 6 & Spring Boot 3.X
Humor
Learn gradle, lose weight
morally superior in every way
be the change you wanna see in the world…
it’s better than Disneyland
more than two times as good as java 8
it’s oracle, sometimes it’s never simple…(robot tone)
Friends do not let friends write Dockerfile.
Make .jar
, not .war
!
for legitimately slacking off “MY CODE’S COMPILING”
Use Graphql, don’t use Swagger!
You get it photoshopped at the end of the day!
-
TestContainers - dependencies - (good for building database automatically)
-
@ServiceConnection
-
spring-boot-devtools
- Changing the scope of Gradle dependencies
-
Recompile - vs build
-
@ControllerAdvice
@ControllerAdvice class @ExceptionHandler ProblemDetail handle (ise, rq) { // sth }
-
Jakarta ee 9 === Jakarta ee8
-
spring-boot-starter-actuator
-
show details of the endpoint health
-
URL :
localhost:8080/actuator
-
URL :
localhost:8080/actuator/metrics
### old: book 2.x spring cloud sleuth (tracing) spring cloud spring boot spring framework micrometer.io (metrics: mean, median, average) // Micrometer.io : similar to log4j // @Timed -- track how long this method takes // ObservationRegistry
-
-
Terminal
./gradlew ./mvnw spring-boot:build-image
-
GraalVM
- Ahead-of-time compiler
- But configuration files needed (usually in json files)
Goldeneye 007
Elevator musicps -o rss <PID>
: retrieve the resident set size
-
@GetExchange
1 2
@GetExchange Flux<Customer> customers
-
var wc = builder.baseURL("xxx").build();
-
resources > graphql
- 3 operations:
- Query (
qwee-ree
) - Subscription
- Mutation (all changes inc. delete, update, etc)
- Query (
- 3 operations:
-
@SchemaMapping
@SchemaMapping(typeName="Query") //alias @QueryMapping Flux<Customer> customers() { return http... }
-
Pull the apis in a whole
-
自訂 typeName (e.g. Customer)
Customer setting at
schema.graphql
file@SchemaMapping(typeName = "Customer") Profile profiles (Customer cust) { // sth }
-
Reactive programming —
Mono<Profile>
-
@BatchMapping
-
@Argument
@QueryMapping Flux<Customer> customersByName(@Argument String name) { return this.http.customersByName(name); }
-
AbstractRoutingDatasource
—- To have a map for datasources
- Refer to Baeldung
https://tanzu.vmware.com/content/white-papers/spring-boot-3
https://www.youtube.com/watch?v=TOfYlLjXufw
https://techdozo.dev/spring-for-graphql-schemamapping-and-querymapping/