This closes #2395
This commit is contained in:
commit
76342e8e6f
|
@ -25,6 +25,7 @@ import java.util.zip.DataFormatException;
|
|||
import java.util.zip.Inflater;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.buffer.UnpooledByteBufAllocator;
|
||||
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
|
||||
import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
|
||||
|
@ -558,6 +559,7 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
|
|||
* I am keeping this synchronized as the decode of the Properties is lazy
|
||||
*/
|
||||
protected TypedProperties checkProperties() {
|
||||
try {
|
||||
if (properties == null) {
|
||||
synchronized (this) {
|
||||
if (properties == null) {
|
||||
|
@ -572,6 +574,18 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
|
|||
}
|
||||
|
||||
return this.properties;
|
||||
} catch (Throwable e) {
|
||||
ByteBuf duplicatebuffer = buffer.duplicate();
|
||||
duplicatebuffer.readerIndex(0);
|
||||
|
||||
// This is not an expected error, hence no specific logger created
|
||||
logger.warn("Could not decode properties for CoreMessage[messageID=" + messageID + ",durable=" + durable + ",userID=" + userID + ",priority=" + priority +
|
||||
", timestamp=" + timestamp + ",expiration=" + expiration + ",address=" + address + ", propertiesLocation=" + propertiesLocation, e);
|
||||
logger.warn("Failed message has messageID=" + messageID + " and the following buffer:\n" + ByteBufUtil.prettyHexDump(duplicatebuffer));
|
||||
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue