项目作者: jcustenborder

项目描述 :
Transformation for converting XML data to Structured data.
高级语言: Java
项目地址: git://github.com/jcustenborder/kafka-connect-transform-xml.git
创建时间: 2018-03-23T20:52:06Z
项目社区:https://github.com/jcustenborder/kafka-connect-transform-xml

开源协议:Apache License 2.0

下载


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

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

Distributed Example

  1. "transforms": "xml_key",
  2. "transforms.xml_key.type": "com.github.jcustenborder.kafka.connect.transform.xml.FromXml$Key",
  3. "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

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

Distributed Example

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