title: Unrecognised header byte error when try to decode an Avro message in Spring Cloud Stream
body: <p>I am trying to write a test case for my Spring Cloud Stream application. I am using <strong>Confluent Schema Registry</strong> with <strong>Avro</strong>, so I need to decode the message after polling from the channel. Here is my code:</p>
  
  <pre><code>    processor.input()
          .send(MessageBuilder.withPayload(InputData).build());
  
      Message&lt;?&gt; message = messageCollector.forChannel(processor.output()).poll();
  
      BinaryMessageDecoder&lt;OutputData&gt; decoder = OutputData.getDecoder();
      OutputData outputObject = decoder.decode((byte[]) message.getPayload());
  </code></pre>
  
  <p>For some reason this code throws</p>
  
  <blockquote>
    <p>org.apache.avro.message.BadHeaderException: Unrecognized header bytes: 0x00 0x08</p>
  </blockquote>
  
  <p>I am not sure if this is some sort of bug I am facing or I am not following a proper way to decode the received avro message. I suspect I need to set header with something, but I am not quite sure how and with what exactly. I would appreciate it if someone could help me with this matter.</p>
  
  <p>P.S: I am using <code>spring-cloud-stream-test-support</code> for the purpose of this test.</p>