Skip to content

Apply transaction manager customizers to Pulsar - #52652

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

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

Conversation

@ShakilUrRehman21

Copy link
Copy Markdown
Contributor

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 (introduced in Spring Framework 6.1) were not added to it, leaving transaction lifecycle events unobserved.
  • TransactionManagerCustomizer beans were not applied to PulsarTransactionManager.
  • Common transaction properties configured under spring.transaction.* (such as default-timeout and rollback-on-commit-failure via TransactionProperties) were not configured on the manager.

This commit applies TransactionManagerCustomizers if available, and adds unit tests verifying that TransactionExecutionListener beans and customizer settings are applied.

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>
@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 8, 2026

@agammann agammann left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ShakilUrRehman21

Copy link
Copy Markdown
Contributor Author

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).

@snicoll

snicoll commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Thanks for the PR, but we already have a proposal for this, see #52592.

@snicoll snicoll closed this Nov 9, 2026
@snicoll snicoll 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 9, 2026
@ShakilUrRehman21
ShakilUrRehman21 deleted the apply-transaction-manager-customizers-to-pulsar branch November 9, 2026 10:13
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.

4 participants