You can compress the messages exchanged between the Java Open client and an application server. The methods listed in the following table provide compression functionality to the Java Open Client. These methods apply to the RuntimeProperties class and Connection class.

Table 1. Compression methods
Method Description
getCompressionEnabled() Gets PROGRESS.Session.EnableCompressionReturns TRUE if getCompressionEnabled() is called. The default value is FALSE.
getCompressionLevel() Gets PROGRESS.Session.CompressionLevel
getCompressionThreshold() Gets PROGRESS.Session.CompressionThreshold
setCompressionEnabled() Sets PROGRESS.Session.EnableCompression
setCompressionLevel() Sets PROGRESS.Session.CompressionLevel
setCompressionThreshold() Sets PROGRESS.Session.CompressionThreshold

The following example shows the creation of a new Connection object, which is compression enabled with a default compression level of 1 and a minimum message size of 300 bytes.


com.progress.open4gl.javaproxy.Connection conn = new
Connection("http://localhost:8810/apsv/asbroker1", null, null, "TestApp");

conn.setCompressionEnabled(true);

conn.setCompressionLevel(1);
              
conn.setCompressionThreshold(300);

The following example shows the creation of a new RuntimeProperties object, which is compression enabled. The compression level is set to 5, and the message size is set to 550 bytes.

com.progress.open4gl.RuntimeProperties.setCompressionEnabled(true);
                
com.progress.open4gl.RuntimeProperties.setCompressionLevel (5);
              
com.progress.open4gl.RuntimeProperties.setCompressionThreshold (550);