Reputation: 1
Debezium mysql connector fail at final stage of snapshotting. The project is on maven/quarkus , and I want to use debezium/infinispan for cache invalidation .
The Observer and configuration looks like this :
public void startEmbeddedEngine(@Observes @Initialized(ApplicationScoped.class) Object init) throws IOException { File dbHistoryTempFile = File.createTempFile("offsets", ".dat"); File offsetStorageTempFile = File.createTempFile("dbhistory", ".dat");
final Properties props = new Properties();
props.setProperty("name", "cache-invalidation-engine");
props.setProperty("connector.class", "io.debezium.connector.mysql.MySqlConnector");
props.setProperty("offset.storage.file.filename", offsetStorageTempFile.getAbsolutePath());
props.setProperty("offset.flush.interval.ms", "0");
props.setProperty("database.hostname", "localhost");
props.setProperty("database.port", "3306");
props.setProperty("database.user", "root");
props.setProperty("database.password", "password");
props.setProperty("database.server.id", "1");
props.setProperty("database.server.name", "new_feature");
props.setProperty("database.history",
"io.debezium.relational.history.FileDatabaseHistory");
props.setProperty("database.history.file.filename", dbHistoryTempFile.getAbsolutePath());
props.setProperty("database.include.list", "database");
// props.setProperty("database.history.file.filename","C:/Users/a.pogonet/AppData/Local/Temp/db.dat");
props.setProperty("snapshot.mode", "never");
// props.setProperty("include.unknown.datatypes", "true");
// props.setProperty("include.schema.changes", "false");
DebeziumEngine<ChangeEvent<String, String>> engine = DebeziumEngine.create(Json.class)
.using(props)
.notifying(record -> {
System.out.println(record);
}).build();
executorService = Executors.newSingleThreadExecutor();
executorService.execute(engine);
}
2021-12-09 14:18:34,137 INFO [io.deb.con.mys.MySqlStreamingChangeEventSource] (blc-localhost:3306) Stopped reading binlog after 0 events, no new offset was recorded Exception in thread "blc-localhost:3306" java.lang.NoSuchMethodError: com.mysql.cj.CharsetMapping.getStaticCollationNameForCollationIndex(Ljava/lang/Integer;)Ljava/lang/String; at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.extractCharset(MySqlAntlrDdlParser.java:404) at io.debezium.connector.mysql.antlr.listener.CreateAndAlterDatabaseParserListener.enterCreateDatabaseOption(CreateAndAlterDatabaseParserListener.java:49) at io.debezium.ddl.parser.mysql.generated.MySqlParser$CreateDatabaseOptionContext.enterRule(MySqlParser.java:5912) at io.debezium.antlr.ProxyParseTreeListenerUtil.delegateEnterRule(ProxyParseTreeListenerUtil.java:46) at io.debezium.connector.mysql.antlr.listener.MySqlAntlrDdlParserListener.enterEveryRule(MySqlAntlrDdlParserListener.java:89) at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:41) at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:25) at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28) at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28) at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28) at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28) at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:28) at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:87) at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:216) at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:202) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:573) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:827) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:349) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$25(MySqlStreamingChangeEventSource.java:855) at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1125) at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:973) at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:599) at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:857) at java.base/java.lang.Thread.run(Thread.java:834)
Upvotes: 0
Views: 685
Reputation: 1
you need update mysql driver to 8.0.27
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.27</version>
<exclusions>
<exclusion>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</exclusion>
</exclusions>
</dependency>
Upvotes: 0
Reputation: 10539
The Quarkus BOM is enforcing a version of the MySQL driver and AFAICS Debezium is using methods that are not available anymore in this version of the driver.
What I recommend you is to use the version of the driver used by the Debezium connector by overriding the version manually in your project.
I can't tell you exactly which version to use given I have no idea which Debezium version you are using. But the version is there for Debezium 1.8: https://github.com/debezium/debezium/blob/1.8/pom.xml#L120 .
That being said, Quarkus 2.5.1.Final+ is also using MySQL Connector 8.0.27 so if you use these versions, I believe it should work.
Upvotes: 0