In a unit test with embeddedkafka, spring-kafka-test 3.0.6, I feel the transaction in consumer is too slow
09:10:11.000 o.s.k.l.KafkaMessageListenerContainer : Received: 1 records[]
09:10:11.100 o.a.k.c.p.internal.TransactionManager : Enqueuing trannsactional request
98.10.13.xxx kafka.clients.networkclient RECEIVED HEARTBEAT
09:10:15.000 o.s.k.l.KafkaMessageListenerContainer : Error handler threw exception...
Because I configured the consumer with avro serialization but I sent a string, so the exception is expected. However it took 4 seconds to process the transaction, should it be done within 1 second?
some configuration such as:
auto.offset.reset=earliest
enable.auto.commit=false
fetch.max.wait.ms=1
isolation.level=read_committed
max.poll.records=1
heartbeat.interval.ms=3000
max.in.flight.requests.per.connection=2
linger.ms=1
enable.idempotence=true
and no retry for serializationException
Update:
If it is running after other kafka test, the processing time will be shorter(<=1 second), does it need some warmup time? e.g. heartbeat, exchange metadata, offset?