Skip to content

Commit

Permalink
Adapt to java sdk changes. Update dependencies. (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper authored Sep 29, 2023
1 parent 91f37bb commit 3ac47e8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void complex(ComplexRequest request, StreamObserver<ComplexResponse> resp
// background calls as well as request-response calls have an absolute ordering that is defined
// by their call order. In this concrete case, setValue is guaranteed to be executed before
// getValue.
ctx.backgroundCall(
ctx.oneWayCall(
ReceiverGrpc.getSetValueMethod(),
SetValueRequest.newBuilder()
.setKey(receiverUUID)
Expand Down Expand Up @@ -125,7 +125,7 @@ public void invokeSequentially(
.setValue(String.valueOf(i))
.build();
if (request.getExecuteAsBackgroundCall(i)) {
ctx.backgroundCall(ListServiceGrpc.getAppendMethod(), appendRequest);
ctx.oneWayCall(ListServiceGrpc.getAppendMethod(), appendRequest);
} else {
collectedAwaitables.add(ctx.call(ListServiceGrpc.getAppendMethod(), appendRequest));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void addInBackground(CounterAddRequest request, StreamObserver<Empty> res
logger.info("addInBackground invoked {}", request);

// Increment the counter
restateContext().backgroundCall(CounterGrpc.getAddMethod(), request);
restateContext().oneWayCall(CounterGrpc.getAddMethod(), request);

responseObserver.onNext(Empty.getDefaultInstance());
responseObserver.onCompleted();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ public void backgroundInvokeWithDifferentTargets(
NonDeterminismProto.NonDeterministicRequest request, StreamObserver<Empty> responseObserver) {
if (doLeftAction(request)) {
restateContext()
.backgroundCall(
.oneWayCall(
CounterGrpc.getGetMethod(),
CounterRequest.newBuilder().setCounterName("abc").build());
} else {
restateContext()
.backgroundCall(
.oneWayCall(
CounterGrpc.getResetMethod(),
CounterRequest.newBuilder().setCounterName("abc").build());
}
Expand Down Expand Up @@ -98,7 +98,7 @@ private boolean doLeftAction(NonDeterminismProto.NonDeterministicRequest request
private void incrementCounterAndEnd(
NonDeterminismProto.NonDeterministicRequest request, StreamObserver<Empty> responseObserver) {
restateContext()
.backgroundCall(
.oneWayCall(
CounterGrpc.getAddMethod(),
CounterAddRequest.newBuilder().setCounterName(request.getKey()).setValue(1).build());
responseObserver.onNext(Empty.getDefaultInstance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void executeComplex(Empty request, StreamObserver<Result> responseObserve
// In v1 case we create an awakeable, we ask the AwakeableHolderService to hold it, and then we
// await on it
Awakeable<String> awakeable = ctx.awakeable(TypeTag.STRING_UTF8);
ctx.backgroundCall(
ctx.oneWayCall(
AwakeableHolderServiceGrpc.getHoldMethod(),
AwakeableHolderProto.HoldRequest.newBuilder()
.setName("upgrade")
Expand All @@ -48,7 +48,7 @@ public void executeComplex(Empty request, StreamObserver<Result> responseObserve

// Store the result in List service, because this service is invoked with
// dev.restate.Ingress#Invoke
ctx.backgroundCall(
ctx.oneWayCall(
ListServiceGrpc.getAppendMethod(),
ListProto.AppendRequest.newBuilder().setListName("upgrade-test").setValue(version).build());

Expand Down
12 changes: 5 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ dependencyResolutionManagement {

versionCatalogs {
create("libs") {
version("protobuf", "3.21.9")
version("grpc", "1.50.2")
version("grpckt", "1.3.0")

version("protobuf", "3.24.3")
version("grpc", "1.58.0")
version("grpckt", "1.4.0")
version("log4j", "2.19.0")

version("jackson", "2.13.3")
version("jackson", "2.15.2")

version("junit-jupiter", "5.10.0")
version("assertj", "3.24.2")
Expand Down Expand Up @@ -58,7 +56,7 @@ dependencyResolutionManagement {
// Replace javax.annotations-api with tomcat annotations
library("javax-annotation-api", "org.apache.tomcat", "annotations-api").version("6.0.53")

library("vertx-bom", "io.vertx:vertx-stack-depchain:4.4.0")
library("vertx-bom", "io.vertx:vertx-stack-depchain:4.4.5")
library("vertx-core", "io.vertx", "vertx-core").withoutVersion()

library("jackson-bom", "com.fasterxml.jackson", "jackson-bom").versionRef("jackson")
Expand Down

0 comments on commit 3ac47e8

Please sign in to comment.