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/05/16 05:23:12 UTC

[GitHub] [rocketmq] li-xiao-shuang opened a new pull request, #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr

li-xiao-shuang opened a new pull request, #4324:
URL: https://github.com/apache/rocketmq/pull/4324

   fix : #4323 
   
   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   XXXXX
   
   ## Brief changelog
   
   XX
   
   ## Verifying this change
   
   XXXX
   
   Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. 
   - [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
   - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test`  to make sure integration-test pass.
   - [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
   


-- 
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] codecov-commenter commented on pull request #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #4324:
URL: https://github.com/apache/rocketmq/pull/4324#issuecomment-1127247571

   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/4324?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#4324](https://codecov.io/gh/apache/rocketmq/pull/4324?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (381a498) into [develop](https://codecov.io/gh/apache/rocketmq/commit/a28dc651dcd1b250cb50ee29f036e04e97d8c3b8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a28dc65) will **decrease** coverage by `0.14%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #4324      +/-   ##
   =============================================
   - Coverage      48.15%   48.00%   -0.15%     
   + Complexity      5076     5061      -15     
   =============================================
     Files            642      642              
     Lines          42767    42767              
     Branches        5598     5598              
   =============================================
   - Hits           20595    20531      -64     
   - Misses         19659    19720      +61     
   - Partials        2513     2516       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/4324?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...rocketmq/broker/filtersrv/FilterServerManager.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvZmlsdGVyc3J2L0ZpbHRlclNlcnZlck1hbmFnZXIuamF2YQ==) | `20.00% <0.00%> (-14.29%)` | :arrow_down: |
   | [...org/apache/rocketmq/store/ha/WaitNotifyObject.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2hhL1dhaXROb3RpZnlPYmplY3QuamF2YQ==) | `66.07% <0.00%> (-7.15%)` | :arrow_down: |
   | [...apache/rocketmq/remoting/netty/ResponseFuture.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL25ldHR5L1Jlc3BvbnNlRnV0dXJlLmphdmE=) | `85.00% <0.00%> (-5.00%)` | :arrow_down: |
   | [...ache/rocketmq/common/stats/MomentStatsItemSet.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vc3RhdHMvTW9tZW50U3RhdHNJdGVtU2V0LmphdmE=) | `39.13% <0.00%> (-4.35%)` | :arrow_down: |
   | [...rocketmq/remoting/netty/NettyRemotingAbstract.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL25ldHR5L05ldHR5UmVtb3RpbmdBYnN0cmFjdC5qYXZh) | `47.08% <0.00%> (-4.02%)` | :arrow_down: |
   | [...e/rocketmq/remoting/netty/NettyRemotingClient.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3JlbW90aW5nL25ldHR5L05ldHR5UmVtb3RpbmdDbGllbnQuamF2YQ==) | `43.50% <0.00%> (-3.11%)` | :arrow_down: |
   | [...org/apache/rocketmq/common/stats/StatsItemSet.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vc3RhdHMvU3RhdHNJdGVtU2V0LmphdmE=) | `41.79% <0.00%> (-2.99%)` | :arrow_down: |
   | [...ava/org/apache/rocketmq/filter/util/BitsArray.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9maWx0ZXIvdXRpbC9CaXRzQXJyYXkuamF2YQ==) | `59.82% <0.00%> (-2.57%)` | :arrow_down: |
   | [...va/org/apache/rocketmq/logging/inner/Appender.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bG9nZ2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbG9nZ2luZy9pbm5lci9BcHBlbmRlci5qYXZh) | `34.83% <0.00%> (-2.25%)` | :arrow_down: |
   | [...a/org/apache/rocketmq/filter/util/BloomFilter.java](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9maWx0ZXIvdXRpbC9CbG9vbUZpbHRlci5qYXZh) | `60.43% <0.00%> (-2.20%)` | :arrow_down: |
   | ... and [12 more](https://codecov.io/gh/apache/rocketmq/pull/4324/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq/pull/4324?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/rocketmq/pull/4324?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a28dc65...381a498](https://codecov.io/gh/apache/rocketmq/pull/4324?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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] odbozhou commented on a diff in pull request #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr

Posted by GitBox <gi...@apache.org>.
odbozhou commented on code in PR #4324:
URL: https://github.com/apache/rocketmq/pull/4324#discussion_r876639381


##########
example/src/main/java/org/apache/rocketmq/example/rpc/RequestProducer.java:
##########
@@ -23,23 +23,28 @@
 import org.apache.rocketmq.remoting.common.RemotingHelper;
 
 public class RequestProducer {
+    public static final String PRODUCER_GROUP = "please_rename_unique_group_name";
+    public static final String DEFAULT_NAMESRVADDR = "127.0.0.1:9876";
+    public static final String TOPIC = "RequestTopic";
+    public static final String TAG = "Tag";
+    public static final long TTL = 3000L;
+
     public static void main(String[] args) throws MQClientException, InterruptedException {
-        String producerGroup = "please_rename_unique_group_name";
-        String topic = "RequestTopic";
-        long ttl = 3000;
 
-        DefaultMQProducer producer = new DefaultMQProducer(producerGroup);
+        DefaultMQProducer producer = new DefaultMQProducer(PRODUCER_GROUP);
+        //You need to set namesrvAddr to the address of the local namesrv
+        producer.setNamesrvAddr(DEFAULT_NAMESRVADDR);

Review Comment:
   May cause the official website quick start to set namesrv through the command line to fail.
   
   ![image](https://user-images.githubusercontent.com/14222167/169222247-c94c3a0d-2a74-4a72-9253-afdaf04e313c.png)
   



##########
example/src/main/java/org/apache/rocketmq/example/rpc/AsyncRequestProducer.java:
##########
@@ -28,36 +28,40 @@
 public class AsyncRequestProducer {
     private static final InternalLogger log = ClientLogger.getLog();
 
+    public static final String PRODUCER_GROUP = "please_rename_unique_group_name";
+    public static final String DEFAULT_NAMESRVADDR = "127.0.0.1:9876";
+    public static final String TOPIC = "RequestTopic";
+    public static final String TAG = "Tag";
+    public static final long TTL = 3000L;
+
     public static void main(String[] args) throws MQClientException, InterruptedException {
-        String producerGroup = "please_rename_unique_group_name";
-        String topic = "RequestTopic";
-        long ttl = 3000;
 
-        DefaultMQProducer producer = new DefaultMQProducer(producerGroup);
+        DefaultMQProducer producer = new DefaultMQProducer(PRODUCER_GROUP);
+        //You need to set namesrvAddr to the address of the local namesrv
+        producer.setNamesrvAddr(DEFAULT_NAMESRVADDR);

Review Comment:
   May cause the official website quick start to set namesrv through the command line to fail.
   
   ![image](https://user-images.githubusercontent.com/14222167/169222247-c94c3a0d-2a74-4a72-9253-afdaf04e313c.png)
   



##########
example/src/main/java/org/apache/rocketmq/example/rpc/ResponseConsumer.java:
##########
@@ -33,46 +31,50 @@
 import org.apache.rocketmq.remoting.exception.RemotingException;
 
 public class ResponseConsumer {
+
+    public static final String PRODUCER_GROUP = "please_rename_unique_group_name";
+    public static final String CONSUMER_GROUP = "please_rename_unique_group_name";
+    public static final String DEFAULT_NAMESRVADDR = "127.0.0.1:9876";
+    public static final String TOPIC = "RequestTopic";
+
     public static void main(String[] args) throws InterruptedException, MQClientException {
-        String producerGroup = "please_rename_unique_group_name";
-        String consumerGroup = "please_rename_unique_group_name";
-        String topic = "RequestTopic";
 
         // create a producer to send reply message
-        DefaultMQProducer replyProducer = new DefaultMQProducer(producerGroup);
+        DefaultMQProducer replyProducer = new DefaultMQProducer(PRODUCER_GROUP);
+        // You need to set namesrvAddr to the address of the local namesrv
+        replyProducer.setNamesrvAddr(DEFAULT_NAMESRVADDR);

Review Comment:
   May cause the official website quick start to set namesrv through the command line to fail.
   
   ![image](https://user-images.githubusercontent.com/14222167/169222247-c94c3a0d-2a74-4a72-9253-afdaf04e313c.png)
   



##########
example/src/main/java/org/apache/rocketmq/example/rpc/ResponseConsumer.java:
##########
@@ -33,46 +31,50 @@
 import org.apache.rocketmq.remoting.exception.RemotingException;
 
 public class ResponseConsumer {
+
+    public static final String PRODUCER_GROUP = "please_rename_unique_group_name";
+    public static final String CONSUMER_GROUP = "please_rename_unique_group_name";
+    public static final String DEFAULT_NAMESRVADDR = "127.0.0.1:9876";
+    public static final String TOPIC = "RequestTopic";
+
     public static void main(String[] args) throws InterruptedException, MQClientException {
-        String producerGroup = "please_rename_unique_group_name";
-        String consumerGroup = "please_rename_unique_group_name";
-        String topic = "RequestTopic";
 
         // create a producer to send reply message
-        DefaultMQProducer replyProducer = new DefaultMQProducer(producerGroup);
+        DefaultMQProducer replyProducer = new DefaultMQProducer(PRODUCER_GROUP);
+        // You need to set namesrvAddr to the address of the local namesrv
+        replyProducer.setNamesrvAddr(DEFAULT_NAMESRVADDR);
         replyProducer.start();
 
         // create consumer
-        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(consumerGroup);
+        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(CONSUMER_GROUP);
+        // You need to set namesrvAddr to the address of the local namesrv
+        consumer.setNamesrvAddr(DEFAULT_NAMESRVADDR);
         consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_LAST_OFFSET);

Review Comment:
   May cause the official website quick start to set namesrv through the command line to fail.
   
   ![image](https://user-images.githubusercontent.com/14222167/169222247-c94c3a0d-2a74-4a72-9253-afdaf04e313c.png)
   



-- 
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] coveralls commented on pull request #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr

Posted by GitBox <gi...@apache.org>.
coveralls commented on PR #4324:
URL: https://github.com/apache/rocketmq/pull/4324#issuecomment-1127250287

   
   [![Coverage Status](https://coveralls.io/builds/49136205/badge)](https://coveralls.io/builds/49136205)
   
   Coverage decreased (-0.2%) to 52.073% when pulling **381a498964d845cd2d7a75ed91741e2599f8dcf2 on li-xiao-shuang:feature_example_2** into **7982c9c09a9da754f42d0cf46dd5ddaa9d2c7be1 on apache:develop**.
   


-- 
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] coveralls commented on pull request #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr

Posted by GitBox <gi...@apache.org>.
coveralls commented on PR #4324:
URL: https://github.com/apache/rocketmq/pull/4324#issuecomment-1127250290

   
   [![Coverage Status](https://coveralls.io/builds/49136205/badge)](https://coveralls.io/builds/49136205)
   
   Coverage decreased (-0.2%) to 52.073% when pulling **381a498964d845cd2d7a75ed91741e2599f8dcf2 on li-xiao-shuang:feature_example_2** into **7982c9c09a9da754f42d0cf46dd5ddaa9d2c7be1 on apache:develop**.
   


-- 
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] github-actions[bot] commented on pull request #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4324:
URL: https://github.com/apache/rocketmq/pull/4324#issuecomment-1696585753

   This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR.


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

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


[GitHub] [rocketmq] github-actions[bot] commented on pull request #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4324:
URL: https://github.com/apache/rocketmq/pull/4324#issuecomment-1701931803

   This PR was closed because it has been inactive for 3 days since being marked as stale.


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

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


[GitHub] [rocketmq] github-actions[bot] closed pull request #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #4324: [ISSUE #4323] Rpc example add the default NamesrvAddr
URL: https://github.com/apache/rocketmq/pull/4324


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

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