{"record":{"id":"cc87473568aeb632","repo":"alibaba/spring-cloud-alibaba","slug":"group-must-be-configured-for-dlq-topic","errorCode":null,"errorMessage":"group must be configured for DLQ{topic}","messagePattern":"group must be configured for DLQ(.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"spring-cloud-alibaba-starters/spring-cloud-starter-stream-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/integration/inbound/RocketMQConsumerFactory.java","lineNumber":125,"sourceCode":"\n\t/**\n\t * todo Compatible with versions less than 4.6 ?\n\t * @param topic consumer topic.\n\t * @param extendedConsumerProperties extendedConsumerProperties\n\t * @return DefaultLitePullConsumer\n\t */\n\tpublic static DefaultLitePullConsumer initPullConsumer(\n\t\t\tString topic,\n\t\t\tExtendedConsumerProperties<RocketMQConsumerProperties> extendedConsumerProperties) {\n\t\tRocketMQConsumerProperties consumerProperties = extendedConsumerProperties\n\t\t\t\t.getExtension();\n\t\tboolean anonymous = !StringUtils.hasLength(consumerProperties.getGroup());\n\t\t/***\n\t\t * \tWhen using DLQ, at least the group property must be provided for proper naming of the DLQ destination\n\t\t *  According to https://docs.spring.io/spring-cloud-stream/docs/3.2.1/reference/html/spring-cloud-stream.html#spring-cloud-stream-reference\n\t\t */\n\t\tif (anonymous && NamespaceUtil.isDLQTopic(topic)) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"group must be configured for DLQ\" + topic);\n\t\t}\n\t\tif (anonymous) {\n\t\t\tconsumerProperties.setGroup(RocketMQUtils.anonymousGroup(topic));\n\t\t}\n\t\tString consumerGroup = Objects.requireNonNull(consumerProperties.getGroup());\n\n\t\tAssert.notNull(consumerProperties.getNameServer(),\n\t\t\t\t\"Property 'nameServer' is required\");\n\t\tAllocateMessageQueueStrategy allocateMessageQueueStrategy = RocketMQBeanContainerCache\n\t\t\t\t.getBean(consumerProperties.getAllocateMessageQueueStrategy(),\n\t\t\t\t\t\tAllocateMessageQueueStrategy.class);\n\n\t\tRPCHook rpcHook = null;\n\t\tif (StringUtils.hasLength(consumerProperties.getAccessKey())\n\t\t\t\t&& StringUtils.hasLength(consumerProperties.getSecretKey())) {\n\t\t\trpcHook = new AclClientRPCHook(\n\t\t\t\t\tnew SessionCredentials(consumerProperties.getAccessKey(),","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/alibaba/spring-cloud-alibaba/blob/115d5901102009492e05d5ec18c3f79cad4077d0/spring-cloud-alibaba-starters/spring-cloud-starter-stream-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/integration/inbound/RocketMQConsumerFactory.java#L107-L143","documentation":"Same DLQ/group rule as [121] but enforced in RocketMQConsumerFactory.initPullConsumer for the pull (pollable) consumer path. Without a group, RocketMQ cannot name the DLQ consumer group, so the factory aborts construction of the DefaultLitePullConsumer.","triggerScenarios":"A pull/pollable input binding whose consumerProperties group is empty AND whose topic is a `%DLQ%` topic (NamespaceUtil.isDLQTopic true).","commonSituations":"Using a pollable source against a DLQ topic without `group`; replay tooling that omits the group.","solutions":["Set `spring.cloud.stream.rocketmq.bindings.<input>.consumer.group=<id>` (or the generic `bindings.<input>.group`).","Re-check the topic name to ensure it is genuinely a DLQ destination; if not, drop the `%DLQ%` prefix.","Confirm the pull consumer actually needs DLQ; otherwise consume the source topic."],"exampleFix":"// before - pollable source on DLQ, no group\nspring:\n  cloud:\n    stream:\n      bindings:\n        dlqPoll:\n          destination: '%DLQ%myGroup'\n          consumer:\n            # pull/pollable, group missing -> [122]\n# after\nspring:\n  cloud:\n    stream:\n      bindings:\n        dlqPoll:\n          destination: '%DLQ%myGroup'\n          group: my-dlq-pull-group","handlingStrategy":"validation","validationCode":"// Guard before calling initPullConsumer.\nboolean anonymous = !StringUtils.hasLength(consumerProperties.getGroup());\nif (anonymous && org.apache.rocketmq.common.namespace.NamespaceUtil.isDLQTopic(topic)) {\n    throw new IllegalStateException(\"Pull consumer on DLQ requires a group\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pollable/DLQ consumers always need an explicit group.","Validate topic naming before passing it to the consumer factory.","Keep DLQ replay tooling group-aware."],"tags":["rocketmq","spring-cloud-stream","dlq","consumer","pull"],"backgroundTag":null,"analyzedSha":"115d5901102009492e05d5ec18c3f79cad4077d0","analyzedAt":"2026-08-14T04:47:13.900Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}