You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/08/20 07:07:49 UTC

[GitHub] [rocketmq-spring] zhouhai22 opened a new pull request, #482: [ISSUE #481] Add defaultNamespace to both producer and consumer . (#481)

zhouhai22 opened a new pull request, #482:
URL: https://github.com/apache/rocketmq-spring/pull/482

   ## What is the purpose of the change
   
   Add defaultNamespace to both producer and consumer 
   
   ## Brief changelog
   
   prefer to use the namespace specified by annotation, or a defaultNamespace from property file will be used.


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] ShannonDing commented on a diff in pull request #482: [ISSUE #481] Add defaultNamespace to both producer and consumer . (#481)

Posted by GitBox <gi...@apache.org>.
ShannonDing commented on code in PR #482:
URL: https://github.com/apache/rocketmq-spring/pull/482#discussion_r953685729


##########
rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/RocketMQUtil.java:
##########
@@ -326,4 +326,10 @@ public static DefaultLitePullConsumer createDefaultLitePullConsumer(String nameS
 
         return litePullConsumer;
     }
+
+    public static String getNamespace(String specifiedNamespace, String defaultNamespace) {

Review Comment:
   if specifiedNamespace and defaultNamespace are both null. it need not to set name space to container.



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] ShannonDing merged pull request #482: [ISSUE #481] Add defaultNamespace to both producer and consumer . (#481)

Posted by GitBox <gi...@apache.org>.
ShannonDing merged PR #482:
URL: https://github.com/apache/rocketmq-spring/pull/482


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] zhouchunhai commented on a diff in pull request #482: [ISSUE #481] Add defaultNamespace to both producer and consumer . (#481)

Posted by GitBox <gi...@apache.org>.
zhouchunhai commented on code in PR #482:
URL: https://github.com/apache/rocketmq-spring/pull/482#discussion_r953744240


##########
rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/RocketMQUtil.java:
##########
@@ -326,4 +326,10 @@ public static DefaultLitePullConsumer createDefaultLitePullConsumer(String nameS
 
         return litePullConsumer;
     }
+
+    public static String getNamespace(String specifiedNamespace, String defaultNamespace) {

Review Comment:
   it's just for convenience, if rocketmq.producer.namespace or rocketmq.pushconsume.namespace is specified, then we don't need to specify in each producer or consumer. if they are both null, it has no effect.



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq-spring] duhenglucky commented on a diff in pull request #482: [ISSUE #481] Add defaultNamespace to both producer and consumer . (#481)

Posted by GitBox <gi...@apache.org>.
duhenglucky commented on code in PR #482:
URL: https://github.com/apache/rocketmq-spring/pull/482#discussion_r963311499


##########
rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/RocketMQUtil.java:
##########
@@ -326,4 +326,10 @@ public static DefaultLitePullConsumer createDefaultLitePullConsumer(String nameS
 
         return litePullConsumer;
     }
+
+    public static String getNamespace(String specifiedNamespace, String defaultNamespace) {
+        // prefer to use annotation namespace
+        // if is empty a default namespace will be used
+        return !StringUtils.hasLength(specifiedNamespace) && StringUtils.hasLength(defaultNamespace) ? defaultNamespace : specifiedNamespace;

Review Comment:
   How about using the _isBlank_ method to avoid the influence brought by whitespace?



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org