Before Creating the Enhancement Request
Summary
Reentrant orderly consumption (#6755) relies on a client retry (same attemptId) being routed back to the same broker, since OrderInfo and its attemptId match are broker-local state (QueueLevelConsumerManager.needBlock).
However, in ReceiveMessageActivity.ReceiveMessageQueueSelector#select, when the requested broker is not availabe(eg: in a rolling update), it silently falls back to round-robins to an other one.
protected static class ReceiveMessageQueueSelector implements QueueSelector {
private final String brokerName;
public ReceiveMessageQueueSelector(String brokerName) {
this.brokerName = brokerName;
}
@Override
public AddressableMessageQueue select(ProxyContext ctx, MessageQueueView messageQueueView) {
try {
AddressableMessageQueue addressableMessageQueue = null;
MessageQueueSelector messageQueueSelector = messageQueueView.getReadSelector();
if (StringUtils.isNotBlank(brokerName)) {
addressableMessageQueue = messageQueueSelector.getQueueByBrokerName(brokerName);
}
if (addressableMessageQueue == null) {
addressableMessageQueue = messageQueueSelector.selectOne(true);
}
return addressableMessageQueue;
} catch (Throwable t) {
return null;
}
}
}
Motivation
Avoid losing reentrancy and thus leaving the FIFO queue blocked until invisibleTime expires.
Describe the Solution You'd Like
Make the selector broker-sticky, especially on a FIFO request carrying an attemptId.
Describe Alternatives You've Considered
Additional Context
No response
Before Creating the Enhancement Request
Summary
Reentrant orderly consumption (#6755) relies on a client retry (same attemptId) being routed back to the same broker, since OrderInfo and its attemptId match are broker-local state (QueueLevelConsumerManager.needBlock).
However, in
ReceiveMessageActivity.ReceiveMessageQueueSelector#select, when the requested broker is not availabe(eg: in a rolling update), it silently falls back to round-robins to an other one.Motivation
Avoid losing reentrancy and thus leaving the FIFO queue blocked until invisibleTime expires.
Describe the Solution You'd Like
Make the selector broker-sticky, especially on a FIFO request carrying an attemptId.
Describe Alternatives You've Considered
Additional Context
No response