Message Compression

Solace PubSub+ allows client applications connected to an event broker to send and receive compressed message data. When the use of channel compression is enabled on the event broker and for the session that the client application has established to the event broker, messages sent from both the event broker and the client application are compressed before transmission, and they are decompressed when received by the client application or the event broker.

Configuring Message Compression for Data Connections

To use the message compression facility, you must perform the following steps:

  1. Configure a TCP listen port for clients to connect to for sending and receiving compressed message data.

    By default, the event broker listens for non-compressed connections on TCP port 55555, compressed connections on TCP port 55003, and compressed and encrypted connections on TCP port 55443. The listen ports are fully configurable, and for more information on configuration, see Services.

  2. Configure whether you want the event broker to compress the data to optimize the size of transmitted messages or to optimize the speed at which messages are delivered.

    Refer to Configuring the Data Compression Optimization Mode.

  3. On the client side, enable channel compression for the sessions that clients use to establish connections to the event broker.

    For information on how to enable message compression for a client session, see Enabling Channel Compression for a Session for Solace messaging APIs. For the Solace JMS API, the compression level is set through a JNDI or Data Connection property (see JMS Properties Reference).

Configuring the Data Compression Optimization Mode

When a TCP listen port is configured to use compression, you can configure whether you want the event broker to compress the data in egress messages so that it is optimized for size or for transmission speed. In general, the optimized‑for-size mode yields a higher compression ratio with lower throughput, while optimized-for-speed mode yields a higher throughput with lower compression ratio.

To configure the compression facility to compress the data to optimize the size of transmitted messages or to optimize the speed at which messages are delivered, enter the following CONFIG command:

solace(configure)# compression [mode]

Where:

mode is the compression mode to use. The two possible values are optimize‑for‑size (the default value) or optimize-for-speed.

:  While the compression level setting in the Solace messaging APIs can have a dramatic effect on the speed and level of compression achieved for published messages sent to the event broker, message data sent from the event broker is compressed in hardware that provides compression comparable to the most aggressive level offered by the APIs without sacrificing speed. Thus, the effect of the compression mode setting on the event broker is minimal for most situations.

Monitoring Message Compression

You can use several show commands to validate and monitor message compression configuration and status on event brokers:

Show Client Connections

To view whether a particular client is compressed or not, enter the following User EXEC command:

solace> show client <name> connections

Where:

<name> is the full name of the client, or part of the client name with the wildcard character ? used to represent one character of the name, or the wildcard character * used to represent zero or more characters of the name, where entering only the wildcard character * for the name displays all clients.

Show Client Stats Detail

To view the compression statistics for a particular clients, enter the following User EXEC command:

solace> show client <name> stats detail

Where:

<name> is the full name of the client, or part of the client name with the wildcard character ? used to represent one character of the name, or the wildcard character * used to represent zero or more characters of the name, where entering only the wildcard character * for the name displays all clients.

Show Compression

To view the compression configuration and statistics on an event broker, enter the following User EXEC command:

solace(configure)# show compression

  • The “Work queue depth” reflects outstanding compression/decompression requests. The “Current” reflects the number of requests currently held in the queue. The “High Water Mark” reflects the highest number of requests held in the queue since the last clearing of statistics through the clear compression stats Privileged EXEC command.
  • The number of bytes to be compressed/decompressed in a compression/decompression request varies on a per request basis.

Clear Compression Stats

To clear the current compression statistics, enter the following Privileged EXEC command:

solace# clear compression stats

When this command is entered, all of the compression statistic counters are reset to 0, and compression statistics begin to be recorded again from this point.

Show Service

To view the TCP listen ports for used by the event broker, enter the following User EXEC command:

solace(configure)# show service