1

I have a local instance of a kafka connect cluster. I am trying to replicate data from a DB2(v11.5.8.0) database. I am using debezium connector(v2.2.1) to capture a table in DB2 that contains a column with an XML data type. Based on the documentation, if I am correct, xml data type of db2 should be automatically changed into a string data type. However once I start my connector, during the initial snapshot phase, I get this logs:

kafka-connect | [2023-07-26 02:40:06,642] WARN Unexpected JDBC type '1111' for column 'DATA' that will be ignored (io.debezium.relational.TableSchemaBuilder)

kafka-connect | [2023-07-26 02:40:06,643] WARN No converter found for column DB2INST1.TEST_XML.DATA of type XML. The column will not be part of change events for that table. (io.debezium.relational.TableSchemaBuilder)

I have tried to use custom converters, with the following code:

public class XmlConverter implements CustomConverter<SchemaBuilder, RelationalColumn> {

    private SchemaBuilder xmlSchema;

    @Override
    public void configure(Properties props) {
        xmlSchema = SchemaBuilder.string().name(props.getProperty("schema.name"));
    }

    @Override
    public void converterFor(RelationalColumn column,
        ConverterRegistration<SchemaBuilder> registration) {

        if ("xml".equalsIgnoreCase(column.typeName())) {
            registration.register(xmlSchema, x -> x.toString());
        }
    }
}

There are no warning logs anymore however, the data that I am getting is this "com.ibm.db2.jcc.am.dc@413116b6". Which is if I am correct, is a string representation of an object in java. I don't know why it is like that but I think It should have been the xml data instead.

0 Answers0