Skip to content

Apply TransactionManagerCustomizers to Pulsar transaction manager - #52762

Closed
amalsaidov wants to merge 1 commit into
spring-projects:mainfrom
amalsaidov:pulsar-transaction-manager-customizers
Closed

amalsaidov wants to merge 1 commit into
spring-projects:mainfrom
amalsaidov:pulsar-transaction-manager-customizers

Conversation

@amalsaidov

Copy link
Copy Markdown

Problem

PulsarAutoConfiguration auto-configures a PulsarTransactionManager when spring.pulsar.transaction.enabled is true, but it returns the manager without running it through the available TransactionManagerCustomizers. Customizations contributed through TransactionManagerCustomizers, such as the TransactionExecutionListener beans applied by TransactionManagerCustomizationAutoConfiguration, 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 the PulsarTransactionManager before returning it, mirroring KafkaAutoConfiguration.kafkaTransactionManager.

Tested

Added a regression test in PulsarAutoConfigurationTests.TransactionManagerTests that registers a TransactionExecutionListener alongside TransactionManagerCustomizationAutoConfiguration and asserts it is applied to the auto-configured PulsarTransactionManager. The test fails before the change and passes after it. ./gradlew :module:spring-boot-pulsar:test, :checkFormat, :checkstyleMain and :checkstyleTest pass (built with JDK 25). A human engineer directed, reviewed and tested this change.

See gh-52761

🤖 Generated with Claude Code

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>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label Nov 11, 2026
@philwebb

Copy link
Copy Markdown
Member

Duplicates #52592 I think

@philwebb philwebb closed this Nov 11, 2026
@philwebb philwebb added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. labels Nov 11, 2026
@amalsaidov

Copy link
Copy Markdown
Author

Thanks for the quick look and the context 🙏 Understood on the direction here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: duplicate A duplicate of another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants