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

如何在handler中获取请求和响应的超时时间 #4296

Open
ghosts321 opened this issue Apr 12, 2024 · 6 comments
Open

如何在handler中获取请求和响应的超时时间 #4296

ghosts321 opened this issue Apr 12, 2024 · 6 comments

Comments

@ghosts321
Copy link

如题

@ghosts321
Copy link
Author

public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception {

}

在Invocation和AsyncResponse中没有直接获取请求超时时间的方法,有其他方法能够获取到吗?

@liubao68
Copy link
Contributor

这样做的是解决什么问题了?

@ghosts321
Copy link
Author

@liubao68 在执行RPC请求前后进行一些额外的处理,包括处理超时、将RPC请求提交到业务线程池中执行、处理异常等

@liubao68
Copy link
Contributor

可以看看 invocation.getOperationMeta().getConfig().getMsRequestTimeout() 不过你的场景貌似用不到这个值。

@ghosts321
Copy link
Author

可以看看 invocation.getOperationMeta().getConfig().getMsRequestTimeout() 不过你的场景貌似用不到这个值。

应该是分别获取生产者和消费者的超时时间,请问有对应的参数吗?

@ghosts321 ghosts321 reopened this Apr 16, 2024
@liubao68
Copy link
Contributor

服务端收到请求后就会一直处理,不存在超时配置。 除非在业务处理过程中增加超时检测。

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

2 participants