kafka-connect-transform-xml

Kafka Connect transformation for handling Xml data based on a XSD. This transformation will convert text based Xml

License

License

Categories

Categories

ORM Data
GroupId

GroupId

com.github.jcustenborder.kafka.connect
ArtifactId

ArtifactId

kafka-connect-transform-xml
Last Version

Last Version

0.1.0.4
Release Date

Release Date

Type

Type

tar.gz
Description

Description

kafka-connect-transform-xml
Kafka Connect transformation for handling Xml data based on a XSD. This transformation will convert text based Xml
Project URL

Project URL

https://github.com/jcustenborder/kafka-connect-transform-xml
Source Code Management

Source Code Management

https://github.com/jcustenborder/kafka-connect-transform-xml

Download kafka-connect-transform-xml

Dependencies

compile (10)

Group / Artifact Type Version
com.github.jcustenborder.kafka.connect : kafka-connect-transform-common jar [0.1.0.1, 0.1.0.1000]
com.github.jcustenborder.kafka.connect : xjc-kafka-connect-plugin jar [0.0.1.1, 0.0.1.1000]
com.github.jcustenborder.kafka.connect : kafka-connect-xml jar [0.0.1.1, 0.0.1.1000]
com.sun.xml.bind : jaxb-xjc jar 2.3.0
com.sun.xml.bind : jaxb-impl jar 2.3.0
com.sun.xml.bind : jaxb-core jar 2.3.0
com.fasterxml.jackson.core : jackson-databind jar 2.8.5
org.reflections : reflections jar 0.9.10
com.google.guava : guava jar 18.0
com.github.jcustenborder.kafka.connect : connect-utils jar [0.3.33,0.3.1000)

provided (1)

Group / Artifact Type Version
org.apache.kafka : connect-api jar 1.0.0

test (5)

Group / Artifact Type Version
com.github.jcustenborder.kafka.connect : connect-utils-testing jar [0.3.33,0.3.1000)
org.junit.jupiter : junit-jupiter-engine jar 5.0.0
org.junit.jupiter : junit-jupiter-api jar 5.0.0
org.mockito : mockito-core jar 2.6.3
ch.qos.logback : logback-classic jar 1.1.8

Project Modules

There are no modules declared in this project.

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.

Use it in conjunction with a Source connector that reads XML data, such as from a HTTP REST endpoint.

Transformations

FromXML(Key)

This transformation is used to transform XML in the Value of the input into a JSON struct based on the provided XSD.

Configuration

Name Type Importance Default Value Validator Documentation
schema.path List High Urls to the schemas to load. http and https paths are supported
xjc.options.automatic.name.conflict.resolution.enabled Boolean False
xjc.options.strict.check.enabled Boolean True
xjc.options.verbose.enabled Boolean False

Standalone Example

transforms=xml_key
transforms.xml_key.type=com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Key
# The following values must be configured.
transforms.xml_key.schema.path = http://web.address/my.xsd

Distributed Example

"transforms": "xml_key",
"transforms.xml_key.type": "com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Key",
"transforms.xml_key.schema.path": "http://web.address/my.xsd"

FromXML(Value)

This transformation is used to transform XML in the Value of the input into a JSON struct based on the provided XSD.

Configuration

Name Type Importance Default Value Validator Documentation
schema.path List High Urls to the schemas to load. http and https paths are supported
xjc.options.automatic.name.conflict.resolution.enabled Boolean False
xjc.options.strict.check.enabled Boolean True
xjc.options.verbose.enabled Boolean False

Standalone Example

transforms=xml_value
transforms.xml_value.type=com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Value
# The following values must be configured.
transforms.xml_value.schema.path = http://web.address/my.xsd

Distributed Example

"transforms": "xml_value",
"transforms.xml_value.type": "com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Value",
"transforms.xml_value.schema.path": "< Configure me >"

Versions

Version
0.1.0.4
0.1.0.3
0.1.0.2
0.1.0.1