6 Replies Latest reply on Oct 26, 2011 3:03 PM by pchandler

    ActiveMQ HTTP Transport Compression Support

    olivern

      Hello -

       

      I have an application that has been using the OpenWire TCP transport to publish TextMessages, with compression enabled - works fine.

       

      If I switch to the HTTP transport to traverse an XML Gateway (version 5.5 of ActiveMQ), the data gets through ok , but if I look at the messages on the wire they are not getting compressed (and they are not flagged as compressed when they are received by subscribers).  I didn't change any of the higher-level JMS API logic - still setting the 'useCompression' flag on the connection after I create it.

       

      So the question is - is compression actually supported by the ActiveMQ HTTP transport? If so, is there anything extra I need to do to actually enable it?

       

      Thanks,

       

      -Oliver

        • 1. Re: ActiveMQ HTTP Transport Compression Support
          garytully

          Currently there is no support for compression in the activemq http transport. It seems like a sensible enhancement. Please raise a jira issue to track this.

          • 2. Re: ActiveMQ HTTP Transport Compression Support
            pchandler

            Connection configuration URI, follow-up question: How do I tell which protocols implement the useCompression property? For example does nio: implement useCompression="true"?

            • 3. Re: ActiveMQ HTTP Transport Compression Support
              tabish121

              There was actually an issue recently fixed that was causing the TextMessage objects to not honor the ActiveMQConnectionFactory useCompression option, it was  AMQ-3556 you will find that if you use a recent 5.6 SNAPSHOT build that your sent TextMessages will arrive with the compressed option set to true. 

               

              The compression that is done when the ActiveMQConnectionFactory useCompression option is enabled affects the Message body only and is not dependent on the transport so it should work over Http, TCP, SSL, or NIO without issue.

              • 4. Re: ActiveMQ HTTP Transport Compression Support
                pchandler

                I agree that the property is on the connection and only the body/payload is compressed. Hence, it should apply for all protocols/transports and message types. 

                 

                However,

                 

                "Currently there is no support for compression in the activemq http transport. It seems like a sensible enhancement. Please raise a jira issue to track this." - gtully  above.

                • 5. Re: ActiveMQ HTTP Transport Compression Support
                  tabish121

                  Gary's quote is essentially correct, the HTTP transport in 5.5 has no support for additional compression beyond what is already done in the code elsewhere, however it should allow the already compressed Message's to pass through with compression intact, which it will do for all Messages with the fix in the issue I referenced above.  The fact that the TextMessage was not getting its contents compressed was a bug which is fixed in 5.6.

                   

                  I just completed  AMQ-3566  today which allows you to enable HTTP compression using gzip for the entire HTTP payload in the HttpTransport.

                  • 6. Re: ActiveMQ HTTP Transport Compression Support
                    pchandler

                    Thanks for the clarification.