Closed minhtran-q closed 3 years ago
There is no concept of a timeout for Kafka transactions.
And even with other transaction managers, the timeout won't help if the thread is stuck in user code.
I mean it's not completely stuck. It can be a long process and I want to control it for a certain time.
With JpaTransactionManager
, I noticed it can be set a timeout for each transaction. So I'm pretty confused why KafkaTransactionManager
doesn't have a per-transaction timeout configuration?
The transaction timeout only applies to the begin transaction or commit; it has nothing to do with how long the method runs for.
Ok, I got it, thanks for your help
I trying to configure a timeout for
org.springframework.kafka.transaction.KafkaTransactionManager
via@Transactional
(org.springframework.transaction.annotation.Transactional).But it doesn't seem to work. I search in org.springframework.cloud.stream.binder.kafka.KafkaMessageChannelBinder and see the
KafkaTransactionManager
is not a Bean. Does this have anything to do with inactivity timeout?And is there any solution for this?