|
| 1 | + |
1 | 2 | # Introduction
|
2 | 3 |
|
| 4 | + |
| 5 | + |
3 | 6 | # Transformations
|
4 | 7 |
|
| 8 | + |
5 | 9 | ## Archive
|
6 | 10 |
|
7 | 11 | The Archive transformation is used to help preserve all of the data for a message when archived to S3.
|
8 | 12 |
|
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +### Note |
| 17 | + |
| 18 | +This transform works by copying the key, value, topic, and timestamp to new record where this is all contained in the value of the message. This will allow connectors like Confluent's S3 connector to properly archive the record. |
| 19 | + |
| 20 | + |
9 | 21 | ### Configuration
|
10 | 22 |
|
11 |
| -| Name | Type | Importance | Default Value | Validator | Documentation| |
12 |
| -| ---- | ---- | ---------- | ------------- | --------- | -------------| |
13 | 23 |
|
| 24 | +#### Examples |
| 25 | + |
| 26 | +##### Standalone Example |
14 | 27 |
|
15 |
| -#### Standalone Example |
| 28 | +This configuration is used typically along with [standalone mode](http://docs.confluent.io/current/connect/concepts.html#standalone-workers). |
16 | 29 |
|
17 | 30 | ```properties
|
18 |
| -transforms=Archive |
19 |
| -transforms.Archive.type=com.github.jcustenborder.kafka.connect.archive.Archive |
20 |
| -# The following values must be configured. |
| 31 | +name=Connector1 |
| 32 | +connector.class=org.apache.kafka.some.SourceConnector |
| 33 | +tasks.max=1 |
| 34 | +transforms=tran |
| 35 | +transforms.tran.type=com.github.jcustenborder.kafka.connect.archive.Archive |
21 | 36 | ```
|
22 | 37 |
|
23 |
| -#### Distributed Example |
| 38 | +##### Distributed Example |
| 39 | + |
| 40 | +This configuration is used typically along with [distributed mode](http://docs.confluent.io/current/connect/concepts.html#distributed-workers). |
| 41 | +Write the following json to `connector.json`, configure all of the required values, and use the command below to |
| 42 | +post the configuration to one the distributed connect worker(s). |
24 | 43 |
|
25 | 44 | ```json
|
26 | 45 | {
|
27 |
| - "name": "connector1", |
28 |
| - "config": { |
29 |
| - "connector.class": "com.github.jcustenborder.kafka.connect.archive.Archive", |
30 |
| - "transforms": "Archive", |
31 |
| - "transforms.Archive.type": "com.github.jcustenborder.kafka.connect.archive.Archive", |
32 |
| - } |
| 46 | + "name" : "Connector1", |
| 47 | + "connector.class" : "org.apache.kafka.some.SourceConnector", |
| 48 | + "transforms" : "tran", |
| 49 | + "transforms.tran.type" : "com.github.jcustenborder.kafka.connect.archive.Archive" |
33 | 50 | }
|
34 | 51 | ```
|
35 | 52 |
|
| 53 | +Use curl to post the configuration to one of the Kafka Connect Workers. Change `http://localhost:8083/` the the endpoint of |
| 54 | +one of your Kafka Connect worker(s). |
| 55 | + |
| 56 | +Create a new instance. |
| 57 | +```bash |
| 58 | +curl -s -X POST -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors |
| 59 | +``` |
| 60 | + |
| 61 | +Update an existing instance. |
| 62 | +```bash |
| 63 | +curl -s -X PUT -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors/TestSinkConnector1/config |
| 64 | +``` |
| 65 | + |
| 66 | + |
0 commit comments