You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In scope of #1699, ContainerProperties#setTransactionDefinition was deprecated together with ChainedTransactionManager. The note to this method, which we believe caused the deprecation, states:
Note that this is only generally useful when used with a org.springframework.kafka.transaction.ChainedKafkaTransactionManager configured with a non-Kafka transaction manager.
However, we do not use ChainedTransactionManager and do use ContainerProperties#setTransactionDefinition. Our use-case is implementation of Idempotent Consumer pattern with database storage for processed messages. The rough solution is as following:
Set JDBC/JPA Transaction Manager as ContainerProperties#setTransactionManager - database transaction is open by container when a new record is processed.
Implement RecordFilterStrategy that stores the incoming message id in the database, and filters the record if this id is already present.
This way, @KafkaListener and RecordFilterStrategy are executed in the same database transaction, which guarantees atomic write of business data and Idempotent Consumer records.
Since our @KafkaListeners have different requirements to the database transactions (in particular, timeouts), we use ContainerProperties#setTransactionDefinition to configure those. In case this method is removed after deprecation, we are in big trouble.
Would it be possible to remove the deprecation and update the javadocs of this method, so our services continue to function properly with future updates of spring-kafka?
The text was updated successfully, but these errors were encountered:
Resolves: spring-projects#1888
Incorrectly deprecated when ChainedKafkaTransactionManager was deprecated.
There are still valid use cases for this property.
In scope of #1699,
ContainerProperties#setTransactionDefinition
was deprecated together withChainedTransactionManager
. The note to this method, which we believe caused the deprecation, states:However, we do not use
ChainedTransactionManager
and do useContainerProperties#setTransactionDefinition
. Our use-case is implementation of Idempotent Consumer pattern with database storage for processed messages. The rough solution is as following:ContainerProperties#setTransactionManager
- database transaction is open by container when a new record is processed.RecordFilterStrategy
that stores the incoming message id in the database, and filters the record if this id is already present.@KafkaListener
andRecordFilterStrategy
are executed in the same database transaction, which guarantees atomic write of business data and Idempotent Consumer records.Since our
@KafkaListener
s have different requirements to the database transactions (in particular, timeouts), we useContainerProperties#setTransactionDefinition
to configure those. In case this method is removed after deprecation, we are in big trouble.Would it be possible to remove the deprecation and update the javadocs of this method, so our services continue to function properly with future updates of
spring-kafka
?The text was updated successfully, but these errors were encountered: