majiping2 opened a new issue, #15877:
URL: https://github.com/apache/dubbo/issues/15877

   ### Pre-check
   
   - [x] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Dubbo Version
   
   Dubbo Version: 3.3.1
   Spring Boot Version: 3.2.3
   Java Version: 21
   
   ### Steps to reproduce this issue
   
   I am using Dubbo 3.3.1 integrating with Spring Boot 3. The Triple protocol 
is configured to use the Servlet container (sharing the port with Spring Boot).
   
   1. Configuration (application.yml):
   server:
     port: 8083
   dubbo:
     protocol:
       name: tri
       port: ${server.port}
       triple:
         servlet:
           enabled: true
     registry:
       address: zookeeper://${zookeeper.address:127.0.0.1}:2181
   
   2.Service Implementation:
   @Path("/demo")
   @DubboService
   public class DemoServiceImpl implements DemoService {
       @Override
       @POST
       @Path("/user")
       public String getUserInfo(UserContext userContext) {
           // Issue: userContext is not null, but userId/userName are sometimes 
null
           System.out.println("userContext: " + userContext.toString());
           return "success";
       }
   }
   
   3.POJO (UserContext):
   public class UserContext {
       private String userId;
       private String userName;
       public UserContext(String userId, String userName) {
           this.userId = userId;
           this.userName = userName;
       }
       // getters and setters...
   }
   
   5.build.gradle
   dependencies {
       implementation(platform("org.apache.dubbo:dubbo-bom:3.3.1"))
   
       implementation("org.springframework.boot:spring-boot-starter-web") 
   
       implementation("org.apache.dubbo:dubbo-spring-boot-starter")
       implementation("org.apache.dubbo:dubbo-zookeeper-spring-boot-starter")
       implementation("org.apache.dubbo:dubbo-spring-boot-3-autoconfigure")
   
       implementation 'org.apache.dubbo:dubbo-rpc-triple:3.3.1'
   
       implementation("jakarta.ws.rs:jakarta.ws.rs-api:3.1.0")
   }
   
   4.Client Request: Send a POST request to http://localhost:8083/demo/user 
with JSON body {"userId":"1", "userName":"test"} repeatedly. 
   
   Actual Behavior When sending the same request multiple times, the behavior 
is inconsistent:
   Sometimes (Success): The userContext is correctly populated: 
UserContext{userId='1', userName='test'}.
   Sometimes (Failure): The userContext object is instantiated, but all 
properties are null: UserContext{userId='null', userName='null'}.
   
   ### What you expected to happen
   
   The UserContext should always be correctly populated with the values from 
the JSON request body.
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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