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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# From https://github.com/microsoft/vscode-dev-containers/blob/master/containers/go/.devcontainer/Dockerfile
ARG VARIANT="21-jdk-bookworm"
ARG VARIANT="25-jdk-trixie"
FROM mcr.microsoft.com/vscode/devcontainers/java:${VARIANT}
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a version of Java
"VARIANT": "21-jdk-bookworm",
"VARIANT": "25-jdk-trixie",
}
},
"containerEnv": {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 21
java-version: 25

- name: Cache Maven packages
uses: actions/cache@v5
Expand All @@ -52,7 +52,7 @@ jobs:

- name: Build with Maven
if: matrix.build-mode == 'manual'
run: mvn -B package --file extra/pom.xml
run: mvn -B clean package -DskipUnitTests --file extra/pom.xml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-image-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 21 ]
java: [ 25 ]
dockerfile-path: [ Dockerfile, Dockerfile-modules ]
include:
- dockerfile-path: Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
java: [ 21 ]
java: [ 25 ]

steps:
- uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-java-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
java: [ 21 ]
java: [ 25 ]

steps:
- uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-module-functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
java: [ 21 ]
java: [ 25 ]

steps:
- uses: actions/checkout@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-asset-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 21 ]
java: [ 25 ]
steps:
- uses: actions/checkout@v5
- name: Set up JDK
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazoncorretto:21.0.8-al2023
FROM amazoncorretto:25.0.3-al2023-headless

WORKDIR /app/prebid-server

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-modules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amazoncorretto:21.0.8-al2023
FROM amazoncorretto:25.0.3-al2023-headless

WORKDIR /app/prebid-server

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Follow next steps to create JAR file which can be deployed locally.

- Install prerequsites
- Java SDK: Oracle's or Corretto. Let us know if there's a distribution PBS-Java doesn't work with.
- Java SDK Version: 21
- Java SDK Version: 25
- Maven

- Clone the project:
Expand Down
447 changes: 309 additions & 138 deletions docs/config-app.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -55,83 +55,50 @@ public void disableScan() {
}

public Future<BidsScanResult> submitBids(RedisBidsData bids) {
final Promise<BidsScanResult> scanResult = Promise.promise();

final RedisAPI readRedisNodeAPI = this.readRedisNode.getRedisAPI();
final boolean shouldSubmit = !isScanDisabled
&& readRedisNodeAPI != null && !bids.getBresps().isEmpty();

if (shouldSubmit) {
readRedisNodeAPI.get("function_submit_bids", submitHash -> {
final Object submitHashResult = submitHash.result();
if (submitHashResult != null) {
final List<String> readArgs = List.of(
submitHashResult.toString(),
"0",
toBidsAsJson(bids),
apiKey,
"true");

readRedisNodeAPI.evalsha(readArgs, response -> {
if (response.result() != null) {
final BidsScanResult parserResult = redisParser
.parseBidsScanResult(response.result().toString());
final boolean isAnyRoSkipped = parserResult.getBidScanResults()
.stream().anyMatch(BidScanResult::isRoSkipped);

if (isAnyRoSkipped) {
reSubmitBidsToWriteNode(readArgs, scanResult);
} else {
scanResult.complete(parserResult);
}
} else {
scanResult.complete(getEmptyScanResult());
}
});
} else {
scanResult.complete(getEmptyScanResult());
}
});

return scanResult.future();
if (isScanDisabled || readRedisNodeAPI == null || bids.getBresps().isEmpty()) {
return Future.succeededFuture(getEmptyScanResult());
}

return Future.succeededFuture(getEmptyScanResult());
return readRedisNodeAPI.get("function_submit_bids")
.map(Response::toString)
.map(response -> List.of(response, "0", toBidsAsJson(bids), apiKey, "true"))
.compose(args -> scanBids(args, readRedisNodeAPI))
.otherwise(ignored -> getEmptyScanResult());
}

private Future<BidsScanResult> scanBids(List<String> args, RedisAPI redisAPI) {
return redisAPI.evalsha(args)
.map(Response::toString)
.map(redisParser::parseBidsScanResult)
.compose(parsedResult -> parsedResult.getBidScanResults()
.stream().anyMatch(BidScanResult::isRoSkipped)
? reSubmitBidsToWriteNode(args)
: Future.succeededFuture(parsedResult));
}

private void reSubmitBidsToWriteNode(List<String> readArgs, Promise<BidsScanResult> scanResult) {
private Future<BidsScanResult> reSubmitBidsToWriteNode(List<String> readArgs) {
final RedisAPI writeRedisAPI = this.writeRedisNode.getRedisAPI();
if (writeRedisAPI != null) {
final List<String> writeArgs = readArgs.stream().limit(4).toList();
writeRedisAPI.evalsha(writeArgs, response -> {
if (response.result() != null) {
final BidsScanResult parserResult = redisParser
.parseBidsScanResult(response.result().toString());

scanResult.complete(parserResult);
} else {
scanResult.complete(getEmptyScanResult());
}
});
} else {
scanResult.complete(getEmptyScanResult());
if (writeRedisAPI == null) {
return Future.succeededFuture(getEmptyScanResult());
}

final List<String> writeArgs = readArgs.stream().limit(4).toList();
return writeRedisAPI.evalsha(writeArgs)
.map(Response::toString)
.map(redisParser::parseBidsScanResult);
}

public Future<Boolean> isScanDisabledFlag() {
final RedisAPI redisAPI = this.readRedisNode.getRedisAPI();
final Promise<Boolean> isDisabled = Promise.promise();

if (redisAPI != null) {
redisAPI.get("scan-disabled", scanDisabledValue -> {
final Response scanDisabled = scanDisabledValue.result();
isDisabled.complete(scanDisabled != null && "true".equals(scanDisabled.toString()));
});

return isDisabled.future();
if (redisAPI == null) {
return Future.succeededFuture(true);
}

return Future.succeededFuture(true);
return redisAPI.get("scan-disabled")
.map(Response::toString)
.map(Boolean::parseBoolean)
.otherwise(false);
}

private String toBidsAsJson(RedisBidsData bids) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public RedisAPI getRedisAPI() {
*/
private void createRedisClient(Handler<AsyncResult<RedisConnection>> handler, boolean isReconnect) {
Redis.createClient(vertx, options)
.connect(onConnect -> {
.connect()
.onComplete(onConnect -> {
if (onConnect.succeeded()) {
connection = onConnect.result();
connection.exceptionHandler(e -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.maxmind.geoip2.DatabaseReader;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.vertx.core.Future;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.file.FileSystem;
import io.vertx.core.file.OpenOptions;
Expand Down Expand Up @@ -45,11 +44,10 @@ public DatabaseReaderFactory(GreenbidsRealTimeDataProperties properties, Vertx v
}

@Override
public void initialize(Promise<Void> initializePromise) {
downloadAndExtract()
public Future<Void> initialize() {
return downloadAndExtract()
.onSuccess(databaseReaderRef::set)
.<Void>mapEmpty()
.onComplete(initializePromise);
.mapEmpty();
}

private Future<DatabaseReader> downloadAndExtract() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.netty.handler.codec.http.HttpResponseStatus;
import io.vertx.core.Future;
import io.vertx.core.MultiMap;
import io.vertx.core.http.impl.headers.HeadersMultiMap;
import io.vertx.core.http.HttpHeaders;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.prebid.server.execution.timeout.Timeout;
Expand Down Expand Up @@ -69,7 +69,7 @@ private String resolveEndpoint(String tenant, String origin) {
}

private static MultiMap headers(OptableTargetingProperties properties, List<String> ips, String userAgent) {
final MultiMap headers = HeadersMultiMap.headers()
final MultiMap headers = HttpHeaders.headers()
.add(HttpUtil.ACCEPT_HEADER, "application/json");

if (userAgent != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.iab.openrtb.response.BidResponse;
import com.iab.openrtb.response.SeatBid;
import io.vertx.core.MultiMap;
import io.vertx.core.http.impl.headers.HeadersMultiMap;
import io.vertx.core.http.HttpHeaders;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpStatus;
import org.prebid.server.activity.infrastructure.ActivityInfrastructure;
Expand Down Expand Up @@ -193,7 +193,7 @@ protected Device givenDevice() {
}

protected HttpClientResponse givenSuccessHttpResponse(String fileName) {
final MultiMap headers = HeadersMultiMap.headers().add("Content-Type", "application/json");
final MultiMap headers = HttpHeaders.headers().add("Content-Type", "application/json");
return HttpClientResponse.of(HttpStatus.SC_OK, headers, givenBodyFromFile(fileName));
}

Expand Down
62 changes: 53 additions & 9 deletions extra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,31 @@

<properties>
<!-- Global project properties -->
<java.version>21</java.version>
<java.version>25</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>

<!-- Maven plugin versions -->
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
<maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
<maven-release-plugin.version>3.3.1</maven-release-plugin.version>
<maven-release-plugin.version>3.3.1</maven-release-plugin.version>
<maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
<maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>
<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
<docker-maven-plugin.version>0.46.0</docker-maven-plugin.version>
<checkstyle-plugin.version>3.6.0</checkstyle-plugin.version>
<checkstyle.version>10.17.0</checkstyle.version>

<!-- Project production dependency versions -->
<spring.boot.version>3.5.10</spring.boot.version>
<vertx.version>4.5.20</vertx.version>
<spring.boot.version>4.0.6</spring.boot.version>
<vertx.version>5.1.0</vertx.version>
<validation-api.version>2.0.1.Final</validation-api.version>
<commons.collections.version>4.4</commons.collections.version>
<commons.compress.version>1.27.1</commons.compress.version>
<commons-math3.version>3.6.1</commons-math3.version>
<commons-validator.version>1.10.0</commons-validator.version>
<commons-validator.version>1.10.1</commons-validator.version>
<scram.version>2.1</scram.version>
<httpclient.version>4.5.14</httpclient.version>
<ipaddress.version>5.5.1</ipaddress.version>
Expand All @@ -60,10 +61,12 @@
<dropwizard-metrics.version>4.2.30</dropwizard-metrics.version>

<!-- Project test dependency versions -->
<wiremock.version>3.12.1</wiremock.version>
<spock.version>2.4-M6-groovy-4.0</spock.version>
<wiremock.version>3.13.2</wiremock.version>
<wiremock-spring-boot.version>4.2.1</wiremock-spring-boot.version>
<spock.version>2.4-groovy-5.0</spock.version>
<!--TODO: replace with WireMock -->
<mockserver.version>5.15.0</mockserver.version>
<rest-assured-bom.version>6.0.0</rest-assured-bom.version>

<!-- Test properties -->
<skipUnitTests>false</skipUnitTests>
Expand All @@ -79,6 +82,20 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.25.4</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-bom</artifactId>
<version>2.0.17</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-dependencies</artifactId>
Expand Down Expand Up @@ -107,6 +124,18 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured-bom</artifactId>
<version>${rest-assured-bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.wiremock.integrations</groupId>
<artifactId>wiremock-spring-boot</artifactId>
<version>${wiremock-spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-jetty12</artifactId>
Expand Down Expand Up @@ -350,6 +379,21 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Loading
Loading