diff --git a/ballerina-tests/tests/resources/.keep b/ballerina-tests/tests/resources/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/native/src/main/java/io/ballerina/stdlib/grpc/OutboundMessage.java b/native/src/main/java/io/ballerina/stdlib/grpc/OutboundMessage.java index 4483533fb..d32dbd439 100644 --- a/native/src/main/java/io/ballerina/stdlib/grpc/OutboundMessage.java +++ b/native/src/main/java/io/ballerina/stdlib/grpc/OutboundMessage.java @@ -49,11 +49,11 @@ public class OutboundMessage { private final HttpCarbonMessage responseMessage; private int statusCode = NULL_STATUS_CODE; private boolean outboundClosed; - private final ThreadLocal framer; + private final MessageFramer framer; public OutboundMessage(HttpCarbonMessage responseMessage) { this.responseMessage = responseMessage; - this.framer = ThreadLocal.withInitial(() -> new MessageFramer(responseMessage)); + this.framer = new MessageFramer(responseMessage); } OutboundMessage(InboundMessage inboundMessage) { @@ -68,7 +68,7 @@ public OutboundMessage(HttpCarbonMessage responseMessage) { responseMessage.setHeader(CONTENT_TYPE_KEY, GrpcConstants.CONTENT_TYPE_GRPC); responseMessage.setHeader(TE_KEY, GrpcConstants.TE_TRAILERS); this.responseMessage = responseMessage; - this.framer = ThreadLocal.withInitial(() -> new MessageFramer(responseMessage)); + this.framer = new MessageFramer(responseMessage); } /** @@ -237,7 +237,7 @@ final void halfClose() { } final MessageFramer framer() { - return framer.get(); + return framer; } public boolean isReady() {