# We see some junk characters while deserialising the message

**URL:** <https://community.solace.com/t/we-see-some-junk-characters-while-deserialising-the-message/1069>\
**Category:** General Discussions\
**Created:** [December 14, 2021, 2:14pm UTC](https://community.solace.com/t/we-see-some-junk-characters-while-deserialising-the-message/1069 "2021-12-14T14:14:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Setikam](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@Setikam](https://community.solace.com/u/Setikam)\
**Post date:** [December 14, 2021, 2:14pm UTC](https://community.solace.com/t/we-see-some-junk-characters-while-deserialising-the-message/1069/1 "2021-12-14T14:14:50Z")

</div>

Hi Team,

I have question about junk characters in the payload message. In our use case, we consume the message from solace topics.

As part of solution, we used spring cloud stream,

fun consumer(): Consumer\<Message\> , the string payload when we log it, it is having junk characters like G?teborg instead of Götenborg example

We tried to decoded with UTF-8 but no luck, Is there something which we are missing. Has anyone seen this issue before? Any leads or support appreciated. Thank you

---

<div class="post-metadata">

**Author:** ![Setikam](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@Setikam](https://community.solace.com/u/Setikam)\
**Post date:** [December 15, 2021, 2:09pm UTC](https://community.solace.com/t/we-see-some-junk-characters-while-deserialising-the-message/1069/2 "2021-12-15T14:09:08Z")

</div>

I found out the problem and it is working now. Producer while serialising the message, they have not done in right way. It is solved. Thank you

---

<div class="post-metadata">

**Author:** ![marc](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/marc/32/2191_2.png) [@marc](https://community.solace.com/u/marc)\
**Post date:** [December 15, 2021, 6:54pm UTC](https://community.solace.com/t/we-see-some-junk-characters-while-deserialising-the-message/1069/3 "2021-12-15T18:54:21Z")

</div>

Glad you solved it and thanks for letting us know @Setikam ?

---

<div class="post-metadata">

**Author:** ![Aaron](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/aaron/32/843_2.png) [@Aaron](https://community.solace.com/u/Aaron)\
**Post date:** [December 15, 2021, 7:28pm UTC](https://community.solace.com/t/we-see-some-junk-characters-while-deserialising-the-message/1069/4 "2021-12-15T19:28:13Z")

</div>

If anyone stumbles on this: probably the publisher was sending as TextMessage, which in Solace is a Structured Data Type (SDT) payload, where there is a single string wrapped with some additional bytes to indicate length. When deserializing, if the consumer just assumes the whole (binary blob) payload is a String, it’ll see some extra junk chars. The consumer either needs to consume / cast as a Text Message (if using Solace APIs), or the publisher needs to publish a Bytes / binary message with the string as payload. If using REST Messaging, the “content type” probably needs to be set to `text/plain`.
