[AMQ7, Openwire, Compression] consuming openwire compressed bytemessage throws java.util.zip.DataFormatException: incorrect header check

Solution Verified - Updated

Environment

  • JBoss AMQ 7.0.2
  • JBoss AMQ 7.0.3

Issue

  • Sending a (small) compressed Openwire ByteMessages with JMS properties set to a Queue causes the following exception on the consumer side when it tries to decompress the message:
javax.jms.JMSException: java.util.zip.DataFormatException: incorrect header check
	at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:72)
	at org.apache.activemq.command.ActiveMQBytesMessage.initializeReading(ActiveMQBytesMessage.java:884)
	at org.apache.activemq.command.ActiveMQBytesMessage.getBodyLength(ActiveMQBytesMessage.java:198)
	at com.mysample.ByteMessagesConsumer.doit(ByteMessagesConsumer.java:69)
	at com.mysample.ByteMessagesConsumer.main(ByteMessagesConsumer.java:22)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: java.util.zip.DataFormatException: incorrect header check
	at org.apache.activemq.command.ActiveMQBytesMessage.decompress(ActiveMQBytesMessage.java:902)
	at org.apache.activemq.command.ActiveMQBytesMessage.initializeReading(ActiveMQBytesMessage.java:876)
	... 9 more
Caused by: java.util.zip.DataFormatException: incorrect header check
	at java.util.zip.Inflater.inflateBytes(Native Method)
	at java.util.zip.Inflater.inflate(Inflater.java:259)
	at java.util.zip.Inflater.inflate(Inflater.java:280)
	at org.apache.activemq.command.ActiveMQBytesMessage.decompress(ActiveMQBytesMessage.java:898)
	... 10 more

Resolution

It seems when both "the message has a property set" AND "use compression" are used the issue occurs. If only one of those is used it seems to work.
Turning off compression has avoided this issue for other customers.

Content from issues.jboss.org is not included.ENTMQBR-943 has been raised to address the issue. The is currently scheduled to be fixed in AMQ 7.1.1 GA

Product(s)
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.