numinnex commented on code in PR #3763:
URL: https://github.com/apache/iggy/pull/3763#discussion_r3674143294
##########
foreign/node/src/wire/message/poll-messages.command.ts:
##########
@@ -67,7 +85,79 @@ export const POLL_MESSAGES = {
}
};
+const groupKey = ({ streamId, topicId, consumer }: PollMessages): string =>
+ `${String(streamId)}\0${String(topicId)}\0${String(consumer.id)}`;
+
+const syncAssignment = async (
+ client: RawClient,
+ request: PollMessages,
+): Promise<GroupCursor> => {
+ const response = await client.sendCommand(
+ SYNC_GROUP.code,
+ SYNC_GROUP.serialize({
+ streamId: request.streamId,
+ topicId: request.topicId,
+ groupId: request.consumer.id,
+ }),
+ );
+ const assignment = SYNC_GROUP.deserialize(response);
+ if (assignment === null)
+ throw responseError(SYNC_GROUP.code, 5006);
Review Comment:
Error code 5006 is the right choice here: it matches the server's
`ConsumerGroupMemberNotFound` (`core/common/src/error/iggy_error.rs`), and
`core/common/src/traits/binary_impls/messages.rs` confirms a non-member must
surface 5006.
However, the SDK's translation table in `src/wire/error.code.ts` still maps
5006 to "Invalid file size", so anyone hitting this path gets a misleading
error message. Since this PR makes 5006 reachable from the SDK, it would be
worth relabeling it to "Consumer group member not found" in the same change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]