mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed mq config
This commit is contained in:
@@ -12,7 +12,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class MQProperties {
|
||||
|
||||
private String servers = "localhost:6667";
|
||||
private String servers = "127.0.0.1:6667";
|
||||
private int retries = 0;
|
||||
private int batchSize = 16384;
|
||||
private int lingerMs = 1;
|
||||
@@ -20,7 +20,7 @@ public class MQProperties {
|
||||
private boolean filterTransactionEntry = true;
|
||||
private String producerGroup = "Canal-Producer";
|
||||
private int canalBatchSize = 50;
|
||||
private Long canalGetTimeout;
|
||||
private Long canalGetTimeout = 100L;
|
||||
private boolean flatMessage = true;
|
||||
|
||||
private List<CanalDestination> canalDestinations = new ArrayList<CanalDestination>();
|
||||
|
||||
@@ -121,15 +121,14 @@ public class CanalMQStarter {
|
||||
server.subscribe(clientIdentity);
|
||||
logger.info("## the canal consumer {} is running now ......", destination.getCanalDestination());
|
||||
|
||||
Long getTimeout = properties.getCanalGetTimeout();
|
||||
int getBatchSize = properties.getCanalBatchSize();
|
||||
while (running) {
|
||||
Message message;
|
||||
if (properties.getCanalGetTimeout() != null) {
|
||||
message = server.getWithoutAck(clientIdentity,
|
||||
properties.getCanalBatchSize(),
|
||||
properties.getCanalGetTimeout(),
|
||||
TimeUnit.MILLISECONDS);
|
||||
if (getTimeout != null && getTimeout > 0) {
|
||||
message = server.getWithoutAck(clientIdentity, getBatchSize, getTimeout, TimeUnit.MILLISECONDS);
|
||||
} else {
|
||||
message = server.getWithoutAck(clientIdentity, properties.getCanalBatchSize());
|
||||
message = server.getWithoutAck(clientIdentity, getBatchSize);
|
||||
}
|
||||
|
||||
final long batchId = message.getId();
|
||||
|
||||
Reference in New Issue
Block a user