From cf3e03c1f621f6dd3e0f60827f8e415cec56353d Mon Sep 17 00:00:00 2001 From: duxinglangzi <871364441@qq.com> Date: 星期二, 16 八月 2022 12:39:38 +0800 Subject: [PATCH] 增加优化内容及提示 --- src/main/java/com/duxinglangzi/canal/starter/mode/CanalMessage.java | 24 +++++++++--------------- src/main/java/com/duxinglangzi/canal/starter/configuration/CanalListenerEndpointRegistrar.java | 2 +- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/duxinglangzi/canal/starter/configuration/CanalListenerEndpointRegistrar.java b/src/main/java/com/duxinglangzi/canal/starter/configuration/CanalListenerEndpointRegistrar.java index ad778bc..6dd0e43 100644 --- a/src/main/java/com/duxinglangzi/canal/starter/configuration/CanalListenerEndpointRegistrar.java +++ b/src/main/java/com/duxinglangzi/canal/starter/configuration/CanalListenerEndpointRegistrar.java @@ -57,7 +57,7 @@ throw new IllegalArgumentException("@CanalListener Method Parameter Type Invalid, " + "Need Parameter Type [ com.duxinglangzi.canal.starter.mode.CanalMessage ] please check "); if (StringUtils.isNotBlank(getDestination()) && !sets.contains(getDestination())) - throw new CanalClientException("@CanalListener Illegal destination , please check "); + throw new CanalClientException("@CanalListener Illegal destination " + getDestination() + ", please check "); } diff --git a/src/main/java/com/duxinglangzi/canal/starter/mode/CanalMessage.java b/src/main/java/com/duxinglangzi/canal/starter/mode/CanalMessage.java index 13bba23..4e65b18 100644 --- a/src/main/java/com/duxinglangzi/canal/starter/mode/CanalMessage.java +++ b/src/main/java/com/duxinglangzi/canal/starter/mode/CanalMessage.java @@ -6,22 +6,12 @@ /** * 鐩戝惉浜嬩欢鐨� 杩斿洖淇℃伅, 涓昏灏� CanalEntry 閲屼笉鍚屽眰绾х殑甯哥敤鏁版嵁缁勮鍒板悓涓�灞傜骇浣跨敤.<p> - * headers 鏄负浜嗘柟渚胯幏鍙栧叾浠栨暟鎹紝姣斿 + * entryHeader 鏄负浜嗘柟渚胯幏鍙栧叾浠栨暟鎹紝姣斿: 鑾峰彇鏃ュ織鏂囦欢鍚嶃�佹棩蹇楁枃浠跺亸绉婚噺绛� * * @author wuqiong 2022/8/15 */ public class CanalMessage implements Serializable { private static final long serialVersionUID = 730485362580815032L; - - /** - * 鏁版嵁搴撳悕 - */ - private String dataBaseName; - - /** - * 琛ㄥ悕 - */ - private String tableName; /** * 鍙戠敓鍙樺寲鐨� 浜嬩欢绫诲瀷 @@ -50,16 +40,20 @@ this.entryHeader = entryHeader; this.eventType = eventType; this.rowData = rowData; - this.dataBaseName = getEntryHeader().getSchemaName(); - this.tableName = getEntryHeader().getTableName(); } + /** + * 鏁版嵁搴撳悕 + */ public String getDataBaseName() { - return dataBaseName; + return getEntryHeader().getSchemaName(); } + /** + * 琛ㄥ悕 + */ public String getTableName() { - return tableName; + return getEntryHeader().getTableName(); } public CanalEntry.EventType getEventType() { -- Gitblit v1.8.0