Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix completes TransactionSendResult #7023

Open
wants to merge 1 commit into
base: 4.9.x
Choose a base branch
from

Conversation

tianchaohongyu
Copy link

Fix completes TransactionSendResult

@RongtongJin
Copy link
Contributor

@tianchaohongyu Could you create a related issue to explain this PR?

@tianchaohongyu
Copy link
Author

@tianchaohongyu Could you create a related issue to explain this PR?

The current modification involves copying the attribute values of SendResult to TransactionSendResult after sending a transactional message.

The problem I am currently facing is that in Spring Cloud development, a transaction sends multiple transactional messages. Therefore, each time the "executeLocalTransaction()" method is automatically called after sending a transactional message, it can only return the "UNKNOWN" status. As a result, I need to additionally call "endTransaction()" immediately after the local transaction ends to notify the Broker of the transaction status. However, the TransactionSendResult object returned by the "sendMessageInTransaction()" method does not have complete attributes, which prevents me from calling "endTransaction()".

Furthermore, from a software design perspective, since TransactionSendResult inherits from SendResult, it should adhere to the Liskov Substitution Principle and have all the attribute values of SendResult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants