diff --git a/client/src/main/java/org/apache/rocketmq/client/AccessChannel.java b/client/src/main/java/org/apache/rocketmq/client/AccessChannel.java index 82978b0a116ed93138e0f015142806d4e1f3288c..d6feb579cea2c65e89883e8f06e5ac10f44d3d99 100644 --- a/client/src/main/java/org/apache/rocketmq/client/AccessChannel.java +++ b/client/src/main/java/org/apache/rocketmq/client/AccessChannel.java @@ -15,7 +15,19 @@ * limitations under the License. */ package org.apache.rocketmq.client; + +/** + * Used for set access channel, if need migrate the rocketmq service to cloud, it is We recommend set the value with + * "CLOUD". otherwise set with "LOCAL", especially used the message trace feature. + */ public enum AccessChannel { - local, - cloud, + /** + * Means connect to private IDC cluster. + */ + LOCAL, + + /** + * Means connect to Cloud service. + */ + CLOUD, } diff --git a/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java b/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java index 53ac3538e8b5f4e2ff0e49e5f152bec7afae7be7..87c01a5b3055470be8d1772457afde58d9e55a95 100644 --- a/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java +++ b/client/src/main/java/org/apache/rocketmq/client/ClientConfig.java @@ -37,7 +37,7 @@ public class ClientConfig { private String instanceName = System.getProperty("rocketmq.client.name", "DEFAULT"); private int clientCallbackExecutorThreads = Runtime.getRuntime().availableProcessors(); protected String namespace; - protected AccessChannel accessChannel = AccessChannel.local; + protected AccessChannel accessChannel = AccessChannel.LOCAL; /** * Pulling topic information interval from the named server diff --git a/client/src/main/java/org/apache/rocketmq/client/trace/AsyncTraceDispatcher.java b/client/src/main/java/org/apache/rocketmq/client/trace/AsyncTraceDispatcher.java index 3b5fc1d0c04200e474a1fd2805e541a8020eeee9..ca3bcfa261a574cd6df668d99f4b8170d4eb40da 100644 --- a/client/src/main/java/org/apache/rocketmq/client/trace/AsyncTraceDispatcher.java +++ b/client/src/main/java/org/apache/rocketmq/client/trace/AsyncTraceDispatcher.java @@ -72,7 +72,7 @@ public class AsyncTraceDispatcher implements TraceDispatcher { private String dispatcherId = UUID.randomUUID().toString(); private String traceTopicName; private AtomicBoolean isStarted = new AtomicBoolean(false); - private AccessChannel accessChannel = AccessChannel.local; + private AccessChannel accessChannel = AccessChannel.LOCAL; public AsyncTraceDispatcher(String traceTopicName, RPCHook rpcHook) { // queueSize is greater than or equal to the n power of 2 of value @@ -341,7 +341,7 @@ public class AsyncTraceDispatcher implements TraceDispatcher { */ private void sendTraceDataByMQ(Set keySet, final String data, String dataTopic, String regionId) { String traceTopic = traceTopicName; - if (AccessChannel.cloud == accessChannel){ + if (AccessChannel.CLOUD == accessChannel) { traceTopic = TraceConstants.TRACE_TOPIC_PREFIX + regionId; } final Message message = new Message(traceTopic, data.getBytes());