Skip to content

code-star/kafka-connect-transform-xml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This project provides transformations for Kafka Connect that will convert XML text to a Kafka Connect struct based on the configured XML schema. This transformation works by dynamically generating JAXB source with XJC with the xjc-kafka-connect-plugin loaded. This allows the transformation to efficiently convert XML to structured data for Kafka connect.

Transformations

FromXML(Key)

This transformation is used to rename fields in the key of an input struct based on a regular expression and a replacement string.

Configuration

Name Type Importance Default Value Validator Documentation
schema.path List High Urls to the schemas to load. http and https paths are supported
key.condition.regex String Low The transformation is applied only if the key matches this regex

Standalone Example

transforms=Key
transforms.Key.type=com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Value
# The following values must be configured.
transforms.Key.schema.path = < Configure me >

Distributed Example

{
"name": "connector1",
    "config": {
        "connector.class": "com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Value",
        "transforms": "Key",
        "transforms.Key.type": "com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Value",
        "transforms.Key.schema.path": "< Configure me >"
    }
}

FromXML(Value)

This transformation is used to rename fields in the key of an input struct based on a regular expression and a replacement string.

Configuration

Name Type Importance Default Value Validator Documentation
schema.path List High Urls to the schemas to load. http and https paths are supported

Standalone Example

transforms=Key
transforms.Key.type=com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Value
# The following values must be configured.
transforms.Key.schema.path = < Configure me >

Distributed Example

{
"name": "connector1",
    "config": {
        "connector.class": "com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Value",
        "transforms": "Key",
        "transforms.Key.type": "com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Value",
        "transforms.Key.schema.path": "< Configure me >"
    }
}

About

Transformation for converting XML data to Structured data.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Java 100.0%