Skip to content

Commit b6dccb5

Browse files
Add instructions for manually generating and testing the spring compatibility project (#33)
1 parent 4a1a3e2 commit b6dccb5

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This project contains the following modules:
77
- [quarkus3](quarkus3)
88
- A Quarkus 3.x version of the application
99
- [quarkus3-spring-compatibility](quarkus3-spring-compatibility)
10-
- A Quarkus 3.x version of the application using the Spring compatibility layer
10+
- A Quarkus 3.x version of the application using the Spring compatibility layer. You can also recreate this application from the spring application using [a few manual steps](spring-conversion.md).
1111

1212
## Building
1313

spring-conversion.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Converting the Spring application to a Quarkus one with compatibility libraries
2+
3+
It is possible to recreate the application parts of the `quarkus3-spring-compatibility` project with a few steps.
4+
This is a great way of seeing that the Quarkus performance gains are because of the runtime, not the programming model or code of the application.
5+
6+
## Doing the conversion for dev mode
7+
8+
1. Save the `pom.xml`, which we don't want to write by hand: `cp quarkus3-spring-compatibility/pom.xml spring-pom.xml`
9+
2. Delete the compatibility project (we're about to recreate it from scratch!): `rm -rf quarkus3-spring-compatibility`
10+
3. Replace the spring pom: `mv spring-pom.xml springboot3/pom.xml`
11+
4. Delete the tests, which are hard to convert ([for now](https://github.com/orgs/quarkusio/projects/60)): `rm -rf springboot3/src/test`
12+
5. Start the app, with `(cd springboot3; quarkus dev)`. You'll see a failure and a crash.
13+
6. What's the problem? The `SpringBootApplication` class doesn't compile. The good news is it's not even needed with Quarkus. Delete it.
14+
7. Try `quarkus dev` again, and everything should work. Visiting the endpoint in a browser should work.
15+
16+
## Prod mode and stress testing
17+
18+
Although everything is working in dev mode, if you look at the `application.yml`, you can see it's filled with spring config.
19+
There's no Quarkus database configured. In dev mode, that's fine, because Quarkus auto-starts one as a dev service, but that won't work in prod mode.
20+
So we need to fill in config.
21+
22+
1. Copy the Quarkus config over to the Spring app: `cp ./quarkus3/src/main/resources/application.yml ./springboot3/src/main/resources/application.yml`
23+
2. Build the app `(cd springboot3; ./mvnw clean package)` (don't forget the clean)
24+
3. Run the stress tests: `./scripts/stress.sh springboot3/target/quarkus-app/quarkus-run.jar`
25+
26+
You should see that the throughput almost identical to the throughput of the 'normal' Quarkus app, and more than double that of the Quarkus-free Spring app.

0 commit comments

Comments
 (0)