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

Make mvn grpc-jexpress-template upto date with Java 17/21 Support #60

Merged
merged 5 commits into from
Jan 25, 2024
Merged
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: 4 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ jobs:
run: ./gradlew build publishToMavenLocal -x :examples:build
- name: Build Examples
run: ./gradlew build
- name: Build Maven Template
run: |
cd grpc-jexpress-template
mvn clean install
49 changes: 32 additions & 17 deletions grpc-jexpress-template/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
<jetty.version>9.4.52.v20230823</jetty.version>
<grpc.version>1.60.0</grpc.version>
<protoc.version>3.25.2</protoc.version>
<metrics-guice.version>3.2.2</metrics-guice.version>
<metrics-guice.version>5.0.1</metrics-guice.version>
<javax.servlet.version>3.1.0</javax.servlet.version>
<metrics-healthchecks.version>4.0.2</metrics-healthchecks.version>
<jexpress.version>1.2-SNAPSHOT</jexpress.version>
<metrics-healthchecks.version>5.0.0</metrics-healthchecks.version>
<jexpress.version>1.39-SNAPSHOT</jexpress.version>
<proto-google-common-protos.version>1.12.0</proto-google-common-protos.version>
<guice.version>4.2.2</guice.version>
<guice.version>5.1.0</guice.version>
</properties>

<dependencies>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.6</version>
<version>1.18.30</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -80,6 +80,12 @@
<version>${jexpress.version}</version>
</dependency>

<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>

<!--grpc-->

<dependency>
Expand All @@ -103,7 +109,11 @@
<artifactId>grpc-netty-shaded</artifactId>
<version>${grpc.version}</version>
</dependency>

<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protoc.version}</version>
</dependency>
<!--end grpc-->

<!-- jetty -->
Expand Down Expand Up @@ -151,6 +161,12 @@
<version>2.0.1.Final</version>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>

</dependencies>

<repositories>
Expand All @@ -160,14 +176,12 @@
</repository>
<repository>
<id>clojars</id>
<url>http://clojars.org/repo/</url>
<url>https://clojars.org/repo/</url>
</repository>

<repository>
<id>central</id>
<url>http://central.maven.org/maven2/</url>
<url>https://central.maven.org/maven2/</url>
</repository>

<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
Expand All @@ -179,18 +193,19 @@
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.5.0.Final</version>
<version>1.7.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>3.12.1</version>
<!-- use jdk specific -->
<!-- <configuration>
<source>17</source>
<target>17</target>
</configuration>-->
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -209,7 +224,7 @@
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.1</version>
<version>0.6.1</version>
<extensions>true</extensions>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}
Expand Down
2 changes: 1 addition & 1 deletion grpc-jexpress-template/run_server.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

java -cp target/grpc-jexpress-template-1.0-SNAPSHOT.jar:target/lib/* com.flipkart.grpc.jexpress.SampleApplication -Dgjex.configurationFile=src/main/resources/configuration.yml
java -cp target/grpc-jexpress-template-1.0-SNAPSHOT.jar:target/lib/* --add-opens=java.base/java.lang=ALL-UNNAMED com.flipkart.grpc.jexpress.SampleApplication server src/main/resources/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void main(String[] args) throws InterruptedException {
if (args.length > 0) {
user = args[0];
}
System.out.println("Trying cart lite for:" + user);
System.out.println("Trying to create account for:" + user);
try {
CreateResponse createResponse = client.createUser("Foo");
System.out.println(createResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@

public class AllWhitelistTracingSampler extends ConfigurableTracingSampler {

public AllWhitelistTracingSampler() {
super.setIsTraceEnabled(true); // turns on tracing
@Override
public boolean isSampled(String component) {
return true;
}

}
3 changes: 3 additions & 0 deletions grpc-jexpress-template/src/main/resources/configuration.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Grpc:
server.port: 50051
server.executorThreads : 4

Dashboard:
service.port: 9999
Expand All @@ -14,6 +15,8 @@ Api:
service.workers: 30
scheduledexecutor.threadpool.size: 1

ScheduledJobs.executorThreads: 5

Tracing:
collector.endpoint: http://localhost:9411/api/v2/spans

Expand Down