Skip to content

Commit 3029e1a

Browse files
caroline-ttdcYKatherine
authored andcommitted
Update snapshot consuming after migrating to maven central portal (#1801)
1 parent 070f089 commit 3029e1a

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

src/main/java/com/uid2/operator/service/ResponseUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public static JsonObject SuccessV2(Object body) {
6161
public static void SuccessV2(RoutingContext rc, Object body) {
6262
final JsonObject json = SuccessV2(body);
6363
rc.data().put("response", json);
64+
rc.next();
6465
}
6566

6667
public static void LogInfoAndSend400Response(RoutingContext rc, String message) {

src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,8 +1677,22 @@ private void handleIdentityMapV2(RoutingContext rc) {
16771677

16781678
if (!validateServiceLink(rc)) { return; }
16791679

1680-
final JsonObject resp = handleIdentityMapCommon(rc, inputList);
1681-
ResponseUtil.SuccessV2(rc, resp);
1680+
vertx.executeBlocking(
1681+
promise -> {
1682+
try {
1683+
final JsonObject resp = handleIdentityMapCommon(rc, inputList);
1684+
promise.complete(resp);
1685+
} catch (Exception e) {
1686+
promise.fail(e);
1687+
}},
1688+
false,
1689+
resp -> {
1690+
if (resp.succeeded()) {
1691+
ResponseUtil.SuccessV2(rc, resp.result());
1692+
} else {
1693+
ResponseUtil.LogErrorAndSendResponse(ResponseStatus.UnknownError, 500, rc, "Unknown error while mapping identity v2", (Exception) resp.cause());
1694+
}
1695+
});
16821696
} catch (Exception e) {
16831697
ResponseUtil.LogErrorAndSendResponse(ResponseStatus.UnknownError, 500, rc, "Unknown error while mapping identity v2", e);
16841698
}

src/test/java/com/uid2/operator/UIDOperatorVerticleTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333
import com.uid2.shared.store.salt.ISaltProvider;
3434
import io.micrometer.core.instrument.Metrics;
3535
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
36-
import io.vertx.core.AsyncResult;
37-
import io.vertx.core.Future;
38-
import io.vertx.core.Handler;
39-
import io.vertx.core.Vertx;
36+
import io.vertx.core.*;
4037
import io.vertx.core.buffer.Buffer;
4138
import io.vertx.core.json.JsonArray;
4239
import io.vertx.core.json.JsonObject;
@@ -2346,8 +2343,12 @@ void identityMapBatchBothEmailAndHashEmpty(String apiVersion, Vertx vertx, Vertx
23462343
req.put("email_hash", emailHashes);
23472344

23482345
send(apiVersion, vertx, apiVersion + "/identity/map", false, null, req, 200, respJson -> {
2349-
checkIdentityMapResponse(respJson);
2350-
testContext.completeNow();
2346+
try {
2347+
checkIdentityMapResponse(respJson);
2348+
testContext.completeNow();
2349+
} catch (Throwable ex) {
2350+
testContext.failNow(ex);
2351+
}
23512352
});
23522353
}
23532354

0 commit comments

Comments
 (0)