# Special character recieving from kakfa confluent

**URL:** <https://forum.confluent.io/t/special-character-recieving-from-kakfa-confluent/8029>\
**Category:** Confluent Cloud\
**Created:** [6 June 2023 06:40 UTC](https://forum.confluent.io/t/special-character-recieving-from-kakfa-confluent/8029 "2023-06-06T06:40:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunil](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@sunil](https://forum.confluent.io/u/sunil)\
**Post date:** [6 June 2023 06:40 UTC](https://forum.confluent.io/t/special-character-recieving-from-kakfa-confluent/8029/1 "2023-06-06T06:40:42Z")

</div>

Hi All ,  
am recieving special character in the begining of json message from kakfa confluent topic while consuming through @KafkaListener at springboot microservice level.  
Because of special character in the begining of json message it is not auto Deserializing/mapping to pojo java class therefore am receving message into string then removing special character through java code & then mapping into java pojo class.

below are different error message while trying to solve this issue :

1\> Unexpected character **(‘%’ (code 37))**: expected a valid value (JSON String, Number, Array, Object or tok

 ![special-character](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/2X/b/b77c1d4273b785348eacc1af35ebc4083fef4067.jpeg)  
en ‘null’, ‘true’ or ‘false’)

2\> exception while type casting message to Request : Illegal character ((CTRL-CHAR, code 0)): only regular white space (\r, \n, \t) is allowed between tokens

3\> “ **\u0000\u0000\u0000\u0000l{** ”

 ![image](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/2X/1/1133817ab434c0737872d0dfcda12e74ca6712f7.png)

for Deserialzation am using below configuration ::

props.put(ConsumerConfig.KEY\_DESERIALIZER\_CLASS\_CONFIG, StringDeserializer.class.getName());

1\>props.put(ConsumerConfig.VALUE\_DESERIALIZER\_CLASS\_CONFIG, StringDeserializer.class.getName());

2\>props.put(“schema.registry.url”, “[https://xxxxxxxxxx-central-1.aws.confluent.cloud](https://xxxxxxxxxx-central-1.aws.confluent.cloud)”);

3\>props.put(SaslConfigs.SASL\_JAAS\_CONFIG, “org.apache.kafka.common.security.plain.PlainLoginModule required username=xxxxxxxxx password=‘xxxxxxxxx’;”);  
4\>props.put(SslConfigs.SSL\_ENDPOINT\_IDENTIFICATION\_ALGORITHM\_CONFIG, SslConfigs.DEFAULT\_SSL\_ENDPOINT\_IDENTIFICATION\_ALGORITHM);  
5\>props.put(CommonClientConfigs.SECURITY\_PROTOCOL\_CONFIG, “SASL\_SSL”);

i have uploaded pic for special character , highlighted in blue colour.

Any comments and suggestions will be appreciated. Thankss !!!

[@Confluent](https://forum.confluent.io/groups/confluent)

---

<div class="post-metadata">

**Author:** ![OneCricketeer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/onecricketeer/32/1551_2.png) [@OneCricketeer](https://forum.confluent.io/u/OneCricketeer)\
**Post date:** [6 June 2023 15:52 UTC](https://forum.confluent.io/t/special-character-recieving-from-kakfa-confluent/8029/2 "2023-06-06T15:52:22Z")

</div>

Your data isn’t a String. It appears to be encoded with a different serializer, such as Avro, perhaps, therefore is not JSON. Check the properties of your producer code before writing your consumer.
