如何设置JMX连接器的请求超时 [英] How to set request timeout for JMX Connector

查看:583
本文介绍了如何设置JMX连接器的请求超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为JMX连接器设置请求超时,但似乎不起作用.

I'm trying to set request timeout for JMX Connector but seems like it doesn't work.

env.put("jmx.remote.x.request.waiting.timeout", new Long(30000));

但是,由于它不起作用,我在Google上搜索了一下原因,发现在标准JMX远程api中不支持上述环境变量.

But since it didn't work, i googled to see the reason and found out that in standard JMX remote api doesn't support the above environment variable.

还有其他设置请求超时的方法吗?

Is there any other way to set the request time-out?

推荐答案

如果使用默认的JMX协议-RMI-那么客户端超时的最佳选择是全局RMI连接超时.当然,只有在不需要使用必须永远打开的RMI连接的情况下,它才有效.

If you use default JMX protocol - the RMI - then the best option for the client side timeout is the global RMI connection timeout. Of course it will work only if you do not need to use RMI connections that have to be open forever.

这是超时的示例属性(摘自Oracle RMI文档: http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/sunrmiproperties.html ):

Here is sample property for the timeouts (taken from Oracle RMI documentation: http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/sunrmiproperties.html):

-Dsun.rmi.transport.tcp.responseTimeout=60000

我已经测试过了,它确实有效.在oracle文档中,对于通信的客户端和服务器端,还有一些其他有用的属性.

I have tested it, it really works. In the oracle documentation there are also few other useful properties for client and server side of the communication.

这篇关于如何设置JMX连接器的请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆