You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "imzs (via GitHub)" <gi...@apache.org> on 2025/12/16 10:09:27 UTC
[PR] [RIP-80] #1152 Implementation of Priority Message [rocketmq-clients]
imzs opened a new pull request, #1153:
URL: https://github.com/apache/rocketmq-clients/pull/1153
<!-- Please make sure the target branch is right. In most case, the target branch should be `master`. -->
### Which Issue(s) This PR Fixes
<!-- Please ensure that the related issue has already been created, and [link this pull request to that issue using keywords](<https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword>) to ensure automatic closure. -->
#1152
### Brief Description
<!-- Write a brief description for your pull request to help the maintainer understand the reasons behind your changes. -->
### How Did You Test This Change?
<!-- In order to ensure the code quality of Apache RocketMQ, we expect every pull request to have undergone thorough testing. -->
--
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
Re: [PR] [ISSUE #1152] [RIP-80] [Java] Implementation of Priority Message [rocketmq-clients]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #1153:
URL: https://github.com/apache/rocketmq-clients/pull/1153#discussion_r2650106364
##########
java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageViewImpl.java:
##########
@@ -68,7 +69,7 @@ public class MessageViewImpl implements MessageView {
public MessageViewImpl(MessageId messageId, String topic, byte[] body, String tag,
String messageGroup, String liteTopic,
- Long deliveryTimestamp, Collection<String> keys, Map<String, String> properties,
+ Long deliveryTimestamp, Integer priority, Collection<String> keys, Map<String, String> properties,
Review Comment:
应该新加一个构造函数的
--
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
Re: [PR] [ISSUE #1152] [RIP-80] [Java] Implementation of Priority Message [rocketmq-clients]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #1153:
URL: https://github.com/apache/rocketmq-clients/pull/1153#discussion_r2650092094
##########
java/client/src/main/java/org/apache/rocketmq/client/java/example/ProducerPriorityMessageExample.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.rocketmq.client.java.example;
+
+import java.nio.charset.StandardCharsets;
+import org.apache.rocketmq.client.apis.ClientException;
+import org.apache.rocketmq.client.apis.ClientServiceProvider;
+import org.apache.rocketmq.client.apis.message.Message;
+import org.apache.rocketmq.client.apis.producer.Producer;
+import org.apache.rocketmq.client.apis.producer.SendReceipt;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ProducerPriorityMessageExample {
+ private static final Logger log = LoggerFactory.getLogger(ProducerPriorityMessageExample.class);
+
+ private ProducerPriorityMessageExample() {
+ }
+
+ public static void main(String[] args) throws ClientException {
+ final ClientServiceProvider provider = ClientServiceProvider.loadService();
+
+ String topic = "yourPriorityTopic";
+ final Producer producer = ProducerSingleton.getInstance(topic);
+ // Define your message body.
+ byte[] body = "This is a delay message for Apache RocketMQ".getBytes(StandardCharsets.UTF_8);
+ String tag = "yourMessageTagA";
+ final Message message = provider.newMessageBuilder()
+ // Set topic for the current message.
+ .setTopic(topic)
+ // Message secondary classifier of message besides topic.
+ .setTag(tag)
+ // Key(s) of the message, another way to mark message besides message id.
+ .setKeys("yourMessageKey")
+ // Set priority of message.
+ .setPriority(1)
Review Comment:
Add the new feature to the capability set in readme.md
--
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
Re: [PR] [ISSUE #1152] [RIP-80] [Java] Implementation of Priority Message [rocketmq-clients]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on code in PR #1153:
URL: https://github.com/apache/rocketmq-clients/pull/1153#discussion_r2650106364
##########
java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageViewImpl.java:
##########
@@ -68,7 +69,7 @@ public class MessageViewImpl implements MessageView {
public MessageViewImpl(MessageId messageId, String topic, byte[] body, String tag,
String messageGroup, String liteTopic,
- Long deliveryTimestamp, Collection<String> keys, Map<String, String> properties,
+ Long deliveryTimestamp, Integer priority, Collection<String> keys, Map<String, String> properties,
Review Comment:
A new constructor should be added.
--
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
Re: [PR] [RIP-80] #1152 Implementation of Priority Message [rocketmq-clients]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1153:
URL: https://github.com/apache/rocketmq-clients/pull/1153#issuecomment-3659776594
## [Codecov](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `61.76471%` with `13 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 53.43%. Comparing base ([`4076e2b`](https://app.codecov.io/gh/apache/rocketmq-clients/commit/4076e2b1d9979079c228aa52bfc8fa6dd874fa3b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`57ce08d`](https://app.codecov.io/gh/apache/rocketmq-clients/commit/57ce08da0c9bdc495cc770652d97074e94ce5064?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 79 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...tmq/client/java/message/PublishingMessageImpl.java](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?src=pr&el=tree&filepath=java%2Fclient%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fclient%2Fjava%2Fmessage%2FPublishingMessageImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-amF2YS9jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL2NsaWVudC9qYXZhL21lc3NhZ2UvUHVibGlzaGluZ01lc3NhZ2VJbXBsLmphdmE=) | 0.00% | [4 Missing and 4 partials :warning: ](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ache/rocketmq/client/java/message/MessageImpl.java](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?src=pr&el=tree&filepath=java%2Fclient%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fclient%2Fjava%2Fmessage%2FMessageImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-amF2YS9jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL2NsaWVudC9qYXZhL21lc3NhZ2UvTWVzc2FnZUltcGwuamF2YQ==) | 60.00% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ache/rocketmq/client/java/message/MessageType.java](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?src=pr&el=tree&filepath=java%2Fclient%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fclient%2Fjava%2Fmessage%2FMessageType.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-amF2YS9jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL2NsaWVudC9qYXZhL21lc3NhZ2UvTWVzc2FnZVR5cGUuamF2YQ==) | 33.33% | [2 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [.../rocketmq/client/java/message/MessageViewImpl.java](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?src=pr&el=tree&filepath=java%2Fclient%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fclient%2Fjava%2Fmessage%2FMessageViewImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-amF2YS9jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL2NsaWVudC9qYXZhL21lc3NhZ2UvTWVzc2FnZVZpZXdJbXBsLmphdmE=) | 80.00% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #1153 +/- ##
============================================
+ Coverage 53.26% 53.43% +0.16%
- Complexity 651 751 +100
============================================
Files 208 216 +8
Lines 14303 14339 +36
Branches 5845 5567 -278
============================================
+ Hits 7619 7662 +43
+ Misses 6308 6276 -32
- Partials 376 401 +25
```
| [Flag](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [java](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `61.40% <61.76%> (-0.29%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/rocketmq-clients/pull/1153?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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
Re: [PR] [ISSUE #1152] [RIP-80] [Java] Implementation of Priority Message [rocketmq-clients]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins merged PR #1153:
URL: https://github.com/apache/rocketmq-clients/pull/1153
--
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