Oracle GoldenGate -> Kafka Connect - "Failed to serialize Avro data"

tl;dr Make sure that key.converter.schema.registry.url and value.converter.schema.registry.url are specified, and that there are no trailing whitespaces.

I've been building on previous work I've done with Oracle GoldenGate and Kafka Connect, looking at how to have the change records from the Oracle database come through to Kafka in Avro format rather than the default JSON that the sample configuration gives.

Simply changing the Kafka Connect OGG configuration file ( from




isn't enough - the OGG replicat abends with the error (in ggserr.log) :

2016-11-29 20:50:23  ERROR   OGG-15051  Oracle GoldenGate Delivery, rconf.prm:  Java or JNI exception:  
oracle.goldengate.util.GGException: org.apache.kafka.common.config.ConfigException: Missing Schema registry url!  

A similar configuration attempt (OGG -> Kafka Connect Avro) can be found on the Confluent Platform Google Group, where the advice is to make sure that the schema registry URL is configured. I already had schema.registry.url in my config, but added the sample config given:


Note that my schema registry is running on 18081 (not 8081).

I then got the replicat abending with a different error:

org.apache.kafka.connect.errors.DataException: Failed to serialize Avro data.

The replicat RPT (in OGG's dirrpt folder) shows

Exception in thread "main" org.apache.kafka.connect.errors.DataException: Failed to serialize Avro data:  
        at io.confluent.connect.avro.AvroConverter.fromConnectData(
        at oracle.goldengate.kafkaconnect.GGProducer.send(
        at oracle.goldengate.kafkaconnect.KafkaConnectHandler.processData(
Caused by: org.apache.kafka.common.errors.SerializationException: Error serializing Avro message  
Caused by: For input string: "18081 "  
Caused by: java.lang.NumberFormatException: For input string: "18081 "  
        at java.lang.NumberFormatException.forInputString(
        at java.lang.Integer.parseInt(
        at java.lang.Integer.parseInt(
        ... 21 more

The schema registry URL is evidently valid at some level, because in the schema registry stdout I can see a POST being made when the OGG replicat runs:

[2016-11-25 03:12:53,591] INFO - - [25/Nov/2016:03:12:53 +0000] "POST /subjects/ORCL.SOE.LOGON-key/versions HTTP/1.1" 200 9  15 (

Looking at the error in the above note MalformedURLException: For input string: "18081 " and the space suffix on 18081.

Going back to the RPT output some more:

  Contents of Kafka producer configuration file
    key [schema.registry.url]  value [http://localhost:18081]
    key [key.converter]  value [io.confluent.connect.avro.AvroConverter]
    key [value.converter]  value [io.confluent.connect.avro.AvroConverter]
    key [bootstrap.servers]  value [localhost:9092]
    key [value.serializer]  value [org.apache.kafka.common.serialization.ByteArraySerializer]
    key [value.converter.schema.registry.url]  value [http://localhost:18081 ]
    key [key.converter.schema.registry.url]  value [http://localhost:18081]
    key [key.serializer]  value [org.apache.kafka.common.serialization.ByteArraySerializer]
    key [internal.key.converter]  value [org.apache.kafka.connect.json.JsonConverter]
    key [internal.value.converter]  value [org.apache.kafka.connect.json.JsonConverter]

Note the trailing space on the configuration value for value.converter.schema.registry.url! After removing the trailing space from, all was well, and OGG successfully sends data to Kafka in Avro format.

Robin Moffatt

Read more posts by this author.

Yorkshire, UK