Finding client-side native CORBA Java timeout properties

I use CORBA (ORB), which originally comes with Java , no third-party libraries are used.

I need the CORBA client properties for timeouts in order to set a timeout on the client side and limit the time that the connection remains open; It must be set for all scenarios to limit the maximum request time:

  • Connection initialization

  • Call forwarding

  • Total request time

I test by putting it to sleep on the Server (in the logic of the server method), and the client does not synchronize at all .

It is very difficult to find relevant documentation on the Internet; I tried to use all of the following 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 clarity, Host and Port are set next to these properties (above) using the org.omg.CORBA.ORBInitialHost and org.omg.CORBA.ORBInitialPort properties .

Any help is appreciated :)

+7
source share
2 answers

I can confirm for glass fish 3.1.2.2 that the proposed solution in Some CORBA properties is ignored .

Required system properties can be set as java command parameters

java -Dcom.sun.corba.ee.transport.ORBWaitForResponseTimeout=5000 -Dcom.sun.corba.ee.transport.ORBTCPConnectTimeouts=100:500:100:500 -Dcom.sun.corba.ee.transport.ORBTCPTimeouts=500:2000:50:1000 -cp .. 

or in your code using

 System.setProperty("com.sun.corba.ee.transport.ORBWaitForResponseTimeout","5000"); 

Be sure to set the ORB parameters as system. They have no effect if they are used as properties for an InitialContext.

+2
source

Read this Oracle blog for more information on timeouts. It helped me a lot.

Com.sun.corba.ee.impl.orbutil.ORBConstants has a number of ORB configuration parameters (note that this is an ORB GlassFish, not an ORD JDK). Constants related to transport timeouts:

  • TRANSPORT_TCP_TIMEOUTS_PROPERTY

This controls the behavior of the replay when the ORB reads the data and does not immediately receive all the data. This is an instance of TcpTimeouts. The default values ​​are 2000: 6000: 20.

  • TRANSPORT_TCP_CONNECT_TIMEOUTS_PROPERTY

This refers to this discussion. It controls how the ORB behaves on the client side when trying to connect to the IOR (wired link to the EJB link). This is also an instance of TcpTimeouts. The default values ​​are: 250: 60000: 100: 5000.

  • WAIT_FOR_RESPONSE_TIMEOUT

This determines how long the client waits for a response AFTER the request is successfully sent. The default value 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 :)

Where:

  • initial - this is the first timeout in milliseconds
  • max - maximum timeout (until the last wait that can elapse after this time) in milliseconds
  • backoff is a deferral rate at which the timeout increases each time (multiplication actually happens (deferral + 100) / 100, so 20 is 1.2 and 100 is 2, but we avoid using a floating point here). Usually it should be somewhere between 10 and 100.
  • maxsingle - maximum timeout. This is optional, and the default is Integer.MAX_VALUE if not defined.

This works as follows:

The first timeout, the last for the initial milliseconds. Each subsequent timeout is obtained from the previous one by multiplying by the delay coefficient (as explained above) The timeout cannot exceed the maximum number of milliseconds: after reaching this value, any subsequent timeouts have the same value. The total time spent before the last timeout is less than max. Please note that the last timeout may cause the total time to exceed the maximum value.

+2
source

All Articles