You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/01/11 06:19:55 UTC

[GitHub] [servicecomb-java-chassis] zhufeizzz opened a new issue #1525: CSE能支持服务端异步吗?

zhufeizzz opened a new issue #1525: CSE能支持服务端异步吗?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1525
 
 
   类似于SpringMVC的@Async注解,长时间运行的服务,不需要返回值。
   
   AsyncRestTemplate支持客户端异步,实际还是占用Http请求,客户端服务端保持连接。
   
   没找到相关的说明,难道一定要在服务端代码里面自己放到异步队列?
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1525: CSE能支持服务端异步吗?

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #1525: CSE能支持服务端异步吗?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1525#issuecomment-573287538
 
 
   不用。 java-chassis的运行机制和SpringMVC不同。 默认情况下,java-chassis的业务执行都是在独立线程池执行,不占用http请求。 不需要```@async```标签。 你还可以非常简洁的通过配置将某个不同的业务接口,[配置为使用独立的线程池执行](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/thread-pool.html)
   
   可以通过[设计](https://servicecomb.apache.org/cn/docs/open-design/)和[Spring Boot集成](https://docs.servicecomb.io/java-chassis/zh_CN/using-java-chassis-in-spring-boot/using-java-chassis-in-spring-boot.html)了解运行时差异
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] zhufeizzz commented on issue #1525: CSE能支持服务端异步吗?

Posted by GitBox <gi...@apache.org>.
zhufeizzz commented on issue #1525: CSE能支持服务端异步吗?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1525#issuecomment-573291100
 
 
   > 不用。 java-chassis的运行机制和SpringMVC不同。 默认情况下,java-chassis的业务执行都是在独立线程池执行,不占用http请求。 不需要`@async`标签。 你还可以非常简洁的通过配置将某个不同的业务接口,[配置为使用独立的线程池执行](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/thread-pool.html)
   > 
   > 可以通过[设计](https://servicecomb.apache.org/cn/docs/open-design/)、[线程池模型](https://docs.servicecomb.io/java-chassis/zh_CN/general-development/thread-model.html)和[Spring Boot集成](https://docs.servicecomb.io/java-chassis/zh_CN/using-java-chassis-in-spring-boot/using-java-chassis-in-spring-boot.html)了解运行时差异
   
   你们可能没理解我的意思,我是想长任务立马返回Null给客户端,释放HTTP连接。
   如果自己写代码的话就是接收到请求,放入线程池队列,然后return void.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1525: CSE能支持服务端异步吗?

Posted by GitBox <gi...@apache.org>.
liubao68 edited a comment on issue #1525: CSE能支持服务端异步吗?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1525#issuecomment-573287538
 
 
   不用。 java-chassis的运行机制和SpringMVC不同。 默认情况下,java-chassis的业务执行都是在独立线程池执行,不占用http请求。 不需要```@async```标签。 你还可以非常简洁的通过配置将某个不同的业务接口,[配置为使用独立的线程池执行](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/thread-pool.html)
   
   可以通过[设计](https://servicecomb.apache.org/cn/docs/open-design/)、[线程池模型](https://docs.servicecomb.io/java-chassis/zh_CN/general-development/thread-model.html)和[Spring Boot集成](https://docs.servicecomb.io/java-chassis/zh_CN/using-java-chassis-in-spring-boot/using-java-chassis-in-spring-boot.html)了解运行时差异
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1525: CSE能支持服务端异步吗?

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #1525: CSE能支持服务端异步吗?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1525#issuecomment-573483119
 
 
   你说的这种方式目前没提供。可能需要你自己写一些代码将逻辑放到自己的线程池执行,并立即返回一个结果。 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1525: CSE能支持服务端异步吗?

Posted by GitBox <gi...@apache.org>.
yhs0092 commented on issue #1525: CSE能支持服务端异步吗?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1525#issuecomment-573287355
 
 
   Java-Chassis的异步资料在[这里](https://docs.servicecomb.io/java-chassis/zh_CN/general-development/reactive.html),Java-Chassis叫这种模式 "Reactive"
   另外,异步和HTTP连接占用是两个概念。HTTP 1.1协议要求在一条连接上必须是一来一回的数据发送方式。不能有上一个请求的应答还没有被服务端返回,客户端就复用这条连接发送下一个请求的情况。所以即使你的代码是Reactive模式运行的,在HTTP 1下还是需要足够多的连接数来维持高并发。

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] zhufeizzz edited a comment on issue #1525: CSE能支持服务端异步吗?

Posted by GitBox <gi...@apache.org>.
zhufeizzz edited a comment on issue #1525: CSE能支持服务端异步吗?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1525#issuecomment-573291100
 
 
   > 不用。 java-chassis的运行机制和SpringMVC不同。 默认情况下,java-chassis的业务执行都是在独立线程池执行,不占用http请求。 不需要`@async`标签。 你还可以非常简洁的通过配置将某个不同的业务接口,[配置为使用独立的线程池执行](https://docs.servicecomb.io/java-chassis/zh_CN/build-provider/thread-pool.html)
   > 
   > 可以通过[设计](https://servicecomb.apache.org/cn/docs/open-design/)、[线程池模型](https://docs.servicecomb.io/java-chassis/zh_CN/general-development/thread-model.html)和[Spring Boot集成](https://docs.servicecomb.io/java-chassis/zh_CN/using-java-chassis-in-spring-boot/using-java-chassis-in-spring-boot.html)了解运行时差异
   
   你们可能没理解我的意思,我是想长任务立马返回Null给客户端,释放HTTP连接。因为我只要确保服务调用了,不关注结果。
   如果自己写代码的话就是接收到请求,放入线程池队列,然后return void.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services