rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liu...@apache.org
Subject [rocketmq-spring] branch master updated: [ISSUE# 289] Use the default instance name when using acl (#290)
Date Wed, 12 Aug 2020 02:19:22 GMT
This is an automated email from the ASF dual-hosted git repository.

liurui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-spring.git


The following commit(s) were added to refs/heads/master by this push:
     new 8f24a5c  [ISSUE# 289] Use the default instance name when using acl (#290)
8f24a5c is described below

commit 8f24a5cd416e9ea39f76e8f105b6ec09feee96f8
Author: rongtong <jinrongtong5@163.com>
AuthorDate: Wed Aug 12 10:19:12 2020 +0800

    [ISSUE# 289] Use the default instance name when using acl (#290)
    
    * chore(consumer): Use the default instance name when using acl
    
    * chore(version): update example rocketmq version to 2.1.2-SNAPSHOT
---
 rocketmq-spring-boot-samples/pom.xml                         |  2 +-
 .../spring/support/DefaultRocketMQListenerContainer.java     |  1 -
 .../org/apache/rocketmq/spring/support/RocketMQUtil.java     | 12 ------------
 .../org/apache/rocketmq/spring/support/RocketMQUtilTest.java | 10 ----------
 4 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/rocketmq-spring-boot-samples/pom.xml b/rocketmq-spring-boot-samples/pom.xml
index ca74d54..52ee175 100644
--- a/rocketmq-spring-boot-samples/pom.xml
+++ b/rocketmq-spring-boot-samples/pom.xml
@@ -24,7 +24,7 @@
     <groupId>org.apache.rocketmq</groupId>
     <artifactId>rocketmq-spring-boot-samples</artifactId>
     <packaging>pom</packaging>
-    <version>2.1.1-SNAPSHOT</version>
+    <version>2.1.2-SNAPSHOT</version>
     
     <name>RocketMQ Spring Boot Samples</name>
     <description>Samples for RocketMQ Spring Boot</description>
diff --git a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java
b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java
index 2642d07..dff5e0c 100644
--- a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java
+++ b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java
@@ -555,7 +555,6 @@ public class DefaultRocketMQListenerContainer implements InitializingBean,
                 enableMsgTrace, this.applicationContext.getEnvironment().
                 resolveRequiredPlaceholders(this.rocketMQMessageListener.customizedTraceTopic()));
             consumer.setVipChannelEnabled(false);
-            consumer.setInstanceName(RocketMQUtil.getInstanceName(rpcHook, consumerGroup));
         } else {
             log.debug("Access-key or secret-key not configure in " + this + ".");
             consumer = new DefaultMQPushConsumer(consumerGroup, enableMsgTrace,
diff --git a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/RocketMQUtil.java
b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/RocketMQUtil.java
index 712323e..311e5e5 100644
--- a/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/RocketMQUtil.java
+++ b/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/RocketMQUtil.java
@@ -31,7 +31,6 @@ import org.apache.rocketmq.client.producer.TransactionMQProducer;
 import org.apache.rocketmq.client.trace.AsyncTraceDispatcher;
 import org.apache.rocketmq.client.trace.TraceDispatcher;
 import org.apache.rocketmq.client.trace.hook.SendMessageTraceHookImpl;
-import org.apache.rocketmq.common.UtilAll;
 import org.apache.rocketmq.common.message.Message;
 import org.apache.rocketmq.common.message.MessageConst;
 import org.apache.rocketmq.common.message.MessageExt;
@@ -244,17 +243,6 @@ public class RocketMQUtil {
         return null;
     }
 
-    public static String getInstanceName(RPCHook rpcHook, String identify) {
-        String separator = "|";
-        StringBuilder instanceName = new StringBuilder();
-        SessionCredentials sessionCredentials = ((AclClientRPCHook) rpcHook).getSessionCredentials();
-        instanceName.append(sessionCredentials.getAccessKey())
-            .append(separator).append(sessionCredentials.getSecretKey())
-            .append(separator).append(identify)
-            .append(separator).append(UtilAll.getPid());
-        return instanceName.toString();
-    }
-
     public static DefaultMQProducer createDefaultMQProducer(String groupName, String ak,
String sk,
         boolean isEnableMsgTrace, String customizedTraceTopic) {
 
diff --git a/rocketmq-spring-boot/src/test/java/org/apache/rocketmq/spring/support/RocketMQUtilTest.java
b/rocketmq-spring-boot/src/test/java/org/apache/rocketmq/spring/support/RocketMQUtilTest.java
index 41b0922..42439ad 100644
--- a/rocketmq-spring-boot/src/test/java/org/apache/rocketmq/spring/support/RocketMQUtilTest.java
+++ b/rocketmq-spring-boot/src/test/java/org/apache/rocketmq/spring/support/RocketMQUtilTest.java
@@ -130,14 +130,4 @@ public class RocketMQUtilTest {
         assertEquals("tagA", message.getHeaders().get(toRocketHeaderKey(RocketMQHeaders.TAGS)));
         assertEquals("key1", message.getHeaders().get(toRocketHeaderKey(RocketMQHeaders.KEYS)));
     }
-
-    @Test
-    public void testGetInstanceName() {
-        String ak = "ak";
-        String sk = "sk";
-        String consumerGroup = "consumerGroup";
-        RPCHook rpcHook = new AclClientRPCHook(new SessionCredentials(ak, sk));
-        String expected = "ak|sk|consumerGroup|";
-        assertEquals(expected + UtilAll.getPid(), RocketMQUtil.getInstanceName(rpcHook, consumerGroup));
-    }
 }
\ No newline at end of file


Mime
View raw message