Skip to content

Commit bd81ad0

Browse files
committed
Initial commit
Signed-off-by: Dale Lane <[email protected]>
1 parent 4b6bf72 commit bd81ad0

File tree

291 files changed

+19858
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+19858
-0
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Maven
2+
target/
3+
4+
# macOS
5+
.DS_Store
6+
7+
# Eclipse
8+
.classpath
9+
.settings/
10+
.project
11+
12+
# IntelliJ IDEA
13+
.idea/
14+
*.iml
15+
*.iws
16+
17+
# Visual Studio Code
18+
.vscode/

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# kafka-connect-xml-converter
2+
3+
A Kafka Connect plugin to make it easier to work with XML data in Kafka Connect pipelines.
4+
5+
## Contents
6+
7+
- `com.ibm.eventstreams.kafkaconnect.plugins.xml.XmlConverter`
8+
- a Kafka Connect converter for converting to/from XML strings
9+
- `com.ibm.eventstreams.kafkaconnect.plugins.xml.XmlTransformation`
10+
- a Kafka Connect transformation for converting Kafka Connect records to/from XML strings
11+
- `com.ibm.eventstreams.kafkaconnect.plugins.xml.XmlMQRecordBuilder`
12+
- an MQ Source Record builder for parsing MQ messages containing XML strings
13+
14+
## Configuration
15+
16+
Optional configuration that can be set when using the plugin to turn XML strings into Connect records
17+
18+
| **Option** | **Default value** | **Notes** |
19+
|------------------------|-------------------|------------------------------------------------------------------|
20+
| `root.element.name` | `root` | The name of the root element in the XML document being parsed. |
21+
| `xsd.schema.path` | | Location of a schema file to use to parse the XML string. |
22+
| `xml.doc.flat.enable` | `false` | Set to true if the XML strings contain a single value (e.g. `<root>the message</root>` |)
23+
24+
Optional configuration that can be set when using the plugin to create XML strings from Connect records
25+
26+
| **Option** | **Default value** | **Notes** |
27+
|------------------------|-------------------|------------------------------------------------------------------|
28+
| `root.element.name` | `root` | The name to use for the root element of the XML document being created. Only used when no name can be found within the schema of the Connect record. |
29+
30+
## Example uses
31+
32+
Use **`XmlConverter`** with Source Connectors to produce structured Connect records to Kafka topics as XML strings.
33+
34+
```
35+
value.converter=com.ibm.eventstreams.kafkaconnect.plugins.xml.XmlConverter
36+
value.converter.schemas.enable=false
37+
```
38+
39+
Use **`XmlConverter`** with Source Connectors to produce Connect records to Kafka topics as XML strings, with an embedded XSD schema. (requires structs)
40+
41+
```
42+
value.converter=com.ibm.eventstreams.kafkaconnect.plugins.xml.XmlConverter
43+
value.converter.schemas.enable=true
44+
```
45+
46+
Use **`XmlTransformation`** with Sink Connectors to convert a Connect record containing an XML string into a structured Connect record.
47+
48+
```
49+
transforms=xmlconvert
50+
transforms.xmlconvert.type=com.ibm.eventstreams.kafkaconnect.plugins.xml.XmlTransformation
51+
transforms.xmlconvert.converter.type=value
52+
```
53+
54+
Use **`XmlConverter`** with the MQ Sink Connector to send non-XML Kafka messages to MQ queues as XML strings.
55+
56+
```
57+
mq.message.builder=com.ibm.eventstreams.connect.mqsink.builders.ConverterMessageBuilder
58+
mq.message.builder.value.converter=com.ibm.eventstreams.kafkaconnect.plugins.xml.XmlConverter
59+
```
60+
61+
Use **`XmlMQRecordBuilder`** with the MQ Source Connector to convert XML strings from MQ queues into Connect records.
62+
63+
```
64+
mq.record.builder=com.ibm.eventstreams.kafkaconnect.plugins.xml.XmlMQRecordBuilder
65+
mq.record.builder.schemas.enable=true
66+
mq.record.builder.xsd.schema.path=/location/of/mq-message-schema.xsd
67+
```
34.8 KB
Loading
33.1 KB
Loading
39.9 KB
Loading
58.8 KB
Loading
57.9 KB
Loading
57.6 KB
Loading
50.7 KB
Loading
51.3 KB
Loading

0 commit comments

Comments
 (0)