servicecomb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "郑扬勇" <yangyong.zh...@qq.com>
Subject [Discussion][Spring & Spring Boot version upgrade]Behavior of Consumer using RestTemplate had changed
Date Tue, 24 Apr 2018 08:01:19 GMT
Hi everyone:
   The version of Spring & Spring Boot in ServiceComb java chassis are 4.3.5.RELEASE and
1.4.5.RELEASE, seems a little behind, we may upgrade them.
  
  
Spring Boot and Spring Version correlation :
    Spring Boot Version Spring Version
   1.5.8.RELEASE 4.3.12.RELEASE
  1.5.9.RELEASE 4.3.13.RELEASE
  1.5.10.RELEASE 4.3.14.RELEASE
  1.5.11.RELEASE 4.3.15.RELEASE
  1.5.12.RELEASE 4.3.16.RELEASE

   I found if consumer use the RestTemplate make a invocation to our producer and producer
throw an unhande exception, http code with 590 [Cse Internal Server Error] will be return
to consumer side, but the Behavior of RestTemplate getForObject or postForObject in different
version of Spring is also not the same, for example:
  
 ```java
 String result = restTemplate.getForObject("http://127.0.0.1:8080/springmvc/controller/sayhi?name=throwexception",String.class);
 ```
  
 * In 4.3.12.RELEASE still throw UnknownHttpStatusCodeException, same as current (4.3.5.RELEASE)
; 
* In 4.3.13.RELEASE and 4.3.14.RELEASE change to throw org.springframework.web.client.ResourceAccessException
;
* In 4.3.15.RELEASE and 4.3.16.RELEASE won't throw any Exception and direct return {"message":"Cse
Internal Server Error"} .
  
   So if we update the Spring version to 4.3.12.RELEASE above,user may get into trouble when
upgrade 1.0.0-m2, but 4.3.16.RELEASE had fix some bugs and may better in security.
  
 
 
Any other ideas or suggestions are welcome !
 Yangyong Zheng
Best Regards !
 
 
 
consumer code is here : https://github.com/apache/incubator-servicecomb-java-chassis/blob/master/integration-tests/springmvc-tests/src/test/java/org/apache/servicecomb/demo/springmvc/tests/SpringMvcIntegrationTestBase.java
in ensureServerBlowsUp Funcation
 
Example producer will throw RuntimeException,code is here : https://github.com/apache/incubator-servicecomb-java-chassis/blob/master/integration-tests/springmvc-tests/src/test/java/org/apache/servicecomb/demo/springmvc/tests/endpoints/ControllerBase.java
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message