Repository: alibaba/otter (language: java)

Issue:
No enum constant com.alibaba.otter.shared.etl.model.EventType.XACOMMIT
otter这个问题怎么解决，怎么跳过
```
pid:1 nid:1 exception:setl:com.alibaba.otter.node.etl.select.exceptions.SelectException: java.lang.IllegalArgumentException: No enum constant com.alibaba.otter.shared.etl.model.EventType.XACOMMIT
at com.alibaba.otter.node.etl.select.selector.MessageParser.parse(MessageParser.java:218)
at com.alibaba.otter.node.etl.select.selector.canal.CanalEmbedSelector.selector(CanalEmbedSelector.java:279)
at com.alibaba.otter.node.etl.select.SelectTask.processSelect(SelectTask.java:236)
at com.alibaba.otter.node.etl.select.SelectTask.access$300(SelectTask.java:94)
at com.alibaba.otter.node.etl.select.SelectTask$1.run(SelectTask.java:208)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.IllegalArgumentException: No enum constant com.alibaba.otter.shared.etl.model.EventType.XACOMMIT
at java.lang.Enum.valueOf(Enum.java:238)
at com.alibaba.otter.shared.etl.model.EventType.valueOf(EventType.java:24)
at com.alibaba.otter.node.etl.select.selector.MessageParser.internParse(MessageParser.java:339)
at com.alibaba.otter.node.etl.select.selector.MessageParser.parse(MessageParser.java:148)
... 9 more
```



Discussion / hints:
我用master编译成4.2.19版本后，还是不支持xa事务。

Fix patch:
diff --git a/node/etl/src/main/java/com/alibaba/otter/node/etl/select/selector/MessageParser.java b/node/etl/src/main/java/com/alibaba/otter/node/etl/select/selector/MessageParser.java
index c405d41d6..d00986afb 100644
--- a/node/etl/src/main/java/com/alibaba/otter/node/etl/select/selector/MessageParser.java
+++ b/node/etl/src/main/java/com/alibaba/otter/node/etl/select/selector/MessageParser.java
@@ -336,7 +336,12 @@ private List<EventData> internParse(Pipeline pipeline, Entry entry) {
 
         String schemaName = entry.getHeader().getSchemaName();
         String tableName = entry.getHeader().getTableName();
-        EventType eventType = EventType.valueOf(rowChange.getEventType().name());
+        EventType eventType = EventType.fromName(rowChange.getEventType().name());
+
+        if (eventType == null) {
+            logger.warn("Discard unsupported event type: {}", rowChange.getEventType());
+            return null;
+        }
 
         // 处理下DDL操作
         if (eventType.isQuery()) {
diff --git a/shared/etl/src/main/java/com/alibaba/otter/shared/etl/model/EventType.java b/shared/etl/src/main/java/com/alibaba/otter/shared/etl/model/EventType.java
index f62c23d27..536a9fc06 100644
--- a/shared/etl/src/main/java/com/alibaba/otter/shared/etl/model/EventType.java
+++ b/shared/etl/src/main/java/com/alibaba/otter/shared/etl/model/EventType.java
@@ -146,6 +146,15 @@ public static EventType valuesOf(String value) {
         return null;
     }
 
+    public static EventType fromName(String name) {
+        for (EventType eventType : values()) {
+            if (eventType.name().equalsIgnoreCase(name)) {
+                return eventType;
+            }
+        }
+        return null;
+    }
+
     public String getValue() {
         return value;
     }


Test patch: