Repository: apache/rocketmq (Java)
Date: 2020-01-23 06:59:25+00:00
Task type: Refactoring

Issue:
rename takeMessags to takeMessages
**FEATURE REQUEST**

1. Please describe the feature you are requesting.

just rename function name, takeMessages is used internarlly, never influence user face

2. Provide any additional detail on your proposed use case for this feature.

2. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?

4. If there are some sub-tasks using -[] for each subtask and create a corresponding issue to map to the sub task:

- [sub-task1-issue-number](example_sub_issue1_link_here): sub-task1 description here, 
- [sub-task2-issue-number](example_sub_issue2_link_here): sub-task2 description here,
- ...



Issue discussion:

Solution patch:
diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageOrderlyService.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageOrderlyService.java
--- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageOrderlyService.java
+++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageOrderlyService.java
@@ -451,7 +451,7 @@ public void run() {
                         final int consumeBatchSize =
                             ConsumeMessageOrderlyService.this.defaultMQPushConsumer.getConsumeMessageBatchMaxSize();
 
-                        List<MessageExt> msgs = this.processQueue.takeMessags(consumeBatchSize);
+                        List<MessageExt> msgs = this.processQueue.takeMessages(consumeBatchSize);
                         defaultMQPushConsumerImpl.resetRetryAndNamespace(msgs, defaultMQPushConsumer.getConsumerGroup());
                         if (!msgs.isEmpty()) {
                             final ConsumeOrderlyContext context = new ConsumeOrderlyContext(this.messageQueue);
diff --git a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java
--- a/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java
+++ b/client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java
@@ -296,7 +296,7 @@ public void makeMessageToCosumeAgain(List<MessageExt> msgs) {
         }
     }
 
-    public List<MessageExt> takeMessags(final int batchSize) {
+    public List<MessageExt> takeMessages(final int batchSize) {
         List<MessageExt> result = new ArrayList<MessageExt>(batchSize);
         final long now = System.currentTimeMillis();
         try {


Test patch:
diff --git a/client/src/test/java/org/apache/rocketmq/client/impl/consumer/ProcessQueueTest.java b/client/src/test/java/org/apache/rocketmq/client/impl/consumer/ProcessQueueTest.java
--- a/client/src/test/java/org/apache/rocketmq/client/impl/consumer/ProcessQueueTest.java
+++ b/client/src/test/java/org/apache/rocketmq/client/impl/consumer/ProcessQueueTest.java
@@ -38,7 +38,7 @@ public void testCachedMessageCount() {
 
         assertThat(pq.getMsgCount().get()).isEqualTo(100);
 
-        pq.takeMessags(10);
+        pq.takeMessages(10);
         pq.commit();
 
         assertThat(pq.getMsgCount().get()).isEqualTo(90);
@@ -55,7 +55,7 @@ public void testCachedMessageSize() {
 
         assertThat(pq.getMsgSize().get()).isEqualTo(100 * 123);
 
-        pq.takeMessags(10);
+        pq.takeMessages(10);
         pq.commit();
 
         assertThat(pq.getMsgSize().get()).isEqualTo(90 * 123);
@@ -74,17 +74,17 @@ public void testFillProcessQueueInfo() {
 
         assertThat(processQueueInfo.getCachedMsgSizeInMiB()).isEqualTo(12);
 
-        pq.takeMessags(10000);
+        pq.takeMessages(10000);
         pq.commit();
         pq.fillProcessQueueInfo(processQueueInfo);
         assertThat(processQueueInfo.getCachedMsgSizeInMiB()).isEqualTo(10);
 
-        pq.takeMessags(10000);
+        pq.takeMessages(10000);
         pq.commit();
         pq.fillProcessQueueInfo(processQueueInfo);
         assertThat(processQueueInfo.getCachedMsgSizeInMiB()).isEqualTo(9);
 
-        pq.takeMessags(80000);
+        pq.takeMessages(80000);
         pq.commit();
         pq.fillProcessQueueInfo(processQueueInfo);
         assertThat(processQueueInfo.getCachedMsgSizeInMiB()).isEqualTo(0);