0
respostas

Expected a string but was BEGIN_OBJECT

Baixei o código da aula anterior "kafka-introducao-e-microservicos-aula4/video4.5/ecommerce". Realizei os procedimentos da aula "05-Microsserviços e módulos/Vídeo 03-Binários dos microsserviços" e deu o seguinte erro abaixo, alguém pode me ajudar???

Exception in thread "main" org.apache.kafka.common.errors.SerializationException: Error deserializing key/value for partition ECOMMERCE_SEND_EMAIL-0 at offset 140. If needed, please seek past the record to continue consumption.
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 2 path $
    at com.google.gson.Gson.fromJson(Gson.java:944)
    at com.google.gson.Gson.fromJson(Gson.java:897)
    at com.google.gson.Gson.fromJson(Gson.java:846)
    at com.google.gson.Gson.fromJson(Gson.java:817)
    at br.com.alura.ecommerce.GsonDeserializer.deserialize(GsonDeserializer.java:28)
    at org.apache.kafka.common.serialization.Deserializer.deserialize(Deserializer.java:60)
    at org.apache.kafka.clients.consumer.internals.Fetcher.parseRecord(Fetcher.java:1268)
    at org.apache.kafka.clients.consumer.internals.Fetcher.access$3600(Fetcher.java:124)
    at org.apache.kafka.clients.consumer.internals.Fetcher$PartitionRecords.fetchRecords(Fetcher.java:1492)
    at org.apache.kafka.clients.consumer.internals.Fetcher$PartitionRecords.access$1600(Fetcher.java:1332)
    at org.apache.kafka.clients.consumer.internals.Fetcher.fetchRecords(Fetcher.java:645)
    at org.apache.kafka.clients.consumer.internals.Fetcher.fetchedRecords(Fetcher.java:606)
    at org.apache.kafka.clients.consumer.KafkaConsumer.pollForFetches(KafkaConsumer.java:1294)
    at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1225)
    at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1201)
    at br.com.alura.ecommerce.KafkaService.run(KafkaService.java:36)
    at br.com.alura.ecommerce.EmailService.main(EmailService.java:16)
Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 2 path $
    at com.google.gson.stream.JsonReader.nextString(JsonReader.java:826)
    at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:402)
    at com.google.gson.internal.bind.TypeAdapters$16.read(TypeAdapters.java:390)
    at com.google.gson.Gson.fromJson(Gson.java:932)
    ... 16 more

Process finished with exit code 1