Skip to content

Commit

Permalink
only readable message queues are allowed to be assigned to push consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
glcrazier committed Jan 4, 2024
1 parent 2d3cdf7 commit 2e40b6d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
Expand Down Expand Up @@ -389,6 +390,14 @@ public void onSuccess(Assignments latest) {
}
log.info("Attention!!! acquired empty assignments from remote, but existed assignments"
+ " is not empty, topic={}, clientId={}", topic, clientId);
} else {
List<Assignment> newAssignmentList = new ArrayList<>(latest.getAssignmentList().size());
for (Assignment assignment : latest.getAssignmentList()) {
if (assignment.getMessageQueue().getPermission().isReadable()) {
newAssignmentList.add(assignment);
}
}
latest = new Assignments(newAssignmentList);
}

if (!latest.equals(existed)) {
Expand Down

0 comments on commit 2e40b6d

Please sign in to comment.