{"record":{"id":"ce377ed7d5fbfc81","repo":"apache/rocketmq","slug":"the-message-queue-is-not-in-assigned-list-message","errorCode":null,"errorMessage":"The message queue is not in assigned list, message queue: ","messagePattern":"The message queue is not in assigned list, message queue: ","errorType":"exception","errorClass":"MQClientException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultLitePullConsumerImpl.java","lineNumber":671,"sourceCode":"        }\n\n        return Collections.emptyList();\n    }\n\n    public void pause(Collection<MessageQueue> messageQueues) {\n        assignedMessageQueue.pause(messageQueues);\n    }\n\n    public void resume(Collection<MessageQueue> messageQueues) {\n        assignedMessageQueue.resume(messageQueues);\n    }\n\n    public synchronized void seek(MessageQueue messageQueue, long offset) throws MQClientException {\n        if (!assignedMessageQueue.getAssignedMessageQueues().contains(messageQueue)) {\n            if (subscriptionType == SubscriptionType.SUBSCRIBE) {\n                throw new MQClientException(\"The message queue is not in assigned list, may be rebalancing, message queue: \" + messageQueue, null);\n            } else {\n                throw new MQClientException(\"The message queue is not in assigned list, message queue: \" + messageQueue, null);\n            }\n        }\n        long minOffset = minOffset(messageQueue);\n        long maxOffset = maxOffset(messageQueue);\n        if (offset < minOffset || offset > maxOffset) {\n            throw new MQClientException(\"Seek offset illegal, seek offset = \" + offset + \", min offset = \" + minOffset + \", max offset = \" + maxOffset, null);\n        }\n        final Object objLock = messageQueueLock.fetchLockObject(messageQueue);\n        synchronized (objLock) {\n            clearMessageQueueInCache(messageQueue);\n\n            PullTaskImpl oldPullTaskImpl = this.taskTable.get(messageQueue);\n            if (oldPullTaskImpl != null) {\n                oldPullTaskImpl.tryInterrupt();\n                this.taskTable.remove(messageQueue);\n            }\n            assignedMessageQueue.setSeekOffset(messageQueue, offset);\n            if (!this.taskTable.containsKey(messageQueue)) {","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/client/src/main/java/org/apache/rocketmq/client/impl/consumer/DefaultLitePullConsumerImpl.java#L653-L689","documentation":"The ASSIGN-mode branch of the same seek() guard in DefaultLitePullConsumerImpl. With assign() (manual queue management, no rebalancing), a queue missing from the assigned list is a plain configuration mistake, so the message drops the \"may be rebalancing\" hint. Common causes are broker/topic/queueId mismatches between the MessageQueue you seek and the one you assigned.","triggerScenarios":"consumer.seek(new MessageQueue(topic, brokerName, queueId), offset) where that exact (topic, broker, queueId) triple was never passed to assign(); seeking a rebuilt MessageQueue object after re-assign.","commonSituations":"MessageQueue equality requires identical topic, brokerName and queueId — reconstructing it from a string or offset-store JSON with a different broker name silently misses the assignment.","solutions":["Reuse the exact MessageQueue objects you gave to assign() when seeking","Verify topic/brokerName/queueId match the assigned collection before seek","Re-assign with the full queue list if the queue legitimately should be present"],"exampleFix":"// before\nconsumer.seek(new MessageQueue(topic, \"broker-a\", 3), offset);\n\n// after\nMessageQueue target = assignedQueues.stream()\n    .filter(q -> q.getQueueId() == 3)\n    .findFirst().orElseThrow(() -> new IllegalStateException(\"queue 3 not assigned\"));\nconsumer.seek(target, offset);","handlingStrategy":"validation","validationCode":"boolean assigned = consumer.getAssignedMessageQueue().getAssignedMessageQueues().contains(messageQueue);\nif (!assigned) throw new IllegalArgumentException(\"queue not assigned: \" + messageQueue);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reuse the exact MessageQueue instances passed to assign(); equality needs identical topic+broker+queueId","Verify broker names when reconstructing MessageQueue from persisted state"],"tags":["rocketmq","consumer","seek","assign","validation"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}