Git-Yang commented on a change in pull request #3671:
URL: https://github.com/apache/rocketmq/pull/3671#discussion_r774950441



##########
File path: broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
##########
@@ -296,14 +298,19 @@ public boolean initialize() throws 
CloneNotSupportedException {
 
         if (result) {
             try {
-                this.messageStore =
-                    new DefaultMessageStore(this.messageStoreConfig, 
this.brokerStatsManager, this.messageArrivingListener,
-                        this.brokerConfig);
+                MessageStore messageStore;
+                if (Objects.equals(CQType.BatchCQ.toString(), 
this.messageStoreConfig.getDefaultCQType())) {
+                    messageStore = new 
StreamMessageStore(this.messageStoreConfig, this.brokerStatsManager, 
this.messageArrivingListener, this.brokerConfig);
+                } else {
+                    messageStore = new 
DefaultMessageStore(this.messageStoreConfig, this.brokerStatsManager, 
this.messageArrivingListener, this.brokerConfig);
+                }
+
+                this.messageStore = messageStore;
                 if (messageStoreConfig.isEnableDLegerCommitLog()) {
                     DLedgerRoleChangeHandler roleChangeHandler = new 
DLedgerRoleChangeHandler(this, (DefaultMessageStore) messageStore);

Review comment:
       If BatchCQ is turned on, the type conversion here will be abnormal.




-- 
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]


Reply via email to