Repository navigation
Apply TransactionManagerCustomizers to Pulsar transaction manager - #52762
Closed
amalsaidov wants to merge 1 commit into
Closed
amalsaidov wants to merge 1 commit into
amalsaidov wants to merge 1 commit into
Conversation
Previously, the PulsarTransactionManager auto-configured by PulsarAutoConfiguration was returned without running it through the available TransactionManagerCustomizers. Customizations contributed through TransactionManagerCustomizers, such as the TransactionExecutionListener beans applied by TransactionManagerCustomizationAutoConfiguration, were therefore silently ignored for Pulsar, unlike the Kafka, JPA, JDBC, R2DBC and Neo4j transaction managers which already apply them. This commit injects the available TransactionManagerCustomizers and applies them to the PulsarTransactionManager before it is returned. See spring-projectsgh-52761 Signed-off-by: amalsaidov <amalsaidov@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
|
Duplicates #52592 I think |
Author
|
Thanks for the quick look and the context 🙏 Understood on the direction here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PulsarAutoConfigurationauto-configures aPulsarTransactionManagerwhenspring.pulsar.transaction.enabledistrue, but it returns the manager without running it through the availableTransactionManagerCustomizers. Customizations contributed throughTransactionManagerCustomizers, such as theTransactionExecutionListenerbeans applied byTransactionManagerCustomizationAutoConfiguration, are therefore silently ignored for Pulsar. The Kafka, JPA, JDBC, R2DBC and Neo4j transaction managers already apply these customizers (see gh-52524 and gh-52562), so Pulsar was inconsistent.Solution
Inject
ObjectProvider<TransactionManagerCustomizers>into the bean method and apply it to thePulsarTransactionManagerbefore returning it, mirroringKafkaAutoConfiguration.kafkaTransactionManager.Tested
Added a regression test in
PulsarAutoConfigurationTests.TransactionManagerTeststhat registers aTransactionExecutionListeneralongsideTransactionManagerCustomizationAutoConfigurationand asserts it is applied to the auto-configuredPulsarTransactionManager. The test fails before the change and passes after it../gradlew :module:spring-boot-pulsar:test,:checkFormat,:checkstyleMainand:checkstyleTestpass (built with JDK 25). A human engineer directed, reviewed and tested this change.See gh-52761
🤖 Generated with Claude Code