Repository navigation
Apply transaction manager customizers to Pulsar - #52652
ShakilUrRehman21 wants to merge 1 commit into
Conversation
Previously, the PulsarTransactionManager that is auto-configured when spring.pulsar.transaction.enabled is set was not customized by TransactionManagerCustomizers, unlike the transaction managers that are auto-configured for JDBC, JPA, Neo4j, R2DBC, Kafka, and Batch Mongo. As a consequence, TransactionExecutionListener beans were not added to it, TransactionManagerCustomizer beans were not applied, and common transaction properties under spring.transaction.* were not configured. This commit applies the TransactionManagerCustomizers, if available. Signed-off-by: shakilurrehman21 <rehmanshakil21@gmail.com>
agammann
left a comment
There was a problem hiding this comment.
Could the test register a user-provided TransactionManagerCustomizer bean and assert that it changes the Pulsar manager? The new cases cover the auto-configured execution listener and default-timeout property, but the PR also promises to apply application customizers. An explicit bean case would guard that part of the contract and the ObjectProvider path. I reviewed the diff; I did not run tests locally.
Thanks for taking the time to review! TransactionProperties actually implements TransactionManagerCustomizer, so the existing test transactionManagerWithCustomizersIsConfigured() already verifies that a customizer bean registered in the context is gathered and applied to PulsarTransactionManager. This also aligns with the testing pattern used in the merged PRs for Kafka (#52524) and R2DBC (#52478). |
|
Thanks for the PR, but we already have a proposal for this, see #52592. |
Previously, the
PulsarTransactionManagerthat is auto-configured whenspring.pulsar.transaction.enabledis set was not customized byTransactionManagerCustomizers, unlike the transaction managers that are auto-configured for JDBC, JPA, Neo4j, R2DBC, Kafka, and Batch Mongo.As a consequence:
TransactionExecutionListenerbeans (introduced in Spring Framework 6.1) were not added to it, leaving transaction lifecycle events unobserved.TransactionManagerCustomizerbeans were not applied toPulsarTransactionManager.spring.transaction.*(such asdefault-timeoutandrollback-on-commit-failureviaTransactionProperties) were not configured on the manager.This commit applies
TransactionManagerCustomizersif available, and adds unit tests verifying thatTransactionExecutionListenerbeans and customizer settings are applied.