Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java] Adding Armeria 1.26.4 #7061

Merged
merged 5 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 14 additions & 0 deletions java/armeria/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
framework:
website: armeria.dev
version: 1.26

build:
- mvn package

files:
- target/benchmark.jar

binaries:
- target/benchmark.jar

command: /usr/bin/java -jar /opt/web/target/benchmark.jar
70 changes: 70 additions & 0 deletions java/armeria/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>benchmark.armeria</groupId>
<artifactId>benchmark</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<name>armeria</name>
<url>https://armeria.dev/docs/setup</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>21</java.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<armeria.version>[1.26, 1.27)</armeria.version>
<slf4j.version>1.7.36</slf4j.version>
Copy link
Collaborator

Choose a reason for hiding this comment

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

May we use the latest version in maven ? I mean using something dynamic, like + to make sure the build use the latest version available

</properties>

<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<id>uber-jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>benchmark</finalName>
<createDependencyReducedPom>false</createDependencyReducedPom>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>benchmark.armeria.BenchmarkApplication</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.linecorp.armeria</groupId>
<artifactId>armeria</artifactId>
<version>${armeria.version}</version>
</dependency>
<!-- disable logging by using slf4j-nop -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package benchmark.armeria;

import com.linecorp.armeria.common.HttpResponse;
import com.linecorp.armeria.server.Server;

public class BenchmarkApplication {

private static final HttpResponse EMPTY_HTTP_RESPONSE = HttpResponse.of("");

public static void main(String... args) {
Server server = Server.builder()
.http(3000)
.service("/", (ctx, req) -> EMPTY_HTTP_RESPONSE)
.service("/user", (ctx, req) -> EMPTY_HTTP_RESPONSE)
.service("/user/:userId", (ctx, req) -> HttpResponse.of(ctx.pathParam("userId")))
.build();

server.closeOnJvmShutdown();
server.start().join();
}
}
Loading