You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by aa...@apache.org on 2022/06/25 15:13:40 UTC
[rocketmq-clients] branch temp created (now 3472362)
This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a change to branch temp
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
at 3472362 WiP
This branch includes the following new commits:
new 39151b8 Java: update file structure
new e69b9e2 Java: add more comments
new f76b7a6 Fix typos
new 3472362 WiP
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[rocketmq-clients] 02/04: Java: add more comments
Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a commit to branch temp
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
commit e69b9e284f0318c3e40ccf175f9fa294d02c516c
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Thu Jun 23 18:48:29 2022 +0800
Java: add more comments
---
java/README.md | 2 +-
.../rocketmq/client/java/hook/MessageInterceptor.java | 17 +++++++++++++++++
.../rocketmq/client/java/message/MessageCommon.java | 8 +++++++-
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/java/README.md b/java/README.md
index e02f800..2d19ec1 100644
--- a/java/README.md
+++ b/java/README.md
@@ -1,4 +1,4 @@
-# RocketMQ Clients for Java
+# RocketMQ Client for Java
[](https://github.com/apache/rocketmq-clients/actions/workflows/java_build.yml)
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/hook/MessageInterceptor.java b/java/client/src/main/java/org/apache/rocketmq/client/java/hook/MessageInterceptor.java
index c03c21b..ad717c0 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/hook/MessageInterceptor.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/hook/MessageInterceptor.java
@@ -21,9 +21,26 @@ import java.time.Duration;
import java.util.List;
import org.apache.rocketmq.client.java.message.MessageCommon;
+/**
+ * Message interceptor based on {@link MessageHookPoints}.
+ */
public interface MessageInterceptor {
+ /**
+ * Do something before {@link MessageHookPoints}.
+ *
+ * @param messageHookPoints message hook points.
+ * @param messageCommons list of message commons.
+ */
void doBefore(MessageHookPoints messageHookPoints, List<MessageCommon> messageCommons);
+ /**
+ * Do something after {@link MessageHookPoints}.
+ *
+ * @param messageHookPoints message hook points.
+ * @param messageCommons list of message commons.
+ * @param duration duration of the hook points.
+ * @param status status of operation of the hook points.
+ */
void doAfter(MessageHookPoints messageHookPoints, List<MessageCommon> messageCommons, Duration duration,
MessageHookPointsStatus status);
}
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageCommon.java b/java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageCommon.java
index 737e878..a700436 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageCommon.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageCommon.java
@@ -26,8 +26,13 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
+import org.apache.rocketmq.client.apis.message.Message;
import org.apache.rocketmq.client.apis.message.MessageId;
+import org.apache.rocketmq.client.apis.message.MessageView;
+/**
+ * Abstract common structure of {@link Message} and {@link MessageView}.
+ */
public class MessageCommon {
@Nullable
private final MessageId messageId;
@@ -74,7 +79,8 @@ public class MessageCommon {
Map<String, String> properties, @Nullable String tag, Collection<String> keys,
@Nullable String messageGroup, @Nullable Long deliveryTimestamp, @Nullable String bornHost,
@Nullable String parentTraceContext, @Nullable String traceContext, @Nullable Long bornTimestamp,
- @Nullable Integer deliveryAttempt, @Nullable Stopwatch decodeStopwatch, Timestamp deliveryTimestampFromRemote) {
+ @Nullable Integer deliveryAttempt, @Nullable Stopwatch decodeStopwatch,
+ @Nullable Timestamp deliveryTimestampFromRemote) {
this.messageId = messageId;
this.topic = topic;
this.body = body;
[rocketmq-clients] 01/04: Java: update file structure
Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a commit to branch temp
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
commit 39151b84e17b72a8e99110641e6f95027b332f6e
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Thu Jun 23 17:42:00 2022 +0800
Java: update file structure
---
.../rocketmq/client/java/{ => impl}/ClientServiceProviderImpl.java | 2 +-
.../main/java/org/apache/rocketmq/client/java/{ => impl}/UserAgent.java | 2 +-
.../apache/rocketmq/client/java/impl/consumer/PushConsumerSettings.java | 2 +-
.../rocketmq/client/java/impl/consumer/SimpleConsumerSettings.java | 2 +-
.../org/apache/rocketmq/client/java/impl/producer/ProducerSettings.java | 2 +-
.../services/org.apache.rocketmq.client.apis.ClientServiceProvider | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/ClientServiceProviderImpl.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientServiceProviderImpl.java
similarity index 97%
rename from java/client/src/main/java/org/apache/rocketmq/client/java/ClientServiceProviderImpl.java
rename to java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientServiceProviderImpl.java
index e85373f..c7576e2 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/ClientServiceProviderImpl.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientServiceProviderImpl.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.rocketmq.client.java;
+package org.apache.rocketmq.client.java.impl;
import org.apache.rocketmq.client.apis.ClientServiceProvider;
import org.apache.rocketmq.client.apis.consumer.PushConsumerBuilder;
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/UserAgent.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/UserAgent.java
similarity index 97%
rename from java/client/src/main/java/org/apache/rocketmq/client/java/UserAgent.java
rename to java/client/src/main/java/org/apache/rocketmq/client/java/impl/UserAgent.java
index 138f49c..872127b 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/UserAgent.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/UserAgent.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.rocketmq.client.java;
+package org.apache.rocketmq.client.java.impl;
import apache.rocketmq.v2.Language;
import apache.rocketmq.v2.UA;
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerSettings.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerSettings.java
index b9e97a5..4218424 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerSettings.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerSettings.java
@@ -30,9 +30,9 @@ import java.util.List;
import java.util.Map;
import org.apache.rocketmq.client.apis.consumer.FilterExpression;
import org.apache.rocketmq.client.apis.consumer.FilterExpressionType;
-import org.apache.rocketmq.client.java.UserAgent;
import org.apache.rocketmq.client.java.impl.ClientSettings;
import org.apache.rocketmq.client.java.impl.ClientType;
+import org.apache.rocketmq.client.java.impl.UserAgent;
import org.apache.rocketmq.client.java.message.protocol.Resource;
import org.apache.rocketmq.client.java.retry.CustomizedBackoffRetryPolicy;
import org.apache.rocketmq.client.java.retry.ExponentialBackoffRetryPolicy;
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/SimpleConsumerSettings.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/SimpleConsumerSettings.java
index 0117237..d357cdf 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/SimpleConsumerSettings.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/SimpleConsumerSettings.java
@@ -29,9 +29,9 @@ import java.util.List;
import java.util.Map;
import org.apache.rocketmq.client.apis.consumer.FilterExpression;
import org.apache.rocketmq.client.apis.consumer.FilterExpressionType;
-import org.apache.rocketmq.client.java.UserAgent;
import org.apache.rocketmq.client.java.impl.ClientSettings;
import org.apache.rocketmq.client.java.impl.ClientType;
+import org.apache.rocketmq.client.java.impl.UserAgent;
import org.apache.rocketmq.client.java.message.protocol.Resource;
import org.apache.rocketmq.client.java.route.Endpoints;
import org.slf4j.Logger;
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/producer/ProducerSettings.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/producer/ProducerSettings.java
index 9445b30..c29d5e7 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/producer/ProducerSettings.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/producer/ProducerSettings.java
@@ -24,9 +24,9 @@ import com.google.protobuf.util.Durations;
import java.time.Duration;
import java.util.Set;
import java.util.stream.Collectors;
-import org.apache.rocketmq.client.java.UserAgent;
import org.apache.rocketmq.client.java.impl.ClientSettings;
import org.apache.rocketmq.client.java.impl.ClientType;
+import org.apache.rocketmq.client.java.impl.UserAgent;
import org.apache.rocketmq.client.java.message.protocol.Resource;
import org.apache.rocketmq.client.java.retry.ExponentialBackoffRetryPolicy;
import org.apache.rocketmq.client.java.route.Endpoints;
diff --git a/java/client/src/main/resources/META-INF/services/org.apache.rocketmq.client.apis.ClientServiceProvider b/java/client/src/main/resources/META-INF/services/org.apache.rocketmq.client.apis.ClientServiceProvider
index 69f1fc5..5b9c3ad 100644
--- a/java/client/src/main/resources/META-INF/services/org.apache.rocketmq.client.apis.ClientServiceProvider
+++ b/java/client/src/main/resources/META-INF/services/org.apache.rocketmq.client.apis.ClientServiceProvider
@@ -1 +1 @@
-org.apache.rocketmq.client.java.ClientServiceProviderImpl
\ No newline at end of file
+org.apache.rocketmq.client.java.impl.ClientServiceProviderImpl
\ No newline at end of file
[rocketmq-clients] 04/04: WiP
Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a commit to branch temp
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
commit 34723623928ba046554f5199c9c5eee3633f2ecd
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Thu Jun 23 20:08:14 2022 +0800
WiP
---
docs/artwork/client_schedule_task.png | Bin 0 -> 291150 bytes
docs/artwork/client_startup.png | Bin 0 -> 469037 bytes
docs/artwork/message_types_and_topic_types.png | Bin 0 -> 598707 bytes
docs/artwork/unified_apis_and_spec.png | Bin 0 -> 119393 bytes
docs/design.md | 76 +++++++++++++++++++++
docs/message_id.md | 4 +-
docs/workflow.md | 41 +++++++++++
java/README.md | 34 ++++-----
.../client/java/impl/ClientManagerImpl.java | 8 +--
.../client/java/impl/consumer/ConsumerImpl.java | 45 ++++--------
.../client/java/impl/consumer/ProcessQueue.java | 50 +++++++++-----
.../java/impl/consumer/ProcessQueueImpl.java | 2 +-
.../java/impl/consumer/SimpleConsumerImpl.java | 2 +-
.../client/java/message/MessageIdCodec.java | 2 +-
.../java/impl/consumer/ProcessQueueImplTest.java | 4 +-
15 files changed, 190 insertions(+), 78 deletions(-)
diff --git a/docs/artwork/client_schedule_task.png b/docs/artwork/client_schedule_task.png
new file mode 100644
index 0000000..f6d6388
Binary files /dev/null and b/docs/artwork/client_schedule_task.png differ
diff --git a/docs/artwork/client_startup.png b/docs/artwork/client_startup.png
new file mode 100644
index 0000000..afdcf70
Binary files /dev/null and b/docs/artwork/client_startup.png differ
diff --git a/docs/artwork/message_types_and_topic_types.png b/docs/artwork/message_types_and_topic_types.png
new file mode 100644
index 0000000..e9fbfed
Binary files /dev/null and b/docs/artwork/message_types_and_topic_types.png differ
diff --git a/docs/artwork/unified_apis_and_spec.png b/docs/artwork/unified_apis_and_spec.png
new file mode 100644
index 0000000..9b471fc
Binary files /dev/null and b/docs/artwork/unified_apis_and_spec.png differ
diff --git a/docs/design.md b/docs/design.md
new file mode 100644
index 0000000..049ee12
--- /dev/null
+++ b/docs/design.md
@@ -0,0 +1,76 @@
+# Design
+
+This project aims to build lightweight, cloud-native clients, and establish the unified messaging model/APIs design acorss languages.
+
+## Messaging Model
+
+We assume that you are familiar with the basic concepts and terminologies about Apache RocketMQ. Therefore, we will not go into details about that.
+
+### Message/Topic Types
+
+In order to adapt different scenarios, we defined different types for messages to publish.
+
+* **FIFO**(First In, First Out): follows standard [FIFO](https://en.wikipedia.org/wiki/FIFO) semantics, this type of message must set the `message group`. This type of message need to be used with FIFO consumer group, which gurantees that the message must be received first if the it is published first with the same message group.
+* **DELAY**: the message about to be sent is not immediately visible to the consumer, this type of message must set the `delivery timestamp`, which decides the visible time to consumers;
+* **TRANSACTIONAL**: wrap the publishing of one or more messages into a transaction, provide commit/rollback method to decide the visibility of messages;
+* **NORMAL**: default type, which means the message is normal type if it does not belong to the other types above.
+
+The different types are mutually exclusive, when means that the message to publish could not be both FIFO type and DELAY type at the same time. Actually the type of the message is bound to the topic type in, and the type of the topic determines the type of the message. For example, FIFO topic do not allow the publishing of other types of messages.
+
+<div align="center">
+<img src="./artwork/message_types_and_topic_types.png" width="50%">
+</div>
+
+### Consumer Group
+
+As we all know, consumer group is the basic unit of load balancing for consumers. Messages are evenly distributed to all consumers in the same consumer group. Now, we assigned more attributes to consumer group rather than the consumer itself.
+
+* Consume timeout: maximum time window bewteen receiving messages and returning an response of acknowledgement. Message will be visible again if time runs out.
+* FIFO consumption switch: enable/disable FIFO consumption for FIFO messages.
+* Message consumption retry policy: decide the max delivery times and backoff algorithm for the message which is failed to be consumed in push consumer.
+
+Especially, this table shows the sequence of message receiption with the combination of FIFO/non-FIFO topics and FIFO/non-FIFO consumer groups.
+
+<div align="center">
+
+| | FIFO Consumer Group | non-FIFO Consumer Group |
+| :------------: | :-----------------: | :---------------------: |
+| FIFO Topic | FIFO | non-FIFO |
+| non-FIFO Topic | non-FIFO | non-FIFO |
+
+</div>
+
+### Client Categories
+
+There are four types of client.
+
+* Producer: the client to publish message.
+* Push consumer: full-managed consumer. Message listener are provided for consumption.
+* Simple consumer: the simplest consumer, providing methods to receive messages and change invisible time for messages.
+* Pull consumer: for streaming, it allows to get route info manually and select message queues to bind for pulling message.
+
+### Message Identifier
+
+Message identifer provides identity information for each message stored in broker, which means producer can not get the message identifier until it is sent out successfully.
+
+>**Note**: Internal retries during message publishing may cause message duplication, the duplicate messages here have the same message indentifier.
+
+The message identifer layout is redesigned, see more details [here](./message_id.md).
+
+## New and Unified APIs
+
+<div align="center">
+<img src="./artwork/unified_apis_and_spec.png" width="40%">
+</div>
+
+### Original
+
+[RIP-37: New and Unified APIs](https://shimo.im/docs/m5kv92OeRRU8olqX): RocketMQ proposal of new and unified APIs across different languages.
+
+### Background & Rationale
+
+In fact, current rocketmq APIs exist some problems:
+
+* Lack of well-designed messaging models, which is the prerequisite for unified APIs specification. What’s more, the model strongly affects the definition about behavior. Ambiguous definition makes it harder to predict the behavior of the client.
+* Implementation-oriented. It is not friendly to developers. Many features are based on implementation rather than interface. In addition, users are exposed to redundant and complex interfaces with too many details, increasing probability of making mistakes.
+* Without an unified APIs lifecycle management system, deprecated APIs are reserved for a long time, making APIs difficult to be upgraded.
diff --git a/docs/message_id.md b/docs/message_id.md
index aa58cb7..89f02e8 100644
--- a/docs/message_id.md
+++ b/docs/message_id.md
@@ -19,7 +19,9 @@ As for the second type, there are some major flaws in the algorithm design. Firs
## Detailed Design
-
+<div align="center">
+<img src="./artwork/message_id.png" width="70%">
+</div>
This illustration shows an example of message identifier. The version number of the newly designed version is 0x01, and number of all previous versions is 0x00. The message identifier's length is 17 bytes if its version is higher than 0x00, then we convert it to uppercase hexadecimal to get the message identifier in string format.
diff --git a/docs/workflow.md b/docs/workflow.md
new file mode 100644
index 0000000..eac6f85
--- /dev/null
+++ b/docs/workflow.md
@@ -0,0 +1,41 @@
+# Workflow
+
+This document elaborates the unified workflow of client. The specific implementations maybe differ from language to language, but they follow the same workflow.
+
+## Startup
+
+Different from previous clients, the new version adds some preparations during the startup. One benefit of this change is to catch more obvious errors or exceptions earlier. These perparations include:
+
+1. Try to fetch route data of topics.
+2. Try to get settings from the server, which could do hot-update about these settings. we call this process **server-client telemetry**.
+
+Failure of any preparation will result in the failure of client startup.
+
+<div align="center">
+<img src="./artwork/client_startup.png" width="80%">
+</div>
+
+In details, the **server-client telemetry** provides a channel to upload the local settings and to overwrite the client settings. These settings include:
+
+<div align="center">
+
+| Settings Items | Remark | Possible Values | Immutable |
+| :---------------------------------------------------: | :----------------------: | :-------------------------------------------------------: | :-------: |
+| client type | indicate the client type | producer/push consumer/</br>simple consumer/pull consumer | ❌ |
+| access point | - | - | ❌ |
+| backoff policy | - | - | ✅ |
+| topics to publish message | - | - | ❌ |
+| message body compression</br>threshold for publishing | - | - | ✅ |
+
+
+</div>
+
+## Periodic Task
+
+<div align="center">
+<img src="./artwork/client_schedule_task.png" width="50%">
+</div>
+
+## Message Publishing in Producer
+## Message Receiption in Push Consumer
+## Message Receiption in Simple Consumer
\ No newline at end of file
diff --git a/java/README.md b/java/README.md
index 2d19ec1..74a7e95 100644
--- a/java/README.md
+++ b/java/README.md
@@ -11,6 +11,8 @@ This project guarantees the same runtime compatibility with [grpc-java](https://
* Java 11 or higher is required to build this project.
* The built artifacts can be used on Java 8 or higher.
+[Maven3](https://maven.apache.org/download.cgi) is used as the build tool.
+
## Getting Started
Firstly, add the dependency to your `pom.xml`, and replace the `${rocketmq.version}` with the latest version.
@@ -35,33 +37,25 @@ the no-shaded client.
</dependency>
```
+## Example
+
There is a provider based on the Java SPI mechanism, the provider here can derive specific implementations.
```java
// Find the implementation of APIs according to SPI mechanism.
final ClientServiceProvider provider = ClientServiceProvider.loadService();
-StaticSessionCredentialsProvider staticSessionCredentialsProvider =
- new StaticSessionCredentialsProvider(accessKey, secretKey);
+StaticSessionCredentialsProvider credentialsProvider = new StaticSessionCredentialsProvider(accessKey, secretKey);
ClientConfiguration clientConfiguration = ClientConfiguration.newBuilder()
- .setEndpoints(endpoints)
- .setCredentialProvider(staticSessionCredentialsProvider)
- .build();
+ .setEndpoints(endpoints).setCredentialProvider(credentialsProvider).build();
```
### Producer
```java
// Build your message.
-final Message message = provider.newMessageBuilder()
- .setTopic(topic)
- .setBody(body)
- .setTag(tag)
- .build();
+final Message message = provider.newMessageBuilder().setTopic(topic).setBody(body).setTag(tag).build();
// Build your producer.
-Producer producer = provider.newProducerBuilder()
- .setClientConfiguration(clientConfiguration)
- .setTopics(topic)
- .build();
+Producer producer = provider.newProducerBuilder().setClientConfiguration(clientConfiguration).setTopics(topic).build();
for (int i = 0; i < 1024; i++) {
final SendReceipt sendReceipt = producer.send(message);
}
@@ -74,8 +68,7 @@ producer.close();
```java
// Build your push consumer.
PushConsumer pushConsumer = provider.newPushConsumerBuilder()
- .setClientConfiguration(clientConfiguration)
- .setConsumerGroup(consumerGroup)
+ .setClientConfiguration(clientConfiguration).setConsumerGroup(consumerGroup)
.setSubscriptionExpressions(Collections.singletonMap(topic, filterExpression))
.setMessageListener(messageView -> {
// Handle the received message and return the consume result.
@@ -91,10 +84,8 @@ pushConsumer.close();
```java
// Build your simple consumer.
SimpleConsumer simpleConsumer = provider.newSimpleConsumerBuilder()
- .setClientConfiguration(clientConfiguration)
- .setConsumerGroup(consumerGroup)
- .setAwaitDuration(awaitDuration)
- .setSubscriptionExpressions(Collections.singletonMap(topic, filterExpression))
+ .setClientConfiguration(clientConfiguration).setConsumerGroup(consumerGroup)
+ .setAwaitDuration(awaitDuration).setSubscriptionExpressions(Collections.singletonMap(topic, filterExpression))
.build();
// Try to receive message from server.
final List<MessageView> messageViews = consumer.receive(1, invisibleDuration);
@@ -106,3 +97,6 @@ for (MessageView messageView : messageViews) {
simpleConsumer.close();
```
+## Logging
+
+We use [slf4j](https://github.com/qos-ch/slf4j) and [logback](https://github.com/qos-ch/logback) as our logging system. To prevent
\ No newline at end of file
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerImpl.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerImpl.java
index b13b7e1..4d33ab0 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerImpl.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerImpl.java
@@ -185,7 +185,7 @@ public class ClientManagerImpl extends AbstractIdleService implements ClientMana
}
}
- private void announceSettings() {
+ private void syncSettings() {
clientTable.values().forEach(client -> {
try {
client.telemeterSettings();
@@ -196,13 +196,13 @@ public class ClientManagerImpl extends AbstractIdleService implements ClientMana
}
/**
- * Return rpc client by remote {@link Endpoints}, would create client automatically if it does not exist.
+ * Return the RPC client by remote {@link Endpoints}, would create the client automatically if it does not exist.
*
* <p>In case of the occasion that {@link RpcClient} is garbage collected before shutdown when invoked
* concurrently, lock here is essential.
*
* @param endpoints remote endpoints.
- * @return rpc client.
+ * @return RPC client.
*/
private RpcClient getRpcClient(Endpoints endpoints) throws ClientException {
RpcClient rpcClient;
@@ -421,7 +421,7 @@ public class ClientManagerImpl extends AbstractIdleService implements ClientMana
scheduler.scheduleWithFixedDelay(
() -> {
try {
- announceSettings();
+ syncSettings();
} catch (Throwable t) {
LOGGER.error("Exception raised during the setting announcement.", t);
}
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ConsumerImpl.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ConsumerImpl.java
index f674d01..8650660 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ConsumerImpl.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ConsumerImpl.java
@@ -48,7 +48,6 @@ import java.util.List;
import java.util.Set;
import org.apache.rocketmq.client.apis.ClientConfiguration;
import org.apache.rocketmq.client.apis.consumer.FilterExpression;
-import org.apache.rocketmq.client.apis.consumer.FilterExpressionType;
import org.apache.rocketmq.client.apis.message.MessageId;
import org.apache.rocketmq.client.java.hook.MessageHookPoints;
import org.apache.rocketmq.client.java.hook.MessageHookPointsStatus;
@@ -179,7 +178,7 @@ abstract class ConsumerImpl extends ClientImpl {
return future;
}
- public ListenableFuture<ChangeInvisibleDurationResponse> changInvisibleDuration(MessageViewImpl messageView,
+ public ListenableFuture<ChangeInvisibleDurationResponse> changeInvisibleDuration(MessageViewImpl messageView,
Duration invisibleDuration) {
final Endpoints endpoints = messageView.getEndpoints();
ListenableFuture<ChangeInvisibleDurationResponse> future;
@@ -239,49 +238,33 @@ abstract class ConsumerImpl extends ClientImpl {
return NotifyClientTerminationRequest.newBuilder().setGroup(getProtobufGroup()).build();
}
- public ReceiveMessageRequest wrapReceiveMessageRequest(int batchSize, MessageQueueImpl mq,
- FilterExpression filterExpression) {
- final FilterExpressionType expressionType = filterExpression.getFilterExpressionType();
-
+ private apache.rocketmq.v2.FilterExpression wrapFilterExpression(FilterExpression filterExpression) {
apache.rocketmq.v2.FilterExpression.Builder expressionBuilder =
apache.rocketmq.v2.FilterExpression.newBuilder();
-
- final String expression = filterExpression.getExpression();
- expressionBuilder.setExpression(expression);
- switch (expressionType) {
+ expressionBuilder.setExpression(filterExpression.getExpression());
+ switch (filterExpression.getFilterExpressionType()) {
case SQL92:
expressionBuilder.setType(FilterType.SQL);
break;
case TAG:
default:
expressionBuilder.setType(FilterType.TAG);
- break;
}
+ return expressionBuilder.build();
+ }
+
+ public ReceiveMessageRequest wrapReceiveMessageRequest(int batchSize, MessageQueueImpl mq,
+ FilterExpression filterExpression) {
return ReceiveMessageRequest.newBuilder().setGroup(getProtobufGroup())
- .setMessageQueue(mq.toProtobuf()).setFilterExpression(expressionBuilder.build()).setBatchSize(batchSize)
- .setAutoRenew(true).build();
+ .setMessageQueue(mq.toProtobuf()).setFilterExpression(wrapFilterExpression(filterExpression))
+ .setBatchSize(batchSize).setAutoRenew(true).build();
}
public ReceiveMessageRequest wrapReceiveMessageRequest(int batchSize, MessageQueueImpl mq,
FilterExpression filterExpression, Duration invisibleDuration) {
- final FilterExpressionType expressionType = filterExpression.getFilterExpressionType();
-
- apache.rocketmq.v2.FilterExpression.Builder expressionBuilder =
- apache.rocketmq.v2.FilterExpression.newBuilder();
-
- final String expression = filterExpression.getExpression();
- expressionBuilder.setExpression(expression);
- switch (expressionType) {
- case SQL92:
- expressionBuilder.setType(FilterType.SQL);
- break;
- case TAG:
- default:
- expressionBuilder.setType(FilterType.TAG);
- break;
- }
+ final com.google.protobuf.Duration duration = Durations.fromNanos(invisibleDuration.toNanos());
return ReceiveMessageRequest.newBuilder().setGroup(getProtobufGroup())
- .setMessageQueue(mq.toProtobuf()).setFilterExpression(expressionBuilder.build()).setBatchSize(batchSize)
- .setAutoRenew(false).setInvisibleDuration(Durations.fromNanos(invisibleDuration.toNanos())).build();
+ .setMessageQueue(mq.toProtobuf()).setFilterExpression(wrapFilterExpression(filterExpression))
+ .setBatchSize(batchSize).setAutoRenew(false).setInvisibleDuration(duration).build();
}
}
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueue.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueue.java
index 5d75c15..dce7aee 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueue.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueue.java
@@ -28,12 +28,13 @@ import org.apache.rocketmq.client.java.message.MessageViewImpl;
import org.apache.rocketmq.client.java.route.MessageQueueImpl;
/**
- * Process queue is a cache to store fetched message from remote for {@link PushConsumer}, and it provides specialized
- * function to take message to consume for push consumer.
+ * Process queue is a cache to store fetched messages from remote for {@link PushConsumer}, and it provides specialized
+ * function to take the message to consume for push consumer.
*
- * <p>{@link PushConsumer} queries assignments periodically and convert it into message queues, each message queue is
- * mapped into one process queue to fetch message from remote. If message queue is removed from the newest assignment,
- * the corresponding process queue is marked as expired soon, which makes it deprecated, means its lifecycle is over.
+ * <p>{@link PushConsumer} queries assignments periodically and converts them into message queues, each message queue is
+ * mapped into one process queue to fetch message from remote. If the message queue is removed from the newest
+ * assignment, the corresponding process queue is marked as expired soon, which makes it deprecated, which means its
+ * lifecycle is over.
*
* <h3>A standard procedure to take/erase message</h3>
*
@@ -60,21 +61,21 @@ import org.apache.rocketmq.client.java.route.MessageQueueImpl;
* pending messages in-flight messages
* </pre>
*
- * <p>Especially, there are some different processing procedure fo FIFO consumption.
+ * <p>Especially, there are some different processing procedures for FIFO consumption.
*
* <p>Let us emphasize two points:
- * 1. For push consumer, the order of FIFO messages means: for messages under the same message group, only when the
+ * 1. For the push consumer, the order of FIFO messages means: for messages under the same message group, only when the
* previous message is successfully consumed and successfully acknowledged or successfully sent to the dead-letter queue
- * if the consumption fails, the latter message can be delivered into the {@link MessageListener}.
+ * if the consumption is failed, the latter message can be delivered into the {@link MessageListener}.
* 2. The push consumer essentially uses the 'pull' to simulate the behavior of 'push', and the consumer pulls messages
* in batches.
*
- * <p>Based on the above assumptions, the server may put multiple messages of the same message group in order in a
+ * <p>Based on the above assumptions, the server may put multiple messages of the same message group orderly in a
* batch of message acquisition, but until the above messages are successfully acknowledged or sent to the dead letter
* queue, the subsequent messages of the same message group will be obtained by the client. The above is enforced by
* the server, this is why the return value of the {@link #tryTakeFifoMessages()} is an iterator, an iterator represents
* a batch, the client itself must ensure the order of message consumption within the batch, and the order between
- * batches is guaranteed by the server.
+ * batches are guaranteed by the server.
*/
public interface ProcessQueue {
/**
@@ -85,8 +86,8 @@ public interface ProcessQueue {
MessageQueueImpl getMessageQueue();
/**
- * Drop current process queue, which means process queue's lifecycle is over,
- * thus it would not fetch message from remote anymore if dropped.
+ * Drop the current process queue, which means the process queue's lifecycle is over,
+ * thus it would not fetch messages from the remote anymore if dropped.
*/
void drop();
@@ -98,7 +99,7 @@ public interface ProcessQueue {
boolean expired();
/**
- * Start to fetch message from remote immediately.
+ * Start to fetch messages from remote immediately.
*/
void fetchMessageImmediately();
@@ -110,15 +111,15 @@ public interface ProcessQueue {
Optional<MessageViewImpl> tryTakeMessage();
/**
- * Erase messages which haven been taken except FIFO messages.
+ * Erase messages which have been taken except FIFO messages.
*
- * @param messageView message to erase.
+ * @param messageView the message to erase.
* @param consumeResult consume result.
*/
void eraseMessage(MessageViewImpl messageView, ConsumeResult consumeResult);
/**
- * Try to take a FIFO message from cache.
+ * Try to take a FIFO message from the cache.
*
* @return message which has been taken, or {@link Collections#emptyIterator()} if no message.
*/
@@ -127,14 +128,29 @@ public interface ProcessQueue {
/**
* Erase FIFO message which has been taken.
*
- * @param messageView message to erase.
+ * @param messageView the message to erase.
* @param consumeResult consume status.
*/
ListenableFuture<Void> eraseFifoMessage(MessageViewImpl messageView, ConsumeResult consumeResult);
+ /**
+ * Get the count of pending messages.
+ *
+ * @return count of pending messages.
+ */
long getPendingMessageCount();
+ /**
+ * Get the count of in-flight messages.
+ *
+ * @return count of in-flight messages.
+ */
long getInflightMessageCount();
+ /**
+ * Get the bytes of cached message memory footprint.
+ *
+ * @return bytes of cached message memory footprint.
+ */
long getCachedMessageBytes();
}
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueueImpl.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueueImpl.java
index 3183627..ef7cf91 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueueImpl.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueueImpl.java
@@ -412,7 +412,7 @@ class ProcessQueueImpl implements ProcessQueue {
private void nackMessage(MessageViewImpl messageView) {
final Duration duration = consumer.getRetryPolicy().getNextAttemptDelay(messageView.getDeliveryAttempt());
- consumer.changInvisibleDuration(messageView, duration);
+ consumer.changeInvisibleDuration(messageView, duration);
}
@Override
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/SimpleConsumerImpl.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/SimpleConsumerImpl.java
index a7fe537..d7b0b1c 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/SimpleConsumerImpl.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/SimpleConsumerImpl.java
@@ -288,7 +288,7 @@ class SimpleConsumerImpl extends ConsumerImpl implements SimpleConsumer {
return future0;
}
MessageViewImpl impl = (MessageViewImpl) messageView;
- final ListenableFuture<ChangeInvisibleDurationResponse> future = changInvisibleDuration(impl,
+ final ListenableFuture<ChangeInvisibleDurationResponse> future = changeInvisibleDuration(impl,
invisibleDuration);
return Futures.transformAsync(future, response -> {
// Refresh receipt handle manually.
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageIdCodec.java b/java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageIdCodec.java
index 4fbce06..a2dda44 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageIdCodec.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/message/MessageIdCodec.java
@@ -52,7 +52,7 @@ import org.apache.rocketmq.client.java.misc.Utilities;
* ▲ │ ▲ (4bytes)
* │ │ │
* ┌─────┴─────┐ ┌┴┐ ┌───┐ ┌─┴─┐
- * 0x0001+ │ 6 │ │2│ │ 4 │ │ 4 │
+ * 0x01+ │ 6 │ │2│ │ 4 │ │ 4 │
* └───────────┘ └─┘ └─┬─┘ └───┘
* │
* ▼
diff --git a/java/client/src/test/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueueImplTest.java b/java/client/src/test/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueueImplTest.java
index 7c9baeb..401ce38 100644
--- a/java/client/src/test/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueueImplTest.java
+++ b/java/client/src/test/java/org/apache/rocketmq/client/java/impl/consumer/ProcessQueueImplTest.java
@@ -116,11 +116,11 @@ public class ProcessQueueImplTest extends TestBase {
when(retryPolicy.getNextAttemptDelay(anyInt())).thenReturn(Duration.ofSeconds(1));
when(pushConsumer.getRetryPolicy()).thenReturn(retryPolicy);
when(pushConsumerSettings.isFifo()).thenReturn(false);
- when(pushConsumer.changInvisibleDuration(any(MessageViewImpl.class), any(Duration.class)))
+ when(pushConsumer.changeInvisibleDuration(any(MessageViewImpl.class), any(Duration.class)))
.thenReturn(okChangeInvisibleDurationFuture());
processQueue.cacheMessages(messageViewList);
verify(pushConsumer, times(1))
- .changInvisibleDuration(any(MessageViewImpl.class), any(Duration.class));
+ .changeInvisibleDuration(any(MessageViewImpl.class), any(Duration.class));
}
@Test
[rocketmq-clients] 03/04: Fix typos
Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aaronai pushed a commit to branch temp
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
commit f76b7a61e44b5d0a4ba33bbf3ea8461f4a2a9407
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Thu Jun 23 19:00:34 2022 +0800
Fix typos
---
.../client/apis/ClientServiceProvider.java | 10 ++++++++
.../rocketmq/client/java/impl/ClientManager.java | 30 +++++++++++-----------
.../client/java/impl/ClientManagerImpl.java | 8 +++---
.../client/java/impl/ClientManagerRegistry.java | 6 ++---
.../java/impl/ClientServiceProviderImpl.java | 12 +++++++++
.../client/java/impl/TelemetrySession.java | 3 ++-
6 files changed, 46 insertions(+), 23 deletions(-)
diff --git a/java/client-apis/src/main/java/org/apache/rocketmq/client/apis/ClientServiceProvider.java b/java/client-apis/src/main/java/org/apache/rocketmq/client/apis/ClientServiceProvider.java
index ed9dc32..523f1f8 100644
--- a/java/client-apis/src/main/java/org/apache/rocketmq/client/apis/ClientServiceProvider.java
+++ b/java/client-apis/src/main/java/org/apache/rocketmq/client/apis/ClientServiceProvider.java
@@ -52,7 +52,17 @@ public interface ClientServiceProvider {
*/
MessageBuilder newMessageBuilder();
+ /**
+ * Get the push consumer builder by the current provider.
+ *
+ * @return the push consumer builder instance.
+ */
PushConsumerBuilder newPushConsumerBuilder();
+ /**
+ * Get the simple consumer builder by the current provider.
+ *
+ * @return the simple consumer builder instance.
+ */
SimpleConsumerBuilder newSimpleConsumerBuilder();
}
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManager.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManager.java
index b9340af..9f40a6d 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManager.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManager.java
@@ -48,11 +48,11 @@ import org.apache.rocketmq.client.apis.ClientException;
import org.apache.rocketmq.client.java.route.Endpoints;
/**
- * Client manager supplies a series of unified apis to execute remote procedure call for each {@link Client}.
+ * Client manager supplies a series of unified APIs to execute remote procedure calls for each {@link Client}.
*
* <p>To manage lifecycle for client manager, {@link Client} must be registered before using client manager,
- * once {@link Client} is shutdown, it must be unregistered from client manager. client manager hold the connections
- * and underlying threads, which are shared by all register client.
+ * once {@link Client} is shut down, it must be unregistered by the client manager. The client manager holds the
+ * connections and underlying threads, which are shared by all registered clients.
*/
public interface ClientManager {
/**
@@ -77,7 +77,7 @@ public interface ClientManager {
boolean isEmpty();
/**
- * Provide for client to share the scheduler.
+ * Provide for the client to share the scheduler.
*
* @return shared scheduler.
*/
@@ -90,7 +90,7 @@ public interface ClientManager {
* @param metadata gRPC request header metadata.
* @param request query route request.
* @param duration request max duration.
- * @return response future of topic route.
+ * @return response future of the topic route.
*/
ListenableFuture<QueryRouteResponse> queryRoute(Endpoints endpoints, Metadata metadata, QueryRouteRequest request,
Duration duration);
@@ -100,9 +100,9 @@ public interface ClientManager {
*
* @param endpoints requested endpoints.
* @param metadata gRPC request header metadata.
- * @param request heart beat request.
+ * @param request heartbeat request.
* @param duration request max duration.
- * @return response future of heart beat.
+ * @return response future of heartbeat.
*/
ListenableFuture<HeartbeatResponse> heartbeat(Endpoints endpoints, Metadata metadata, HeartbeatRequest request,
Duration duration);
@@ -114,7 +114,7 @@ public interface ClientManager {
* @param metadata gRPC request header metadata.
* @param request send message request.
* @param duration request max duration.
- * @return response future of sending message.
+ * @return response future of the sending message.
*/
ListenableFuture<SendMessageResponse> sendMessage(Endpoints endpoints, Metadata metadata,
SendMessageRequest request, Duration duration);
@@ -132,7 +132,7 @@ public interface ClientManager {
QueryAssignmentRequest request, Duration duration);
/**
- * Receiving message asynchronously from server, the method ensures no throwable.
+ * Receiving messages asynchronously from the server, the method ensures no throwable.
*
* @param endpoints requested endpoints.
* @param metadata gRPC request header metadata.
@@ -141,7 +141,7 @@ public interface ClientManager {
ReceiveMessageRequest request, Duration duration);
/**
- * Ack message asynchronously after success of consumption, the method ensures no throwable.
+ * Ack message asynchronously after the success of consumption, the method ensures no throwable.
*
* @param endpoints requested endpoints.
* @param metadata gRPC request header metadata.
@@ -153,7 +153,7 @@ public interface ClientManager {
Duration duration);
/**
- * Nack message asynchronously after failure of consumption, the method ensures no throwable.
+ * Nack message asynchronously after the failure of consumption, the method ensures no throwable.
*
* @param endpoints requested endpoints.
* @param metadata gRPC request header metadata.
@@ -165,13 +165,13 @@ public interface ClientManager {
ChangeInvisibleDurationRequest request, Duration duration);
/**
- * Send message to dead letter queue asynchronously, the method ensures no throwable.
+ * Send a message to the dead letter queue asynchronously, the method ensures no throwable.
*
* @param endpoints requested endpoints.
* @param metadata gRPC request header metadata.
- * @param request request of sending message to DLQ.
+ * @param request request of sending a message to DLQ.
* @param duration request max duration.
- * @return response future of sending message to DLQ.
+ * @return response future of sending a message to DLQ.
*/
ListenableFuture<ForwardMessageToDeadLetterQueueResponse> forwardMessageToDeadLetterQueue(
Endpoints endpoints, Metadata metadata, ForwardMessageToDeadLetterQueueRequest request, Duration duration);
@@ -189,7 +189,7 @@ public interface ClientManager {
EndTransactionRequest request, Duration duration);
/**
- * Asynchronously notify server that client is terminated, the method ensures no throwable.
+ * Asynchronously notify the server that client is terminated, the method ensures no throwable.
*
* @param endpoints request endpoints.
* @param metadata gRPC request header metadata.
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerImpl.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerImpl.java
index ddbbbf9..b13b7e1 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerImpl.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerImpl.java
@@ -100,12 +100,12 @@ public class ClientManagerImpl extends AbstractIdleService implements ClientMana
private final ConcurrentMap<String, Client> clientTable;
/**
- * In charge of all scheduled task.
+ * In charge of all scheduled tasks.
*/
private final ScheduledExecutorService scheduler;
/**
- * Public executor for all async rpc, <strong>should never submit heavy task.</strong>
+ * Public executor for all async RPCs, <strong>should never submit a heavy task.</strong>
*/
private final ExecutorService asyncWorker;
@@ -147,7 +147,7 @@ public class ClientManagerImpl extends AbstractIdleService implements ClientMana
* It is well-founded that a {@link RpcClient} is deprecated if it is idle for a long time, so it is essential to
* clear it.
*
- * @throws InterruptedException if thread has been interrupted
+ * @throws InterruptedException if the thread has been interrupted
*/
private void clearIdleRpcClients() throws InterruptedException {
rpcClientTableLock.writeLock().lock();
@@ -423,7 +423,7 @@ public class ClientManagerImpl extends AbstractIdleService implements ClientMana
try {
announceSettings();
} catch (Throwable t) {
- LOGGER.error("Exception raised during setting announcement.", t);
+ LOGGER.error("Exception raised during the setting announcement.", t);
}
},
ANNOUNCE_SETTINGS_DELAY.toNanos(),
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerRegistry.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerRegistry.java
index 2d57dc1..42dc30d 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerRegistry.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientManagerRegistry.java
@@ -44,9 +44,9 @@ public class ClientManagerRegistry {
/**
* Register {@link Client} to the appointed manager by manager id, start the manager if it is created newly.
*
- * <p>Different client would share the same {@link ClientManager} if they have the same manager id.
+ * <p>Different clients would share the same {@link ClientManager} if they have the same manager id.
*
- * @param client client to register.
+ * @param client the client to register.
* @return the client manager which is started.
*/
public ClientManager registerClient(Client client) {
@@ -66,7 +66,7 @@ public class ClientManagerRegistry {
}
/**
- * Unregister {@link Client} to the appointed manager by message id, shutdown the manager if no client
+ * Unregister {@link Client} to the appointed manager by message-id, shutdown the manager if no client
* registered in it.
*
* @param client client to unregister.
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientServiceProviderImpl.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientServiceProviderImpl.java
index c7576e2..f502b8f 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientServiceProviderImpl.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/ClientServiceProviderImpl.java
@@ -28,21 +28,33 @@ import org.apache.rocketmq.client.java.impl.producer.ProducerBuilderImpl;
import org.apache.rocketmq.client.java.message.MessageBuilderImpl;
public class ClientServiceProviderImpl implements ClientServiceProvider {
+ /**
+ * @see ClientServiceProvider#newProducerBuilder()
+ */
@Override
public ProducerBuilder newProducerBuilder() {
return new ProducerBuilderImpl();
}
+ /**
+ * @see ClientServiceProvider#newMessageBuilder()
+ */
@Override
public PushConsumerBuilder newPushConsumerBuilder() {
return new PushConsumerBuilderImpl();
}
+ /**
+ * @see ClientServiceProvider#newMessageBuilder()
+ */
@Override
public SimpleConsumerBuilder newSimpleConsumerBuilder() {
return new SimpleConsumerBuilderImpl();
}
+ /**
+ * @see ClientServiceProvider#newMessageBuilder()
+ */
@Override
public MessageBuilder newMessageBuilder() {
return new MessageBuilderImpl();
diff --git a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/TelemetrySession.java b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/TelemetrySession.java
index bb51870..7d87340 100644
--- a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/TelemetrySession.java
+++ b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/TelemetrySession.java
@@ -61,6 +61,7 @@ public class TelemetrySession implements StreamObserver<TelemetryCommand> {
return new TelemetrySession(client, clientManager, endpoints).register();
}
+ @SuppressWarnings("UnstableApiUsage")
private ListenableFuture<TelemetrySession> register() {
ListenableFuture<TelemetrySession> future;
try {
@@ -161,7 +162,7 @@ public class TelemetrySession implements StreamObserver<TelemetryCommand> {
case VERIFY_MESSAGE_COMMAND: {
final VerifyMessageCommand verifyMessageCommand = command.getVerifyMessageCommand();
LOGGER.info("Receive message verification command from remote, endpoints={}, clientId={}",
- client.getClientId());
+ endpoints, client.getClientId());
client.onVerifyMessageCommand(endpoints, verifyMessageCommand);
break;
}