Similarityoung opened a new pull request, #688:
URL: https://github.com/apache/dubbo-go-pixiu/pull/688

   <!--  Thanks for sending a pull request! 
   -->
   
   **What this PR does**:
   
   1. Core Proxy Functionality
   
   Implemented Passthrough Codec: To address the issue of the proxy's 
unawareness of message types, a custom grpc.Codec was implemented. It treats 
all messages as raw bytes ([]byte), effectively bypassing the Protobuf 
encoding/decoding steps and enabling true "passthrough" proxying.
   Unified Stream Handler: Leveraging grpc.UnknownServiceHandler, all gRPC 
requests, regardless of their type, are directed to a single stream handler. 
This handler establishes a full-duplex stream to the backend and transparently 
forwards data between the client and the backend. The request processing path 
is as follows:
   > Client -> GrpcListener -> GrpcProxyConnectionManager -> GrpcProxyFilter -> 
Backend Service
   
   2. Robustness and Lifecycle Management
   
   Backend Connection Pool & Health Checks: Implemented a thread-safe 
connection pool (using sync.Map) with locking for backend connections, 
including a reuse mechanism. A background goroutine was added to monitor 
connection health and evict stale connections.
   Implemented Graceful Shutdown: The framework was extended by adding a 
Close() method to the GrpcFilter interface. This ensures that all backend 
connections and resources are safely closed during gateway shutdown 
(Close/ShutDown), preventing leaks. Idempotency is guaranteed via sync.Once.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to