Skip to content

Commit 613eef2

Browse files
luyongshoulouis
andauthored
update edap dependencies version (#10226)
* 初始化edap-http-benchmark的项目 * 修改pom文件以及测试的配置 * 修改端口号,jdk版本以及去掉有问题的plaintext的测试项 * 修改Message启动时初始化为每次请求生成新的对象 * 去掉多余的"s"字符 * 增加plaintext的测试配置 * add edap-http framwork * cache plaintext's content. * add edap-http-fast * 解决docker构建文件编写错误 * 修改测试框架配置 * 增加dockerfile暴露端口的设置 * 增加edap-http的新版 * 完善maven快照无法下载的问题 * update edap version * delete edapx module * revert firenio code * edit mvn run option --------- Co-authored-by: louis <[email protected]>
1 parent 2820308 commit 613eef2

File tree

4 files changed

+34
-47
lines changed

4 files changed

+34
-47
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM maven:3.6.3-openjdk-8-slim as maven
1+
FROM maven:3.9.11-amazoncorretto-21 as maven
22
WORKDIR /edap-http
33
COPY pom.xml pom.xml
44
COPY src src
55
RUN mvn compile assembly:single -q
66

7-
FROM openjdk:8u275-jdk-slim
7+
FROM amazoncorretto:21.0.8
88
WORKDIR /edap-http
99
COPY --from=maven /edap-http/target/edap-http-benchmark-1.0-SNAPSHOT-jar-with-dependencies.jar app.jar
1010

1111
EXPOSE 8080
1212

13-
CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-Dedap.http.decoder.type=fast", "-cp", "app.jar", "io.edap.http.Bootstrap"]
13+
CMD ["java", "-DlazyParseHeader=true", "-server", "--add-exports", "java.base/sun.security.action=ALL-UNNAMED", "--add-exports", "java.naming/com.sun.jndi.ldap=ALL-UNNAMED", "--add-exports", "java.naming/com.sun.jndi.url.ldap=ALL-UNNAMED", "--add-exports", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED", "--add-exports", "jdk.naming.dns/com.sun.jndi.url.dns=ALL-UNNAMED", "--add-exports", "java.security.jgss/sun.security.krb5.internal=ALL-UNNAMED", "--add-exports", "jdk.attach/sun.tools.attach=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED", "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.naming/javax.naming.spi=ALL-UNNAMED", "--add-opens", "java.naming/com.sun.naming.internal=ALL-UNNAMED", "--add-opens", "jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED", "--add-opens", "java.naming/javax.naming=ALL-UNNAMED", "--add-opens", "java.rmi/java.rmi=ALL-UNNAMED", "--add-opens", "java.sql/java.sql=ALL-UNNAMED", "--add-opens", "java.management/javax.management=ALL-UNNAMED", "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", "--add-opens", "java.desktop/java.awt.image=ALL-UNNAMED", "--add-opens", "java.base/java.security=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/sun.net.www.protocol.https=ALL-UNNAMED", "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.vm=ALL-UNNAMED", "--add-opens", "java.base/java.lang.ref=ALL-UNNAMED", "--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-cp", "app.jar", "io.edap.http.Bootstrap"]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM maven:3.6.3-openjdk-8-slim as maven
1+
FROM maven:3.9.11-amazoncorretto-21 as maven
22
WORKDIR /edap-http
33
COPY pom.xml pom.xml
44
COPY src src
55
RUN mvn compile assembly:single -q
66

7-
FROM openjdk:8u275-jdk-slim
7+
FROM amazoncorretto:21.0.8
88
WORKDIR /edap-http
99
COPY --from=maven /edap-http/target/edap-http-benchmark-1.0-SNAPSHOT-jar-with-dependencies.jar app.jar
1010

1111
EXPOSE 8080
1212

13-
CMD ["java", "-server", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-XX:+AggressiveOpts", "-cp", "app.jar", "io.edap.http.Bootstrap"]
13+
CMD ["java", "-server", "--add-exports", "java.base/sun.security.action=ALL-UNNAMED", "--add-exports", "java.naming/com.sun.jndi.ldap=ALL-UNNAMED", "--add-exports", "java.naming/com.sun.jndi.url.ldap=ALL-UNNAMED", "--add-exports", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED", "--add-exports", "jdk.naming.dns/com.sun.jndi.url.dns=ALL-UNNAMED", "--add-exports", "java.security.jgss/sun.security.krb5.internal=ALL-UNNAMED", "--add-exports", "jdk.attach/sun.tools.attach=ALL-UNNAMED", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED", "--add-opens", "java.base/java.util.concurrent=ALL-UNNAMED", "--add-opens", "java.base/java.io=ALL-UNNAMED", "--add-opens", "java.base/java.nio=ALL-UNNAMED", "--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED", "--add-opens", "java.naming/javax.naming.spi=ALL-UNNAMED", "--add-opens", "java.naming/com.sun.naming.internal=ALL-UNNAMED", "--add-opens", "jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED", "--add-opens", "java.naming/javax.naming=ALL-UNNAMED", "--add-opens", "java.rmi/java.rmi=ALL-UNNAMED", "--add-opens", "java.sql/java.sql=ALL-UNNAMED", "--add-opens", "java.management/javax.management=ALL-UNNAMED", "--add-opens", "java.base/java.lang.reflect=ALL-UNNAMED", "--add-opens", "java.desktop/java.awt.image=ALL-UNNAMED", "--add-opens", "java.base/java.security=ALL-UNNAMED", "--add-opens", "java.base/java.net=ALL-UNNAMED", "--add-opens", "java.base/java.text=ALL-UNNAMED", "--add-opens", "java.base/sun.net.www.protocol.https=ALL-UNNAMED", "--add-exports", "jdk.management.agent/jdk.internal.agent=ALL-UNNAMED", "--add-exports", "java.base/jdk.internal.vm=ALL-UNNAMED", "--add-opens", "java.base/java.lang.ref=ALL-UNNAMED", "--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED", "-XX:+UseNUMA", "-XX:+UseParallelGC", "-cp", "app.jar", "io.edap.http.Bootstrap"]

frameworks/Java/edap-http/pom.xml

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,32 @@
1111

1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
14-
<java.version>8</java.version>
15-
<maven.compiler.source>8</maven.compiler.source>
16-
<maven.compiler.target>8</maven.compiler.target>
17-
<maven.compiler.compilerVersion>8</maven.compiler.compilerVersion>
14+
<java.version>21</java.version>
15+
<maven.compiler.source>21</maven.compiler.source>
16+
<maven.compiler.target>21</maven.compiler.target>
17+
<maven.compiler.compilerVersion>21</maven.compiler.compilerVersion>
1818
<edap.version>0.1-SNAPSHOT</edap.version>
19-
<edap.name>edapx</edap.name>
19+
<edap.name>edap</edap.name>
2020
</properties>
2121

2222
<dependencies>
2323
<dependency>
2424
<groupId>io.edap</groupId>
25-
<artifactId>${edap.name}-http</artifactId>
25+
<artifactId>${edap.name}-http-server</artifactId>
2626
<version>${edap.version}</version>
2727
</dependency>
2828
</dependencies>
2929

3030
<repositories>
3131
<repository>
32-
<id>central</id>
33-
<name>Central Repository</name>
34-
<url>https://repo.maven.apache.org/maven2</url>
35-
</repository>
36-
<repository>
37-
<id>sonatype-nexus-snapshots</id>
38-
<name>Sonatype Nexus Snapshots</name>
39-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
40-
</repository>
41-
</repositories>
42-
<pluginRepositories>
43-
<pluginRepository>
44-
<id>central</id>
45-
<name>Central Repository</name>
46-
<url>https://repo.maven.apache.org/maven2</url>
47-
</pluginRepository>
48-
<pluginRepository>
49-
<id>sonatype-nexus-snapshots</id>
50-
<name>Sonatype Nexus Snapshots</name>
51-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
52-
<releases>
53-
<enabled>false</enabled>
54-
</releases>
32+
<id>ossrh</id>
33+
<name>ossrh</name>
34+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
5535
<snapshots>
5636
<enabled>true</enabled>
5737
</snapshots>
58-
</pluginRepository>
59-
</pluginRepositories>
38+
</repository>
39+
</repositories>
6040
<build>
6141
<plugins>
6242

@@ -67,8 +47,8 @@
6747
<version>3.8.0</version>
6848
<configuration>
6949
<debug>false</debug>
70-
<source>8</source>
71-
<target>8</target>
50+
<source>21</source>
51+
<target>21</target>
7252
</configuration>
7353
</plugin>
7454

frameworks/Java/edap-http/src/main/java/io/edap/http/Bootstrap.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
package io.edap.http;
22

33
import io.edap.http.model.Message;
4-
import io.edap.x.Edap;
5-
import io.edap.x.http.HttpServer;
6-
import io.edap.x.http.HttpServerBuilder;
4+
import io.edap.Edap;
5+
import io.edap.http.server.HttpServer;
6+
import io.edap.http.server.HttpServerBuilder;
77

88
import java.io.IOException;
99

10-
import static io.edap.x.http.header.ContentType.JSON;
11-
import static io.edap.x.http.header.ContentType.PLAIN;
10+
import static io.edap.http.header.ContentTypeHeader.JSON;
11+
import static io.edap.http.header.ContentTypeHeader.PLAIN;
1212

1313
public class Bootstrap {
1414

1515
static final byte[] PLAIN_TEXT_CONTENT = "Hello, World!".getBytes();
1616

1717
public static void main(String[] args) throws IOException {
18-
18+
HttpHandleOption option = new HttpHandleOption();
19+
String lazyParseHeaderStr = System.getProperty("lazyParseHeader", "false");
20+
if (Boolean.parseBoolean(lazyParseHeaderStr)) {
21+
option.setLazyParseHeader(true);
22+
}
1923
HttpServer httpServer = new HttpServerBuilder()
2024
.listen(8080)
21-
.req("/plaintext", (req, resp) -> resp.contentType(PLAIN).write(PLAIN_TEXT_CONTENT))
22-
.get("/json", (req, resp) -> resp.contentType(JSON).write(new Message("Hello, World!")))
25+
.req("/plaintext", (req, resp) ->
26+
resp.contentType(PLAIN).write(PLAIN_TEXT_CONTENT), option)
27+
.get("/json", (req, resp) -> {
28+
resp.contentType(JSON).write(new Message("Hello, World!"));
29+
}, option)
2330
.build();
2431
Edap edap = new Edap();
2532
edap.addServer(httpServer);

0 commit comments

Comments
 (0)