Does Kafka Connect Sink with MySQL JDBC driver support setting isolation level?

30 views Asked by At

I tried to find setting about DB transaction isolation level in Kafka Connect docs - nothing. Tried to find such connection url parameter for MySQL driver - it seems it doesn't exist. Also I didn't find this setting for JDBC Sink in code on github.

Is it really only option to set non-default isolation level is to set it global on server side? But even in this case I'm afraid that Kafka Connect set its own default isolation level that I can't find how to change.

1

There are 1 answers

1
Javier Montón On

The JDBC Sink has a set of "dialects" for each driver and it looks like the GenericDatabaseDialect has a method called setConnectionIsolationMode, the MySQLDialect is not extending it, so that one must be the one used. The config seems to be transaction.isolation.mode. You could try to set that variable, you might need to allow overrides too.

CONNECT_CONNECTOR_CLIENT_CONFIG_OVERRIDE_POLICY=All

if you are using the Confluent's Docker.

Although I have to say that the code looks like the isolation mode is only for the JDBC Source.