This is an automated email from the ASF dual-hosted git repository.
weihu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 3f2fd1c77 [ISSUE #4019][Enhancement] Code
optimization.[SubStreamHandler] (#4056)
3f2fd1c77 is described below
commit 3f2fd1c773ce1372823f7979ecdffb54b5ad37bf
Author: Kirill Saied <[email protected]>
AuthorDate: Thu Aug 31 13:14:00 2023 +0200
[ISSUE #4019][Enhancement] Code optimization.[SubStreamHandler] (#4056)
* [ISSUE #4019] Implemented Serializable
* [ISSUE #4019] Objects.requireNonNull for getTopic()
* [ISSUE #4019] Interrupt currentThread on InterruptedException
* Fixed checkstyle violations
* Removed redundant import
---
.../org/apache/eventmesh/client/grpc/consumer/SubStreamHandler.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/eventmesh-sdks/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/SubStreamHandler.java
b/eventmesh-sdks/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/SubStreamHandler.java
index 40cd41787..96cd82f6b 100644
---
a/eventmesh-sdks/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/SubStreamHandler.java
+++
b/eventmesh-sdks/eventmesh-sdk-java/src/main/java/org/apache/eventmesh/client/grpc/consumer/SubStreamHandler.java
@@ -28,6 +28,7 @@ import
org.apache.eventmesh.common.protocol.grpc.common.ProtocolKey;
import org.apache.eventmesh.common.protocol.grpc.common.SubscriptionReply;
import org.apache.eventmesh.common.utils.JsonUtils;
+import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@@ -39,7 +40,7 @@ import io.grpc.stub.StreamObserver;
import lombok.extern.slf4j.Slf4j;
@Slf4j
-public class SubStreamHandler<T> extends Thread {
+public class SubStreamHandler<T> extends Thread implements Serializable {
private final transient CountDownLatch latch = new CountDownLatch(1);
@@ -151,6 +152,7 @@ public class SubStreamHandler<T> extends Thread {
latch.await();
} catch (InterruptedException e) {
log.error("SubStreamHandler Thread interrupted", e);
+ Thread.currentThread().interrupt();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]