gRPC cleanup
This commit is contained in:
@@ -16,9 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.function.grpc;
|
||||
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -241,7 +238,6 @@ final class GrpcUtils {
|
||||
e.printStackTrace();
|
||||
responseObserver.onError(Status.UNKNOWN.withDescription("Error handling request")
|
||||
.withCause(e).asRuntimeException());
|
||||
// channel.shutdownNow();
|
||||
})
|
||||
.subscribe();
|
||||
|
||||
@@ -252,9 +248,6 @@ final class GrpcUtils {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new IllegalStateException(ie);
|
||||
}
|
||||
// finally {
|
||||
// channel.shutdownNow();
|
||||
// }
|
||||
}
|
||||
|
||||
private static ClientResponseObserver<GrpcSpringMessage, GrpcSpringMessage> clientResponseObserver(Flux<Message<byte[]>> inputStream, Many<Message<byte[]>> sink) {
|
||||
|
||||
@@ -47,7 +47,7 @@ import org.springframework.util.CollectionUtils;
|
||||
/**
|
||||
*
|
||||
* @author Oleg Zhurakousky
|
||||
*
|
||||
* @since 3.2
|
||||
*/
|
||||
public class MessageHandlingHelper<T extends GeneratedMessageV3> implements SmartLifecycle {
|
||||
|
||||
@@ -147,7 +147,6 @@ public class MessageHandlingHelper<T extends GeneratedMessageV3> implements Smar
|
||||
@Override
|
||||
public void onError(Throwable t) {
|
||||
t.printStackTrace();
|
||||
// responseObserver.onCompleted();
|
||||
responseObserver.onError(Status.UNKNOWN.withDescription("Error handling request")
|
||||
.withCause(t).asRuntimeException());
|
||||
}
|
||||
@@ -192,8 +191,6 @@ public class MessageHandlingHelper<T extends GeneratedMessageV3> implements Smar
|
||||
UnsupportedOperationException ex = new UnsupportedOperationException("The bi-directional streaming is "
|
||||
+ "not supported for functions that accept Publisher but return non-Publisher: "
|
||||
+ function);
|
||||
// responseObserver.onError(Status.UNKNOWN.withDescription("Error handling request")
|
||||
// .withCause(ex).asException());
|
||||
responseObserver.onCompleted();
|
||||
throw ex;
|
||||
}
|
||||
@@ -205,8 +202,6 @@ public class MessageHandlingHelper<T extends GeneratedMessageV3> implements Smar
|
||||
UnsupportedOperationException ex = new UnsupportedOperationException("The bidirection streaming is "
|
||||
+ "not supported for functions that accept non-Publisher but return Publisher: "
|
||||
+ function);
|
||||
// responseObserver.onError(Status.UNKNOWN.withDescription("Error handling request")
|
||||
// .withCause(ex).asException());
|
||||
responseObserver.onCompleted();
|
||||
throw ex;
|
||||
}
|
||||
@@ -243,7 +238,6 @@ public class MessageHandlingHelper<T extends GeneratedMessageV3> implements Smar
|
||||
@Override
|
||||
public void onError(Throwable t) {
|
||||
t.printStackTrace();
|
||||
//responseObserver.onCompleted();
|
||||
inputStream.tryEmitComplete();
|
||||
responseObserver.onError(Status.UNKNOWN.withDescription("Error handling request")
|
||||
.withCause(t).asException());
|
||||
|
||||
Reference in New Issue
Block a user