Skip to content

Commit

Permalink
Fix the processing bug of abnormal parsing method of kafkaSource form…
Browse files Browse the repository at this point in the history
…at. (apache#4687)
  • Loading branch information
lightzhao authored Apr 28, 2023
1 parent b491020 commit 228257b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,9 @@ public interface DeserializationSchema<T> extends Serializable {
T deserialize(byte[] message) throws IOException;

default void deserialize(byte[] message, Collector<T> out) throws IOException {
try {
T deserialize = deserialize(message);
if (deserialize != null) {
out.collect(deserialize);
}
} catch (IOException e) {
throw new IOException(e);
T deserialize = deserialize(message);
if (deserialize != null) {
out.collect(deserialize);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
try {
deserializationSchema.deserialize(
record.value(), output);
} catch (IOException e) {
} catch (Exception e) {
if (this.messageFormatErrorHandleWay
== MessageFormatErrorHandleWay
.SKIP) {
log.warn(
"Deserialize message failed, skip this message, message: {}",
record.value());
new String(record.value()));
continue;
}
throw e;
Expand Down

0 comments on commit 228257b

Please sign in to comment.