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 pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<dep.opentest4j.version>1.3.0</dep.opentest4j.version>
<dep.picocli.version>4.7.7</dep.picocli.version>
<dep.proto-google-common-protos.version>2.63.1</dep.proto-google-common-protos.version>
<dep.protobuf.version>3.25.5</dep.protobuf.version>
<dep.protobuf.version>4.33.0</dep.protobuf.version>
<dep.resilience4j.version>1.7.0</dep.resilience4j.version>
<dep.slf4j.version>2.0.17</dep.slf4j.version>
<dep.spymemcached.version>2.12.3</dep.spymemcached.version>
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/emissary/grpc/GrpcRoutingPlace.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import emissary.place.ServiceProviderPlace;

import com.google.common.util.concurrent.ListenableFuture;
import com.google.protobuf.GeneratedMessageV3;
import com.google.protobuf.Message;
import io.grpc.ManagedChannel;
import io.grpc.StatusRuntimeException;
import io.grpc.stub.AbstractBlockingStub;
Expand Down Expand Up @@ -170,8 +170,8 @@ protected void passivateConnection(ManagedChannel managedChannel) { /* No-op */
* @param <R> the protobuf response type
* @param <S> the gRPC stub type
*/
protected <Q extends GeneratedMessageV3, R extends GeneratedMessageV3, S extends AbstractBlockingStub<S>> R invokeGrpc(
String targetId, Function<ManagedChannel, S> stubFactory, BiFunction<S, Q, R> callLogic, Q request) {
protected <Q extends Message, R extends Message, S extends AbstractBlockingStub<S>> R invokeGrpc(String targetId,
Function<ManagedChannel, S> stubFactory, BiFunction<S, Q, R> callLogic, Q request) {

return retryHandler.execute(() -> {
ObjectPool<ManagedChannel> channelPool = channelPoolLookup(targetId);
Expand Down Expand Up @@ -207,9 +207,8 @@ protected <Q extends GeneratedMessageV3, R extends GeneratedMessageV3, S extends
* @param <R> the protobuf response type
* @param <S> the gRPC stub type
*/
protected <Q extends GeneratedMessageV3, R extends GeneratedMessageV3, S extends AbstractFutureStub<S>> List<R> invokeBatchedGrpc(
String targetId, Function<ManagedChannel, S> stubFactory,
BiFunction<S, Q, ListenableFuture<R>> callLogic, List<Q> requestList) {
protected <Q extends Message, R extends Message, S extends AbstractFutureStub<S>> List<R> invokeBatchedGrpc(String targetId,
Function<ManagedChannel, S> stubFactory, BiFunction<S, Q, ListenableFuture<R>> callLogic, List<Q> requestList) {

throw new UnsupportedOperationException("Not yet implemented");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ private void processWithMockBehavior(
SampleRequest request = SampleRequest.newBuilder()
.setQuery(ByteString.copyFrom(o.data()))
.build();
SampleResponse response = invokeGrpc(targetId, SampleServiceGrpc::newBlockingStub, callLogic, request);
SampleResponse response = invokeGrpc(
targetId,
SampleServiceGrpc::newBlockingStub, // or: (ManagedChannel c) -> SampleServiceGrpc.newBlockingStub(c)
callLogic,
request);
o.addAlternateView(ALTERNATE_VIEW_NAME, response.getResult().toByteArray());
}
}
Expand Down
Loading