-
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 341cd51
Showing
7 changed files
with
61 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
27 changes: 27 additions & 0 deletions
27
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,27 @@ | ||
/* | ||
* 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 static io.grpc.Status.Code.UNAVAILABLE; | ||
|
||
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; | ||
return exception.getStatus().getCode().equals(UNAVAILABLE); | ||
} | ||
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
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