Due to a known issue do not use JDK1.8.0_151 with WSO2 products. Use JDK 1.8.0_144 until JDK 1.8.0_162-ea is released.
This documentation is for WSO2 Message Broker version 3.2.0. For the latest documentation, see the documentation for WSO2 Enterprise Integrator.
Skip to end of metadata
Go to start of metadata

All messages published to WSO2 MB are stored in a database, which guarantees message persistence. From WSO2 MB 3.1.0 onwards, you can reduce the overhead on the database by compressing (i.e., reducing the message content size) the messages using LZ4 compression. This will reduce the number of message content chunks, which in turn will reduce the number of records in the database. This is an optional configuration that you can set up in the message broker. 

Find out more about how this configuration improves the performance of your MB server.

Follow the steps given below to enable message content compression for your server.

  1. Open the broker.xml file from the <MB_HOME>/repository/conf directory.
  2. Enable compression by setting the following property to 'true'.

    <!-- This is the configuration to allow compression of message contents, before store messages into the database.-->
    <allowCompression>false</allowCompression>
  3. Specify the message content compression threshold using the following parameter. This is the minimum content size a message should have in order to be compressed. Messages smaller than this size will not be compressed, even if compression is enabled for the server.

    <!-- This is the configuration to change the value of the content compression threshold (in bytes).
    Message contents less than this value will not compress, even compression is enabled. The recommended message size of the smallest message before compression is 13 bytes. Compress messages smaller than 13 bytes will expand the message size by 0.4% -->
    <contentCompressionThreshold>1000</contentCompressionThreshold>

    Note the following when you set this parameter: 

    • If you set a very low value, the message size will increase due to the lack of repeated content. 

    • It is not recommended to compress messages that are smaller than 13 bytes.

    • This value effects the performance of your server: Lower values will reduce server performance. Higher values (greater than 1000) would increase performance.

  4. Specify values for the following parameters, which will determine the speed of the message sending mechanism:

    • The <parallelDecompressionHandlers> parameter specifies the total number of parallel decompression handlers that are used to decompress the message content before they are sent to subscribers. 

    • The <parallelContentReaders> parameter specifies the number of parallel readers used to read content from the message store.

    • The <parallelDeliveryHandlers> parameters specifies the number of parallel delivery handlers used to deliver messages to subscribers.

    <parallelDecompressionHandlers>5</parallelDecompressionHandlers>
    <parallelContentReaders>5</parallelContentReaders>
    <parallelDeliveryHandlers>5</parallelDeliveryHandlers>

    Note the following when you set this parameter:

    • Reducing this value would decrease the speed of the message sending mechanism, but also reduce the load on the message store. 

    • Increasing this value would increase the speed of the message sending mechanism because multiple handlers are working in parallel. However, the load on the message store would also increase. 

    • A higher number of cores is required to increase this value. 

    • The speed of the message sending mechanism depends on all three parameters given above. Therefore, it is recommendation to set the same (or nearly same) value for all of them.

  • No labels