How to set request timeout for JMX Connector

前端 未结 2 2033
执笔经年
执笔经年 2021-02-07 09:59

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));
         


        
2条回答
  •  花落未央
    2021-02-07 10:39

    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.

    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
    

    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.

提交回复
热议问题