Enabling Channel Compression for a Session

Valid values for the compression level to be applied to messages published by a client are 0 (no compression), or 1 through 9 (where 1 offers the least amount of compression and fastest data throughput, and 9 offers the most compression and slowest data throughput). The default value is 0. The compression value should be adjusted according to particular network requirements and the performance required.

Solace also offers message payload compression in the PubSub+ Messaging APIs. We recommend you only use one form of compression, either message compression through the event broker or message payload compression through the APIs. Compressing the same message multiple times can waste resources and usually does not result in smaller message sizes. For more information, see Support for End-to-End Payload Compression.

To Enable Channel Compression

PubSub+ Messaging API Use

PubSub+ Java RTO API

SessionHandle.PROPERTIES.COMPRESSION_LEVEL

PubSub+ C API

SOLCLIENT_SESSION_PROP_COMPRESSION_LEVEL

PubSub+ .NET API

SessionProperties.CompressionLevel

PubSub+ Node.js API

SessionProperties.CompressionLevel

PubSub+ JavaScript API Not applicable (compression not supported)

Related Samples

For an example of how to enable channel compression, see the DirectPubSub sample for the appropriate PubSub+ Messaging API.