mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
merge /pull/2373
This commit is contained in:
@@ -51,7 +51,15 @@ public class CanalRabbitMQProducer extends AbstractMQProducer implements CanalMQ
|
||||
loadRabbitMQProperties(properties);
|
||||
|
||||
ConnectionFactory factory = new ConnectionFactory();
|
||||
factory.setHost(rabbitMQProperties.getHost());
|
||||
String servers = rabbitMQProperties.getHost();
|
||||
if (servers.contains(":")) {
|
||||
String[] serverHostAndPort = servers.split(":");
|
||||
factory.setHost(serverHostAndPort[0]);
|
||||
factory.setPort(Integer.parseInt(serverHostAndPort[1]));
|
||||
} else {
|
||||
factory.setHost(servers);
|
||||
}
|
||||
|
||||
if (mqProperties.getAliyunAccessKey().length() > 0 && mqProperties.getAliyunSecretKey().length() > 0
|
||||
&& mqProperties.getAliyunUid() > 0) {
|
||||
factory.setCredentialsProvider(new AliyunCredentialsProvider(mqProperties.getAliyunAccessKey(),
|
||||
|
||||
Reference in New Issue
Block a user