提交 3a8a1bc3 编写于 作者: D duhenglucky 提交者: ShannonDing

Add comment for AccessChannel class

上级 47d88147
......@@ -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,
}
......@@ -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
......
......@@ -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<String> 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());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册