Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frameworks/Java/solon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ This is the solon portion of a [benchmarking test suite](../) comparing a variet

## Versions

* [Java OpenJDK 21](http://openjdk.java.net/)
* [solon 3.0.2](https://github.com/noear/solon)
* [Java OpenJDK 25](http://openjdk.java.net/)
* [solon 3.9.1](https://github.com/opensolon/solon)

## Test URLs

Expand Down
15 changes: 7 additions & 8 deletions frameworks/Java/solon/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@
"json_url": "/json",
"port": 8080,
"approach": "Realistic",
"classification": "Fullstack",
"database": "Postgres",
"classification": "Micro",
"database": "None",
"framework": "solon",
"language": "Java",
"flavor": "None",
"orm": "Micro",
"platform": "solon",
"orm": "None",
"platform": "JVM",
"webserver": "smarthttp",
"os": "Linux",
"database_os": "Linux",
"database_os": "None",
"display_name": "solon",
"notes": "",
"versus": "None",
"tags": ["broken"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please maintain the tags field.

"versus": "None",
"tags": []

"versus": ""
}
}
]
}
}
13 changes: 7 additions & 6 deletions frameworks/Java/solon/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ name = "solon"
urls.plaintext = "/plaintext"
urls.json = "/json"
approach = "Realistic"
classification = "Platform"
database = "Postgres"
database_os = "Linux"
classification = "Micro"
database = "None"
database_os = "None"
os = "Linux"
orm = "Micro"
platform = "solon"
orm = "None"
platform = "JVM"
webserver = "smarthttp"
versus = "None"
notes = ""
versus = ""
16 changes: 13 additions & 3 deletions frameworks/Java/solon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.noear</groupId>
<artifactId>solon-parent</artifactId>
<version>3.0.5</version>
<version>3.9.1</version>
</parent>

<groupId>hello</groupId>
Expand All @@ -14,19 +14,24 @@
<packaging>jar</packaging>

<properties>
<java.version>21</java.version>
<java.version>25</java.version>
<jstachio.version>1.3.6</jstachio.version>
</properties>

<dependencies>
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-java25</artifactId>
</dependency>

<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-lib</artifactId>
</dependency>

<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-boot-smarthttp</artifactId>
<artifactId>solon-server-smarthttp</artifactId>
</dependency>

<dependency>
Expand All @@ -39,6 +44,11 @@
<artifactId>solon-data-sqlutils</artifactId>
</dependency>

<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-logging-simple</artifactId>
</dependency>

<dependency>
<groupId>io.jstach</groupId>
<artifactId>jstachio</artifactId>
Expand Down
14 changes: 10 additions & 4 deletions frameworks/Java/solon/solon.dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
FROM maven:3.9.7-amazoncorretto-21 as maven
FROM maven:3.9.9-eclipse-temurin-25-noble as maven
WORKDIR /solon
COPY pom.xml pom.xml
COPY src src
RUN mvn compile assembly:single -q
RUN mvn compile assembly:single -q -DskipTests

FROM openjdk:21-jdk-slim
FROM eclipse-temurin:25-jdk-noble
WORKDIR /solon
COPY --from=maven /solon/target/hello-solon.jar app.jar

EXPOSE 8080

CMD ["java", "-server", "-cp", "app.jar", "hello.Main"]
CMD ["java", \
"-server", \
"-XX:+UseZGC", \
"-XX:+ZGenerational", \
"-Dlogging.level.root=OFF", \
"-Dsolon.logging.appender.console.enable=false", \
"-cp", "app.jar", "hello.Main"]
5 changes: 4 additions & 1 deletion frameworks/Java/solon/src/main/java/hello/Main.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package hello;

import org.noear.solon.Solon;
import org.noear.solon.util.ScopeLocalJdk25;

public class Main {
public static void main(String[] args) {
Solon.start(Main.class, args);
Solon.start(Main.class, args, app->{
app.factories().scopeLocalFactory(ScopeLocalJdk25::new);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ public World getWorld(int id) {
@Override
public void updateWorlds(List<World> worlds) throws SQLException {
sqlUtils.sql("UPDATE world SET randomnumber = ? WHERE id = ?")
.updateBatch(worlds, (ps, w) -> {
ps.setInt(1, w.randomNumber);
ps.setInt(2, w.id);
});
.params(worlds, (ps, wl) -> {
for (World w : wl) {
ps.setInt(1, w.randomNumber);
ps.setInt(2, w.id);
ps.addBatch();
}
})
.updateBatch();
}

@Override
Expand Down
8 changes: 8 additions & 0 deletions frameworks/Java/solon/src/main/resources/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ solon.threads:
virtual:
enabled: true

solon.logging:
logger:
root:
level: INFO
appender:
console:
enable: false

solon.dataSources:
test!:
class: "com.zaxxer.hikari.HikariDataSource"
Expand Down
Loading