Kafka batch listener incorrect deserializing message

前端 未结 1 1155
一向
一向 2021-01-16 11:40

I am using batch listening with following configuration but my message wrongly deserialise :

@KafkaListener(
    id = \"${kafka.buyers.product-sales-pricing.         


        
相关标签:
1条回答
  • 2021-01-16 11:45

    In your case you missed one configuration for batch listening:

    spring:
      kafka:
        listener:
        type: BATCH # this configuration is required in spring boot application without this spring boot return single message(without batch)
        fetch-min-size: 10 # without this you will get 1 message some time but this is optional in your case.
    

    I bet that in your problem your configuration will work if you remove List from kafkaListner class.

    Hope this helps you.

    0 讨论(0)
提交回复
热议问题