Compressing JMS Messages

A client can use TIBCO Enterprise Message Service (EMS) to compress the body of a message before sending the message to the server. JMS compression is specified for individual messages. It is especially useful when messages are to be stored on the EMS server, including persistent queue messages and topics with durable subscribers.

Enabling compression ensures that messages take up less memory space in storage and are handled faster by the EMS server. When JMS messages are compressed and stored, they are handled in the compressed form by the EMS server.

Compression normally takes time, and therefore the time to send or publish and receive compressed messages is generally longer than the time to send the same messages that are not compressed.

Note: When you configure JMS compression, note the following conditions:
  • JMS compression applies to adapter services with the JMS transport type.

  • Currently, JMS compression is not supported for Subscription Service and Remote Procedural Call (RPC) Service in the Request-Reply mode.

Publication Service

The methods of enabling JMS compression vary depending on the adapter service types. TIBCO ActiveMatrix Adapter for Database (TIBCO Business Studio) provides three ways to set JMS compression for Publication Service.

  • In TIBCO Business Studio, select the isCompressed check box in the Configuration tab of the JMS Publication endpoint.

  • In the adbagent.tra file, add either of the following properties:
    • tibco.sdk.session.jmsCompressed session_name Specifies a list of JMS session names. All the JMS endpoints under the specified session list send compressed JMS messages to the EMS server.
    • tibco.sdk.endpoint.jmsCompressed endpoint_name Specifies a list of JMS endpoints. All the specified JMS endpoints send compressed JMS messages to the EMS server.

    Note: Separate multiple session names or endpoint names with vertical bars (|).
  • In the adbagent.tra file, set the adb.jmscompress=<on/off> property or the adb.<publisher_service_name>.jmsProperties JMS_TIBCO_COMPRESS <on/off> property to on. The default value is off, indicating that messages are not compressed.
    Note: When you enable JMS compression, the adb.<publisher_service_name>.jmsProperties JMS_TIBCO_COMPRESS=<on/off> property is only used for Publication Service.

When JMS compression is enabled by using any of the preceding methods, published messages will be compressed. For example, when a Publication endpoint is set to be compressed in TIBCO Business Studio, the messages are compressed even if no related TRA property is set or a related TRA property is set to off.

Remote Procedural Call (RPC) Service

To enable JMS compression for both standard RPC Service and custom RPC Service, add either of the following properties in the adbagent.tra file:
  • tibco.sdk.session.jmsCompressed session_name
  • tibco.sdk.endpoint.jmsCompressed endpoint_name

The RPC server replies to JMS messages depending on whether the request messages are compressed. If the request messages are compressed, the RPC server replies to the compressed JMS messages. Otherwise, the RPC server replies to messages according to the configurations of the TRA properties.