mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed issue #1625, mq dymaic topic match
This commit is contained in:
@@ -52,6 +52,8 @@ public class CanalStater {
|
|||||||
// disable netty
|
// disable netty
|
||||||
System.setProperty(CanalConstants.CANAL_WITHOUT_NETTY, "true");
|
System.setProperty(CanalConstants.CANAL_WITHOUT_NETTY, "true");
|
||||||
String autoScan = CanalController.getProperty(properties, CanalConstants.CANAL_AUTO_SCAN);
|
String autoScan = CanalController.getProperty(properties, CanalConstants.CANAL_AUTO_SCAN);
|
||||||
|
// 设置为raw避免ByteString->Entry的二次解析
|
||||||
|
System.setProperty("canal.instance.memory.rawEntry", "false");
|
||||||
if ("true".equals(autoScan)) {
|
if ("true".equals(autoScan)) {
|
||||||
String rootDir = CanalController.getProperty(properties, CanalConstants.CANAL_CONF_DIR);
|
String rootDir = CanalController.getProperty(properties, CanalConstants.CANAL_CONF_DIR);
|
||||||
if (StringUtils.isEmpty(rootDir)) {
|
if (StringUtils.isEmpty(rootDir)) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ canal.instance.filter.black.regex=
|
|||||||
# mq config
|
# mq config
|
||||||
canal.mq.topic=example
|
canal.mq.topic=example
|
||||||
# dynamic topic route by schema or table regex
|
# dynamic topic route by schema or table regex
|
||||||
#canal.mq.dynamicTopic=.*,mytest,mytest\\..*,mytest2.user
|
#canal.mq.dynamicTopic=mytest1.user,mytest2\\..*,.*\\..*
|
||||||
canal.mq.partition=0
|
canal.mq.partition=0
|
||||||
# hash partition config
|
# hash partition config
|
||||||
#canal.mq.partitionsNum=4
|
#canal.mq.partitionsNum=4
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ public class MQMessageUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Set<String> matchTopics(String name, String dynamicTopicConfigs) {
|
private static Set<String> matchTopics(String name, String dynamicTopicConfigs) {
|
||||||
String[] router = StringUtils.split(dynamicTopicConfigs, ';');
|
String[] router = StringUtils.split(dynamicTopicConfigs, ',');
|
||||||
Set<String> topics = new HashSet<>();
|
Set<String> topics = new HashSet<>();
|
||||||
for (String item : router) {
|
for (String item : router) {
|
||||||
int i = item.indexOf(":");
|
int i = item.indexOf(":");
|
||||||
|
|||||||
@@ -53,9 +53,6 @@ public class CanalMQStarter {
|
|||||||
System.setProperty("canal.instance.filter.transaction.entry", "true");
|
System.setProperty("canal.instance.filter.transaction.entry", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置为raw避免ByteString->Entry的二次解析
|
|
||||||
System.setProperty("canal.instance.memory.rawEntry", "false");
|
|
||||||
|
|
||||||
canalServer = CanalServerWithEmbedded.instance();
|
canalServer = CanalServerWithEmbedded.instance();
|
||||||
|
|
||||||
// 对应每个instance启动一个worker线程
|
// 对应每个instance启动一个worker线程
|
||||||
|
|||||||
Reference in New Issue
Block a user