Skip to main content

Product: OpenFusion JacORB

Version: 2.1 and above

 

Description:

How to set timeout policy?

 

Solution:

The recommended way to set timeouts on objects is to use the policies defined with the CORBA Messaging specification which is now part of the standard CORBA specification.

We believe the TIMEOUT_POLICY.value is Orbacus specific and the same effect can be achieved by using the policies defined in 22.2.4 of the CORBA 3.0 specification, for example the RelativeRequestTimeoutPolicy.

JacORB 1.4.1.6 contains an implementation of timeout policies in the ORB according to AMI spec. Some examples using REPLY_END_TIME_POLICY_TYPE, REPLY_START_TIME_POLICY_TYPE, and RELATIVE_RT_TIMEOUT_POLICY_TYPE may be seen in the source in the directory test/regression/src/orb/policies/TimingTest.java.

Note there are also various timeout properties available to configure in the jacorb.properties file:

jacorb.client.pending_reply_timeout=0

jacorb.connection.client_idle_timeout=0

jacorb.connection.server_timeout=10000

The jacorb.client.pending_reply_timeout will wait for the specified number of milliseconds for a reply. If it does not receive a reply during this time it will throw an org.omg.CORBA.Timeout exception.

The jacorb.connection.client_idle_timeout will close the connection if the client has not received any replies in the number of milliseconds it is set to. It does not take pending replies into account.

The jacorb.connection.server_timeout controls the number of milliseconds the server will keep the connection open. Again this does not take account of requests that are being processed. These properties will be set on the process rather than being object policies.


#KnowledgeDocs
#OpenFusion