[ISSUE #3949] code refactor

This commit is contained in:
kaiyi.lk
2022-07-13 11:29:16 +08:00
committed by zhouxiang
parent 7257add69b
commit 0bdd9224f6
3 changed files with 2 additions and 3 deletions
@@ -18,6 +18,4 @@ package org.apache.rocketmq.proxy.common.utils;
public class ProxyUtils {
public static final int MAX_MSG_NUMS_FOR_POP_REQUEST = 32;
public static final long MAX_CONSUMER_TIMEOUT_MILLIS = Duration.ofSeconds(20).toMillis();
}
@@ -23,6 +23,7 @@ import org.apache.rocketmq.proxy.common.StartAndShutdown;
import org.apache.rocketmq.proxy.connector.factory.ForwardClientManager;
public abstract class AbstractForwardClient implements StartAndShutdown {
public static final long MAX_CONSUMER_TIMEOUT_MILLIS = Duration.ofSeconds(20).toMillis();
public static final long DEFAULT_MQ_CLIENT_TIMEOUT = Duration.ofSeconds(3).toMillis();
private final ForwardClientManager clientFactory;
@@ -61,7 +61,7 @@ public class ForwardReadConsumer extends AbstractForwardClient {
}
public CompletableFuture<PullResult> pullMessage(String address, PullMessageRequestHeader requestHeader) {
return this.pullMessage(address, requestHeader, ProxyUtils.MAX_CONSUMER_TIMEOUT_MILLIS);
return this.pullMessage(address, requestHeader, MAX_CONSUMER_TIMEOUT_MILLIS);
}
public CompletableFuture<PullResult> pullMessage(String address, PullMessageRequestHeader requestHeader,