背景
今日练习kafka相关操作,但是却爆出了Failed to create new KafkaAdminClient
的错误
控制台看不出什么,于是我又看了下docker中kafka的日志
主要是这一行:org.apache.kafka.common.network.InvalidReceiveException: Invalid receive (size = 369295616 larger than 104857600)
说是超出了最大的范围,定位了错误就好改了
解决策略
指定下max-request-size
就好了
spring:
application:
name: kafka-demo
kafka:
bootstrap-servers: 192.43.113.51:9092
producer:
retries: 10
max-request-size: 104857600
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.apache.kafka.common.serialization.StringSerializer
consumer:
max-request-size: 104857600
group-id: ${spring.application.name}-test
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer