Skip to content

Commit

Permalink
Upgrade play and java versions
Browse files Browse the repository at this point in the history
  • Loading branch information
amanteaux committed Jan 19, 2024
1 parent 78da7df commit f9836f6
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Cache SonarCloud packages
Expand Down
6 changes: 0 additions & 6 deletions .gitlab-ci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To build a new HTTP gateway, it is best to start looking at the [HTTP Gateway sa

Then the steps are:
1. Create a Java project, for example using the [Plume archetype](https://github.com/Coreoz/Plume-archetypes)
2. Make sure you are using at least Java 11
2. Make sure you are using at least Java 21
3. Add the HTTP Gateway Maven dependencies, in doubt, it is possible to copy the ones from the [sample HTTP Gateways pom.xml file](samples/pom.xml)
4. Create the Gateway entry point class, it is usually easier to copy/paste a [sample gateway class](samples/src/main/java/com/coreoz/http)
5. Use and configure available [HTTP Gateway modules](#available-modules)
Expand Down Expand Up @@ -110,7 +110,7 @@ TODO
----
- [ ] Provide documentation about logging and good practices
- [ ] Implement both key and basic auth for clients and services
- [ ] upgrade play and java versions
- [ ] upgrade netty and ahc versions
- [ ] provide a way to easily validate downstream request body
- [ ] Add Gateway archetype
- [ ] Add a module to generate an OpenAPI spec from existing specs, see https://github.com/kpramesh2212/openapi-merger-plugin
Expand Down
14 changes: 7 additions & 7 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@
</dependency>

<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-server_2.13</artifactId>
<groupId>org.playframework</groupId>
<artifactId>play-server_3</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-netty-server_2.13</artifactId>
<groupId>org.playframework</groupId>
<artifactId>play-netty-server_3</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-java_2.13</artifactId>
<groupId>org.playframework</groupId>
<artifactId>play-java_3</artifactId>
</dependency>

<!-- Pour avoir les mêmes versions de Jackson dans Play et Plume Framework -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_2.13</artifactId>
<artifactId>jackson-module-scala_3</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.coreoz.http.play;

import akka.NotUsed;
import akka.stream.javadsl.Source;
import akka.util.ByteString;
import com.coreoz.http.play.responses.HttpGatewayDownstreamError;
import com.coreoz.http.upstream.HttpGatewayUpstreamResponse;
import com.coreoz.http.play.responses.JsonContent;
import com.coreoz.http.play.responses.ResultError;
import com.coreoz.http.upstream.HttpGatewayUpstreamResponse;
import com.google.common.net.HttpHeaders;
import io.netty.handler.codec.http.HttpResponseStatus;
import org.apache.pekko.NotUsed;
import org.apache.pekko.stream.javadsl.Source;
import org.apache.pekko.util.ByteString;
import org.asynchttpclient.HttpResponseBodyPart;
import org.asynchttpclient.Param;
import org.reactivestreams.Publisher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.coreoz.http.play;

import akka.stream.Materializer;
import akka.stream.javadsl.AsPublisher;
import akka.stream.javadsl.Sink;
import akka.util.ByteString;
import io.netty.buffer.Unpooled;
import org.apache.pekko.stream.Materializer;
import org.apache.pekko.stream.javadsl.AsPublisher;
import org.apache.pekko.stream.javadsl.Sink;
import org.apache.pekko.util.ByteString;
import play.libs.F;
import play.libs.streams.Accumulator;
import play.mvc.BodyParser;
Expand Down
5 changes: 4 additions & 1 deletion core/src/test/java/com/coreoz/http/HttpGatewayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
public class HttpGatewayTest {
static int HTTP_GATEWAY_PORT = 9876;

static {
SparkMockServer.initialize();
}

@Test
public void integration_test__verify_that_server_starts_and_is_working() throws IOException, InterruptedException {
HttpGateway httpGateway = HttpGateway.start(new HttpGatewayConfiguration(
Expand Down Expand Up @@ -54,7 +58,6 @@ public void integration_test__verify_that_server_and_async_router_is_working() t
@Test
public void integration_test__verify_that_upstream_request_is_correctly_proxied() throws IOException, InterruptedException {
HttpGatewayUpstreamClient httpGatewayUpstreamClient = new HttpGatewayUpstreamClient();
SparkMockServer.initialize();
HttpGateway httpGateway = HttpGateway.start(new HttpGatewayConfiguration(
HTTP_GATEWAY_PORT,
HttpGatewayRouterConfiguration.asyncRouting(request -> {
Expand Down
21 changes: 11 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<javadoc.java-version>8</javadoc.java-version>
<additionalparam>-Xdoclint:none</additionalparam>
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/samples/target/site/ jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>

<!-- dependencies -->
<config-version>1.4.2</config-version>
<play-version>2.8.19</play-version>
<play-version>3.0.1</play-version>
<!-- TODO à mettre à jour après la mise à jour de AHC -->
<netty-version>4.1.87.Final</netty-version>
<!-- TODO à mettre à jour en v3 pour corriger https://github.com/AsyncHttpClient/async-http-client/issues/1660 -->
<async-http-client-version>2.12.3</async-http-client-version>
Expand Down Expand Up @@ -303,25 +304,25 @@
</dependency>

<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-server_2.13</artifactId>
<groupId>org.playframework</groupId>
<artifactId>play-server_3</artifactId>
<version>${play-version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-netty-server_2.13</artifactId>
<groupId>org.playframework</groupId>
<artifactId>play-netty-server_3</artifactId>
<version>${play-version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.play</groupId>
<artifactId>play-java_2.13</artifactId>
<groupId>org.playframework</groupId>
<artifactId>play-java_3</artifactId>
<version>${play-version}</version>
</dependency>

<!-- Pour avoir les mêmes versions de Jackson dans Play et Plume Framework -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_2.13</artifactId>
<artifactId>jackson-module-scala_3</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
Expand Down

0 comments on commit f9836f6

Please sign in to comment.