lizining1231 opened a new pull request, #3816:
URL: https://github.com/apache/dubbo-go/pull/3816

   ### Description
   
   Fix #3814, Part of #3810 and the independent gRPC sub-issue.
   
   Connect public serialization registration to `protocol/grpc` by installing 
registered message codecs as grpc-go content subtypes. Applications select the 
subtype through normal public client configuration. This integration is 
separate from Triple's gRPC wire support.
   
   ### Changes
   
   #### 1. Registered subtype adapters
   
   - Resolve `grpc` message-codec registrations and install a stable adapter 
under the matching subtype name.
   - Preserve normal server subtype dispatch so existing Protobuf traffic and 
other registered subtypes remain available.
   
   #### 2. Process-wide configuration and ownership
   
   - Reuse a subtype only for matching configuration snapshots and namespaced 
parameters; reject conflicting settings.
   - Reject subtype names already registered outside the serialization 
extension mechanism.
   - Publish adapters only after successful construction, allowing 
initialization retry after failure.
   - Keep installed adapters for the process lifetime and avoid endpoint- or 
side-specific factory state.
   
   #### 3. Public client integration and compatibility
   
   - Apply the configured serialization as the outgoing gRPC content subtype 
through the public client API.
   - Preserve standard Protobuf and existing `jsonpb` JSON behavior.
   - Document subtype registration, configuration conflicts and 
process-lifetime ownership.
   
   #### 4. Tests
   
   - Exercise custom-subtype RPC, public-client selection, configuration 
conflicts, external registration conflicts, construction retry and legacy JSON 
behavior.
   - Keep all four new test functions in this PR alongside the adapter 
implementation.
   
   ### Test
   
   This PR adds 4 root-module tests and 0 independent-module RPC scenarios. 
Every new top-level test is listed below; table-driven subtests remain under 
their parent functions.
   
   #### `protocol/grpc/serialization_test.go`
   
   | Test | Description |
   | --- | --- |
   | `TestGRPCSerializationRPCAndConflict` | Complete custom-subtype RPC and 
reject conflicting configurations. |
   | `TestLegacyGRPCJSONSemantics` | Preserve existing independent gRPC JSON 
behavior. |
   | `TestCodecGRPCConflictsAndRetry` | Handle subtype registration conflicts 
and retry after failed construction. |
   | `TestCodecPublicGRPCClientDefaultSubtype` | Apply configured subtype 
selection through the public gRPC client. |
   
   ### Checklist
   - [x] I confirm the target branch is `develop`
   - [x] I have run `make fmt` to format my code
   - [x] I have run `make test` to run local tests
   - [x] I have added tests that prove my fix is effective or that my feature 
works


-- 
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