epsteina16 opened a new issue #7657:
URL: https://github.com/apache/pulsar/issues/7657
**Describe the bug**
When subscribing to a topic with AUTO_CONSUME, where the schema is a JSON
serialized class that contains a byte array, Pulsar de-serializes the message
value into a string instead of a byte array for the byte array field.
**To Reproduce**
Steps to reproduce the behavior:
1. Produce to a topic using the Java client with a JSON serialized Java
class that contains a byte array (byte[]).
2. Subscribe to that topic with AUTO_CONSUME
3. Get the value of the message with getValue()
4. Get the raw object of the byte array field with getField("name of byte
arr field")
5. Check output of .getClass() on that raw object from step 4. This produces
java.lang.String. instead of [B or byte[] (simple name).
**Expected behavior**
Step 5 should produce [B or byte[] if using simpleName. Pulsar client should
not be encoding a byte array and not decode it to produce the same result.
**Desktop (please complete the following information):**
- Linux
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]