浏览代码

ESAdapter Support the same instance cross -library query (#4161)

* ESAdapter Support the same instance cross -library query

* fix null point ex
jumao 3 年之前
父节点
当前提交
b532e90ff4

+ 2 - 2
client-adapter/escore/src/main/java/com/alibaba/otter/canal/client/adapter/es/core/ESAdapter.java

@@ -163,14 +163,14 @@ public abstract class ESAdapter implements OuterAdapter {
                                                                           + "-"
                                                                           + StringUtils.trimToEmpty(config.getGroupId())
                                                                           + "_"
-                                                                          + schema
+                                                                          + tableItem.getSchema() == null ? schema : tableItem.getSchema()
                                                                           + "-"
                                                                           + tableItem.getTableName(),
                         k -> new ConcurrentHashMap<>());
                 } else {
                     esSyncConfigMap = dbTableEsSyncConfig.computeIfAbsent(StringUtils.trimToEmpty(config.getDestination())
                                                                           + "_"
-                                                                          + schema
+                                                                          + tableItem.getSchema() == null ? schema : tableItem.getSchema()
                                                                           + "-"
                                                                           + tableItem.getTableName(),
                         k -> new ConcurrentHashMap<>());