-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DBZ-4389: Add keepalive pings and handle retriable exceptions
- Loading branch information
1 parent
256f553
commit cd62b46
Showing
6 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/io/debezium/connector/vitess/VitessErrorHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright Debezium Authors. | ||
* | ||
* Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.debezium.connector.vitess; | ||
|
||
import io.debezium.connector.base.ChangeEventQueue; | ||
import io.debezium.pipeline.ErrorHandler; | ||
import io.grpc.StatusRuntimeException; | ||
|
||
public class VitessErrorHandler extends ErrorHandler { | ||
public VitessErrorHandler(String logicalName, ChangeEventQueue<?> queue) { | ||
super(VitessConnector.class, logicalName, queue); | ||
} | ||
|
||
@Override | ||
protected boolean isRetriable(Throwable throwable) { | ||
if (throwable instanceof StatusRuntimeException) { | ||
final StatusRuntimeException exception = (StatusRuntimeException) throwable; | ||
switch (exception.getStatus().getCode()) { | ||
case UNAVAILABLE: | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters