Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b4a2d55
Added ComputePoolService and moved the identity map endpoints onto th…
RSam25 Jan 23, 2026
827e3ee
[CI Pipeline] Released Snapshot version: 5.63.31-alpha-290-SNAPSHOT
Jan 23, 2026
57f1059
Added percentiles and pool name to default micrometer metrics
RSam25 Jan 27, 2026
34e2207
Merge branch 'srm-UID2-6480-move-compute-heavy-endpoints-to-worker-po…
RSam25 Jan 27, 2026
b222e72
[CI Pipeline] Released Snapshot version: 5.63.32-alpha-291-SNAPSHOT
Jan 27, 2026
9c77547
Added libpng CVEs to trivyignore for testing
RSam25 Jan 27, 2026
f3ca2a1
Merge branch 'srm-UID2-6480-move-compute-heavy-endpoints-to-worker-po…
RSam25 Jan 27, 2026
3cdf3d3
[CI Pipeline] Released Snapshot version: 5.63.33-alpha-292-SNAPSHOT
Jan 27, 2026
ec11efc
Removed ComputePoolService, added feature flags and fixed pool time m…
RSam25 Jan 27, 2026
fa2ad7d
Added log message for when feature is enabled
RSam25 Jan 27, 2026
72924e4
[CI Pipeline] Released Snapshot version: 5.63.34-alpha-293-SNAPSHOT
Jan 27, 2026
7ef4e7e
Changed GC to ZGC
RSam25 Jan 28, 2026
6e771fb
[CI Pipeline] Released Snapshot version: 5.63.35-alpha-294-SNAPSHOT
Jan 28, 2026
175377a
Reverted ZGC and set feature flag default false
RSam25 Feb 2, 2026
1146f8b
Reverted trivyignore
RSam25 Feb 2, 2026
f18f28f
Changed default config for compute pool thread count
RSam25 Feb 2, 2026
b8fe771
Made key/bidstream and key/sharing async
RSam25 Feb 2, 2026
12dddd9
Flipped feature flag to test in validator
RSam25 Feb 4, 2026
ef69443
[CI Pipeline] Released Snapshot version: 5.63.36-alpha-296-SNAPSHOT
Feb 4, 2026
5fe1d7a
Merge branch 'main' into srm-UID2-6480-move-compute-heavy-endpoints-t…
RSam25 Feb 4, 2026
2d9cfb4
Merge branch 'srm-UID2-6480-move-compute-heavy-endpoints-to-worker-po…
RSam25 Feb 4, 2026
407a7d2
[CI Pipeline] Released Snapshot version: 5.64.3-alpha-297-SNAPSHOT
Feb 4, 2026
2304754
Updated base alpine image to get rid of CVE
RSam25 Feb 6, 2026
a5b4651
Merge branch 'srm-UID2-6553-fix-libexpat-cve' into srm-UID2-6480-move…
RSam25 Feb 6, 2026
61bed60
Merge branch 'srm-UID2-6480-move-compute-heavy-endpoints-to-worker-po…
RSam25 Feb 6, 2026
d894ed9
Renamed compute pool to compute-heavy-request pool
RSam25 Feb 10, 2026
f235bab
Merge branch 'main' into srm-UID2-6480-move-compute-heavy-endpoints-t…
RSam25 Feb 10, 2026
5d5dda4
Changed to using blockingHandlers
RSam25 Feb 11, 2026
a9b45a0
[CI Pipeline] Released Snapshot version: 5.64.12-alpha-300-SNAPSHOT
Feb 11, 2026
1ec6110
Added env config for worker pool threads
RSam25 Feb 11, 2026
473d158
[CI Pipeline] Released Snapshot version: 5.64.13-alpha-301-SNAPSHOT
Feb 11, 2026
5c6b27f
Cleaned up redundant code
RSam25 Feb 11, 2026
adf05b1
[CI Pipeline] Released Snapshot version: 5.64.14-alpha-302-SNAPSHOT
Feb 11, 2026
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
3 changes: 2 additions & 1 deletion conf/default-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
"sharing_token_expiry_seconds": 2592000,
"operator_type": "public",
"enable_remote_config": true,
"uid_instance_id_prefix": "local-operator"
"uid_instance_id_prefix": "local-operator",
"enable_async_batch_request": true
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.uid2</groupId>
<artifactId>uid2-operator</artifactId>
<version>5.64.11</version>
<version>5.64.14-alpha-302-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/uid2/operator/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,9 @@ public class Config extends com.uid2.shared.Const.Config {
public static final String RuntimeConfigMetadataPathProp = "runtime_config_metadata_path";

public static final String IdentityEnvironmentProp = "identity_environment";

public static final String EnableAsyncBatchRequestProp = "enable_async_batch_request";

public static final String DefaultWorkerPoolThreadCount = "default_worker_pool_thread_count";
}
}
29 changes: 27 additions & 2 deletions src/main/java/com/uid2/operator/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ private static Vertx createVertx() {

MicrometerMetricsOptions metricOptions = new MicrometerMetricsOptions()
.setPrometheusOptions(prometheusOptions)
.setLabels(EnumSet.of(Label.HTTP_METHOD, Label.HTTP_CODE, Label.HTTP_PATH))
.setLabels(EnumSet.of(Label.HTTP_METHOD, Label.HTTP_CODE, Label.HTTP_PATH, Label.POOL_NAME))
.setJvmMetricsEnabled(true)
.setEnabled(true);
setupMetrics(metricOptions);
Expand All @@ -497,9 +497,14 @@ private static Vertx createVertx() {
? 60 * 1000
: 3600 * 1000;

final int defaultWorkerPoolSize = Math.max(2, (Runtime.getRuntime().availableProcessors() - 2) / 2 + 1);
final int workerPoolSize = getEnvInt(Const.Config.DefaultWorkerPoolThreadCount, defaultWorkerPoolSize);
LOGGER.info("Creating Vertx with default worker pool size: {}", workerPoolSize);

VertxOptions vertxOptions = new VertxOptions()
.setMetricsOptions(metricOptions)
.setBlockedThreadCheckInterval(threadBlockedCheckInterval);
.setBlockedThreadCheckInterval(threadBlockedCheckInterval)
.setWorkerPoolSize(workerPoolSize);

return Vertx.vertx(vertxOptions);
}
Expand All @@ -524,6 +529,7 @@ private static void setupMetrics(MicrometerMetricsOptions metricOptions) {
Objects.equals(id.getTag(Label.HTTP_CODE.toString()), "404")))
.meterFilter(new MeterFilter() {
private final String httpServerResponseTime = MetricsDomain.HTTP_SERVER.getPrefix() + MetricsNaming.v4Names().getHttpResponseTime();
private final String poolQueueTime = MetricsDomain.NAMED_POOLS.getPrefix() + MetricsNaming.v4Names().getPoolQueueTime();

@Override
public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticConfig config) {
Expand All @@ -533,6 +539,12 @@ public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticC
.build()
.merge(config);
}
if (id.getName().equals(poolQueueTime)) {
return DistributionStatisticConfig.builder()
.percentiles(0.50, 0.90, 0.95, 0.99)
.build()
.merge(config);
}
return config;
}
})
Expand Down Expand Up @@ -626,4 +638,17 @@ private IOperatorKeyRetriever createOperatorKeyRetriever() throws Exception {
}
}
}

private static int getEnvInt(String name, int defaultValue) {
String value = System.getenv(name);
if (value == null || value.isEmpty()) {
return defaultValue;
}
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
LOGGER.warn("Invalid integer value for environment variable {}: '{}', using default: {}", name, value, defaultValue);
return defaultValue;
}
}
}
38 changes: 28 additions & 10 deletions src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ public class UIDOperatorVerticle extends AbstractVerticle {
private final int optOutStatusMaxRequestSize;
private final boolean optOutStatusApiEnabled;

private final boolean isAsyncBatchRequestsEnabled;

//"Android" is from https://github.com/IABTechLab/uid2-android-sdk/blob/ff93ebf597f5de7d440a84f7015a334ba4138ede/sdk/src/main/java/com/uid2/UID2Client.kt#L46
//"ios"/"tvos" is from https://github.com/IABTechLab/uid2-ios-sdk/blob/91c290d29a7093cfc209eca493d1fee80c17e16a/Sources/UID2/UID2Client.swift#L36-L38
private static final List<String> SUPPORTED_IN_APP = Arrays.asList("Android", "ios", "tvos");
Expand Down Expand Up @@ -197,6 +199,7 @@ public UIDOperatorVerticle(IConfigStore configStore,
this.identityV3Enabled = config.getBoolean(IdentityV3Prop, false);
this.disableOptoutToken = config.getBoolean(DisableOptoutTokenProp, false);
this.uidInstanceIdProvider = uidInstanceIdProvider;
this.isAsyncBatchRequestsEnabled = config.getBoolean(EnableAsyncBatchRequestProp, false);
}

@Override
Expand Down Expand Up @@ -281,16 +284,8 @@ private void setUpEncryptedRoutes(Router mainRouter, BodyHandler bodyHandler) {
rc -> encryptedPayloadHandler.handleTokenRefresh(rc, this::handleTokenRefreshV2)));
mainRouter.post(V2_TOKEN_VALIDATE.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleTokenValidateV2), Role.GENERATOR));
mainRouter.post(V2_IDENTITY_BUCKETS.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleBucketsV2), Role.MAPPER));
mainRouter.post(V2_IDENTITY_MAP.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleIdentityMapV2), Role.MAPPER));
mainRouter.post(V2_KEY_LATEST.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleKeysRequestV2), Role.ID_READER));
mainRouter.post(V2_KEY_SHARING.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleKeysSharing), Role.SHARER, Role.ID_READER));
mainRouter.post(V2_KEY_BIDSTREAM.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleKeysBidstream), Role.ID_READER));
mainRouter.post(V2_TOKEN_LOGOUT.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handleAsync(rc, this::handleLogoutAsyncV2), Role.OPTOUT));
if (this.optOutStatusApiEnabled) {
Expand All @@ -302,8 +297,31 @@ private void setUpEncryptedRoutes(Router mainRouter, BodyHandler bodyHandler) {
if (this.clientSideTokenGenerate)
mainRouter.post(V2_TOKEN_CLIENTGENERATE.toString()).handler(bodyHandler).handler(this::handleClientSideTokenGenerate);

mainRouter.post(V3_IDENTITY_MAP.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleIdentityMapV3), Role.MAPPER));
if (isAsyncBatchRequestsEnabled) {
LOGGER.info("Async batch requests enabled");
mainRouter.post(V2_KEY_SHARING.toString()).handler(bodyHandler).blockingHandler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleKeysSharing), Role.SHARER, Role.ID_READER), false);
mainRouter.post(V2_KEY_BIDSTREAM.toString()).handler(bodyHandler).blockingHandler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleKeysBidstream), Role.ID_READER), false);
mainRouter.post(V2_IDENTITY_BUCKETS.toString()).handler(bodyHandler).blockingHandler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleBucketsV2), Role.MAPPER), false);
mainRouter.post(V2_IDENTITY_MAP.toString()).handler(bodyHandler).blockingHandler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleIdentityMapV2), Role.MAPPER), false);
mainRouter.post(V3_IDENTITY_MAP.toString()).handler(bodyHandler).blockingHandler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleIdentityMapV3), Role.MAPPER), false);
} else {
LOGGER.info("Async batch requests disabled");
mainRouter.post(V2_KEY_SHARING.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleKeysSharing), Role.SHARER, Role.ID_READER));
mainRouter.post(V2_KEY_BIDSTREAM.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleKeysBidstream), Role.ID_READER));
mainRouter.post(V2_IDENTITY_BUCKETS.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleBucketsV2), Role.MAPPER));
mainRouter.post(V2_IDENTITY_MAP.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleIdentityMapV2), Role.MAPPER));
mainRouter.post(V3_IDENTITY_MAP.toString()).handler(bodyHandler).handler(auth.handleV1(
rc -> encryptedPayloadHandler.handle(rc, this::handleIdentityMapV3), Role.MAPPER));
}
}

private void handleClientSideTokenGenerate(RoutingContext rc) {
Expand Down