You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Summary
In the current transactional message mechanism, after the sender proactively checks the transaction status once and receives an "unknown" result, subsequent status checks are initiated by the broker. The broker selects an available connection from the same producer group to perform the check, using a round-robin strategy that prioritizes active and available connections.
Motivation
When selecting a connection, priority should be given to the original sender’s connection. This approach offers the following advantages:
Local State Validation: The transaction status can be directly determined from the sender’s local cache during the check, avoiding the need to query distributed caches or databases.
Example: The localTrans collection in org.apache.rocketmq.example.transaction.TransactionListenerImpl demonstrates this optimization.
Reduced Overhead: Minimizes network and I/O costs associated with distributed state queries.
Describe the Solution You'd Like
The expectation is that when the broker checks the transactional message, it can know which producer sent the message and give priority to calling back the original producer of the message.
Therefore, the entire modification involves three steps:
Message marking and passing: Use the clientId as the message identifier and record it in the extended field when the producer sends the message.
Mark acquisition: When the broker checks the transactional message, extract the sender's mark from the extended field.
Connection selection: When selecting a connection, adjust the connection selection strategy: prioritize the original-sender & writable & active > writable & active > original-sender & active > active.
Describe Alternatives You've Considered
1
Additional Context
1
The text was updated successfully, but these errors were encountered:
Before Creating the Enhancement Request
Summary
In the current transactional message mechanism, after the sender proactively checks the transaction status once and receives an "unknown" result, subsequent status checks are initiated by the broker. The broker selects an available connection from the same producer group to perform the check, using a round-robin strategy that prioritizes active and available connections.
Motivation
When selecting a connection, priority should be given to the original sender’s connection. This approach offers the following advantages:
Local State Validation: The transaction status can be directly determined from the sender’s local cache during the check, avoiding the need to query distributed caches or databases.
Example: The localTrans collection in org.apache.rocketmq.example.transaction.TransactionListenerImpl demonstrates this optimization.
Reduced Overhead: Minimizes network and I/O costs associated with distributed state queries.
Describe the Solution You'd Like
The expectation is that when the broker checks the transactional message, it can know which producer sent the message and give priority to calling back the original producer of the message.
Therefore, the entire modification involves three steps:
Message marking and passing: Use the clientId as the message identifier and record it in the extended field when the producer sends the message.
Mark acquisition: When the broker checks the transactional message, extract the sender's mark from the extended field.
Connection selection: When selecting a connection, adjust the connection selection strategy: prioritize the original-sender & writable & active > writable & active > original-sender & active > active.
Describe Alternatives You've Considered
1
Additional Context
1
The text was updated successfully, but these errors were encountered: