{"record":{"id":"4626812a92cddc79","repo":"apache/rocketmq","slug":"producergroup-can-not-equal-defaultproducergroup","errorCode":null,"errorMessage":"producerGroup can not equal {defaultProducerGroup}, please specify another one.","messagePattern":"producerGroup can not equal (.+?), please specify another one\\.","errorType":"validation","errorClass":"MQClientException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java","lineNumber":299,"sourceCode":"                throw new MQClientException(\"The producer service state not OK, maybe started once, \"\n                    + this.serviceState\n                    + FAQUrl.suggestTodo(FAQUrl.CLIENT_SERVICE_NOT_OK),\n                    null);\n            default:\n                break;\n        }\n\n        this.mQClientFactory.sendHeartbeatToAllBrokerWithLock();\n\n        RequestFutureHolder.getInstance().startScheduledTask(this);\n\n    }\n\n    private void checkConfig() throws MQClientException {\n        Validators.checkGroup(this.defaultMQProducer.getProducerGroup());\n\n        if (this.defaultMQProducer.getProducerGroup().equals(MixAll.DEFAULT_PRODUCER_GROUP)) {\n            throw new MQClientException(\"producerGroup can not equal \" + MixAll.DEFAULT_PRODUCER_GROUP + \", please specify another one.\",\n                null);\n        }\n    }\n\n    public void shutdown() {\n        this.shutdown(true);\n    }\n\n    public void shutdown(final boolean shutdownFactory) {\n        switch (this.serviceState) {\n            case CREATE_JUST:\n                break;\n            case RUNNING:\n                this.mQClientFactory.unregisterProducer(this.defaultMQProducer.getProducerGroup());\n                this.defaultAsyncSenderExecutor.shutdown();\n                if (shutdownFactory) {\n                    this.mQClientFactory.shutdown();\n                }","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/apache/rocketmq/blob/293f5885719fc4aa3619446a1900f58ccfcfdd29/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java#L281-L317","documentation":"MQClientException thrown by DefaultMQProducerImpl.checkConfig() during start() when the configured producerGroup equals the literal default \"DEFAULT_PRODUCER\" (MixAll.DEFAULT_PRODUCER_GROUP). RocketMQ forbids the sentinel value to force operators to pick a meaningful, unique group, since group names are used for metrics, alerting, and (for consumers) failover identity. Validators.checkGroup has already run, so an empty/invalid group fails earlier with a different message.","triggerScenarios":"new DefaultMQProducer() with the no-arg constructor followed by start(); explicitly setProducerGroup(\"DEFAULT_PRODUCER\") or setProducerGroup(\"\") after construction then start(); copying quickstart code that never sets a group.","commonSituations":"commonSituations","solutions":["Set a unique, application-specific group: new DefaultMQProducer(\"my-app-order-producer\") or setProducerGroup(...) before start()","If config is externalized, verify the resolved value at startup (log producer.getProducerGroup()) and fail fast in your own code if it is DEFAULT_PRODUCER","Follow naming conventions like <app>-<domain>-producer to avoid collisions across teams"],"exampleFix":"// before\nDefaultMQProducer producer = new DefaultMQProducer();\nproducer.start(); // throws\n// after\nDefaultMQProducer producer = new DefaultMQProducer(\"checkout-service-producer\");\nproducer.setNamesrvAddr(namesrv);\nproducer.start();","handlingStrategy":"validation","validationCode":" String group = props.getProperty(\"producer.group\", \"DEFAULT_PRODUCER\");\nif (\"DEFAULT_PRODUCER\".equals(group) || group.isBlank()) {\n    throw new ConfigurationException(\"producer.group must be set to a unique non-default value\");\n}\nDefaultMQProducer p = new DefaultMQProducer(group);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the group via constructor: new DefaultMQProducer(\"<app>-producer\")","Fail fast in bootstrap if the resolved group is DEFAULT_PRODUCER or blank","Add config-schema validation for producer group in your deployment pipeline","Use naming conventions (<app>-<domain>-producer) to keep groups unique and debuggable"],"tags":["rocketmq","producer","configuration","validation"],"backgroundTag":null,"analyzedSha":"293f5885719fc4aa3619446a1900f58ccfcfdd29","analyzedAt":"2026-08-14T11:50:13.822Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}