Initially it looked as if it was an encoding issue but when I had a closer look I could see that the issue lied in the frame assembler.
Actually the message segments generated in the Assembler.java (lines 158-162) were corrupted as a result of scrambled frame body content.
Assembler.frame() receives frames of a given message that are stored in a list and assembled and sent forward as soon as the last frame is received. The frame body content gets corrupted during this transition. This is due to a flaw in the frame body content formation logic in the broker transport input handler.
The InputHandler uses a fixed-length ByteBuffer which gets filled with incoming data stream and frame content is formed by slicing this buffer. When a ByteBuffer is sliced, the new buffer is a shared subsequence of the original buffer's content and changes to the original buffer is visible in the new buffer and vice versa. Because of this reason, frame content stored in the segment gets corrupted and as a result the content of final AMQP message gets corrupted.