Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is recommended to add a timeout option to the client code in the quick start of the sofa-rpc official website document. #445

Open
CoderiGenius opened this issue Mar 19, 2020 · 1 comment

Comments

@CoderiGenius
Copy link

建议 sofa-rpc 官网文档 快速开始 中Client代码增加超时选项

  • 官网文档 快速开始
  • 这个文档中client的代码没有.setConnectTimeout() 导致有可能跑demo的时候超时导致提示服务不可用
Exception in thread "main" com.alipay.sofa.rpc.core.exception.SofaRouteException: RPC-020020009: 当前服务[sofaRPC.HelloService:1.0]的地址[bolt://127.0.0.1:12200,]不可用,或指定的地址不在可用的地址列表中 
	at com.alipay.sofa.rpc.client.AbstractCluster.unavailableProviderException(AbstractCluster.java:496)
	at com.alipay.sofa.rpc.client.AbstractCluster.select(AbstractCluster.java:453)
	at com.alipay.sofa.rpc.client.FailoverCluster.doInvoke(FailoverCluster.java:65)
	at com.alipay.sofa.rpc.client.AbstractCluster.invoke(AbstractCluster.java:297)
	at com.alipay.sofa.rpc.client.ClientProxyInvoker.invoke(ClientProxyInvoker.java:83)
	at sofaRPC.HelloService_proxy_0.sayHello(HelloService_proxy_0.java)
	at sofaRPC.QuickStartClient.main(QuickStartClient.java:23)
  • 而github中对应demo的client代码中含有.setConnectTimeout()
  • 建议将官网代码添加setConnectTimeout
@sofastack-bot sofastack-bot bot changed the title 建议 sofa-rpc 官网文档 快速开始 中Client代码增加超时选项 It is recommended to add a timeout option to the client code in the quick start of the sofa-rpc official website document. Mar 19, 2020
@sofastack-bot
Copy link

sofastack-bot bot commented Mar 19, 2020

Hi @CoderiGenius, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

It is recommended to add a timeout option for the client code in the quick start of the official website documentation-official website documentation [quick start] (https://www.sofastack.tech/projects/sofa-rpc/getting-started-with-rpc/# Client implementation)-The client code in this document does not have .setConnectTimeout () which may cause the demo to time out and cause the service to be unavailable.Exception in thread "main" com.alipay.sofa.rpc.core.exception. SofaRouteException: RPC-020020009: The address [bolt: //127.0.0.1: 12200,] of the current service [sofaRPC.HelloService: 1.0] is unavailable, or the specified address is not in the list of available addresses at com.alipay.sofa.rpc .client.AbstractCluster.unavailableProviderException (AbstractCluster.java:496) at com.alipay.sofa.rpc.client.AbstractCluster.select (AbstractCluster.java:453) at com.alipay.sofa.rpc.client.FailoverCluster.doInvoke (FailoverCluster .java: 65) at com.alipay.sofa.rpc.client.AbstractCluster.invoke (AbstractCluster.java:297) at com.alipay.sofa.rpc.client.ClientProxyInvoker.invoke (ClientProxyInvoker.java:83) at sofaRPC. HelloService_ proxy_0.sayHello (HelloService_proxy_0.java) at sofaRPC.QuickStartClient.main (QuickStartClient.java:23) `-The client code of the corresponding demo in github contains .setConnectTimeout ()-It is recommended to add the official website code to setConnectTimeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant