Bug 1045311

Summary: org.jboss.remoting-jmx.timeout is not used when connecting the first time
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Osamu Nagano <onagano>
Component: JMXAssignee: Darran Lofthouse <darran.lofthouse>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.1CC: darran.lofthouse, hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-08 13:31:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Osamu Nagano 2013-12-20 06:46:05 UTC
Description of problem:
Timeout second is fixed at 5 seconds as on line 209 below and not configurable when a client is trying to connect to the server first time. There is a constant "org.jboss.remoting-jmx.timeout" but it is not used here.

https://github.com/jbossas/remoting-jmx/blob/1.1.0.Final/src/main/java/org/jboss/remotingjmx/RemotingConnector.java#L185
~~~
    207         // open a connection
    208         final IoFuture<Connection> futureConnection = endpoint.connect(convert(serviceUrl), getOptionMap(), handler);
    209         IoFuture.Status result = futureConnection.await(5, TimeUnit.SECONDS);
~~~


Version-Release number of selected component (if applicable):
remoting-jmx 1.1.0.Final

Comment 1 Osamu Nagano 2013-12-20 06:51:10 UTC
Sample JMX client can be found in https://access.redhat.com/site/solutions/125473 like this.

~~~
import javax.management.MBeanServerConnection;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;

public class JMXExample { 
    public static void main(String[] args) throws Exception {
        String host = "remote-host";
        int port = 9999;  // management-native port
        String urlString ="service:jmx:remoting-jmx://" + host + ":" + port;
        System.out.println("\n\n\t****  urlString: "+urlString);;
        JMXServiceURL serviceURL = new JMXServiceURL(urlString);
        JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, null);
        MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();

        //Invoke on the JBoss AS MBean server
        int count = connection.getMBeanCount();
        System.out.println(count);
        jmxConnector.close();
    }
}
~~~

Where "JMXConnectorFactory.connect(serviceURL, null)" passing null, it should be a configuration map like "org.jboss.remoting-jmx.timeout":"1000".

Comment 2 Darran Lofthouse 2014-07-08 13:31:11 UTC

*** This bug has been marked as a duplicate of bug 1113242 ***

Comment 3 JBoss JIRA Server 2015-04-01 16:56:40 UTC
Darran Lofthouse <darran.lofthouse> updated the status of jira REMJMX-77 to Resolved