有什么方法可以在Apache Camel中自动重新启动Debezium连接器?
我正在使用 debezium sql sql sql sql serve camel camel for apache camel 从一个数据库更改为另一个数据库。
@Configuration
class DebeziumRoute extends RouteBuilder {
@Override
public void configure() {
from("debezium-sqlserver:iwdcamel" +
"?databaseServerName=iwdcamel" +
"&databaseHostname=localhost" +
"&databasePort=1433" +
"&databaseDbname=MyDB" +
"&databaseUser=sa" +
"&databasePassword=MyPassword" +
"&tableWhitelist=dbo.MyTable" +
"&offsetStorageFileName=./offset-file.dat" +
"&databaseHistoryFileFilename=./history-file.dat")
.choice()
...
.end();
}
}
一切正常,除了出于某种原因数据库或网络下降时,连接器停止并且即使数据库在几秒钟内恢复也不会重新启动。
io.debezium.embedded.EmbeddedEngine: Error while trying to run connector class 'io.debezium.connector.sqlserver.SqlServerConnector'
org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server no devolvió una respuesta. Se ha cerrado la conexión.
有什么方法可以自动重新启动 debezium 连接器?,至少...
有什么方法可以定期检查连接器的状态并在需要时重新启动?
欢迎任何想法...
I am using Debezium Sql Server Connector for Apache Camel to replicate changes from one database to another.
@Configuration
class DebeziumRoute extends RouteBuilder {
@Override
public void configure() {
from("debezium-sqlserver:iwdcamel" +
"?databaseServerName=iwdcamel" +
"&databaseHostname=localhost" +
"&databasePort=1433" +
"&databaseDbname=MyDB" +
"&databaseUser=sa" +
"&databasePassword=MyPassword" +
"&tableWhitelist=dbo.MyTable" +
"&offsetStorageFileName=./offset-file.dat" +
"&databaseHistoryFileFilename=./history-file.dat")
.choice()
...
.end();
}
}
Everything works fine, except that when for some reason the database or network goes down, the connector stop and won't start again, even if the database recovers in a few seconds.
io.debezium.embedded.EmbeddedEngine: Error while trying to run connector class 'io.debezium.connector.sqlserver.SqlServerConnector'
org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server no devolvió una respuesta. Se ha cerrado la conexión.
Is there any way to restart the Debezium connector automatically?, or at least...
Is there any way to check the status of connector periodically and restart if needed?
Any idea is welcome...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论