Looking for the timeout properties of native java CORBA on the client-side

abdelrahman-sinno picture abdelrahman-sinno · Jun 20, 2013 · Viewed 7.5k times · Source

I am using CORBA (ORB) which natively comes with Java, no third party libraries are used.

I'm in need of the CORBA client Properties for timeouts, in order set a timeout on the client's side and limit the amount of time which the connection stays open; it should be set for all scenarios, to limit the maximum request time:

  • Initializing connection

  • Rebinding a connection

  • The total request time

I am testing by putting a sleep on the Server (within the server method logic), and the client is not timing out at all.

It is very difficult to find the appropriate documentation on the web; I have attempted using all the below properties, to no avail:

aProperties.put("com.sun.CORBA.transport.ORBTCPReadTimeouts", "100:300:3000:20"); aProperties.put("com.sun.corba.eetransport.ORBTCPTimeouts", "500:2000:50:1000"); aProperties.put("com.sun.corba.ee.transport.ORBWaitForResponseTimeout", 10);

For more clarity, next to these properties (above) are set the Host and Port using properties org.omg.CORBA.ORBInitialHost and org.omg.CORBA.ORBInitialPort.

Any help is appreciated :)

Answer

salocinx picture salocinx · Oct 14, 2014

Read this Oracle blog for more information about the time-outs. It helped me alot.

There are a number of ORB config parameters in com.sun.corba.ee.impl.orbutil.ORBConstants (note that this is the GlassFish ORB, not the JDK ORB). The constants relevant to transport timeouts are:

  • TRANSPORT_TCP_TIMEOUTS_PROPERTY

This controls the retry behavior when the ORB is reading data and does not get all of the data at once. It is an instance of TcpTimeouts. The defaults are 2000:6000:20.

  • TRANSPORT_TCP_CONNECT_TIMEOUTS_PROPERTY

This is the one relevant to this discussion. It controls how the ORB behaves on the client side when attempting to connect to an IOR (the wire rep of an EJB reference). This is also an instance of TcpTimeouts. The defaults are 250:60000:100:5000.

  • WAIT_FOR_RESPONSE_TIMEOUT

This controls how long the client waits for a response AFTER successfully sending a request. The default is 30 minutes. Both TcpTimeouts use the same syntax for configuration:

initial:max:backoff[:maxsingle] (a series of 3 or 4 positive decimal integers separated by :)

where:

  • initial is the first timeout in milliseconds
  • max is the maximum wait time (before the last wait, which can go over this time) in milliseconds
  • backoff is the backoff factor by which the timeout is increased each time (the multiplication is actually by (backoff+100)/100, so 20 is 1.2 and 100 is 2, but we avoid any use of floating point here). This should normally be somewhere between 10 and 100.
  • maxsingle is the maximum single wait time. This is optional, and defaults to Integer.MAX_VALUE if not defined.

This works as follows:

The first timeout last for initial milliseconds. Each subsequent timeout is obtained from the previous by multiplying by the backoff factor (as explained above) No timeout can exceed maxsingle milliseconds: once this value is reached, any subsequent timeouts have the same value. The total time spent before the last timeout is less than max. Note that the last timeout may cause the total time to exceed max.