Skip to content

Commit 78f6e30

Browse files
authored
Merge pull request eugenp#5567 from markusgulden/master
BAEL-1658
2 parents 5812866 + 8037776 commit 78f6e30

11 files changed

Lines changed: 414 additions & 0 deletions
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name=local-file-sink
17+
connector.class=FileStreamSink
18+
tasks.max=1
19+
file=test.sink.txt
20+
topics=connect-test
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name=local-file-source
17+
connector.class=FileStreamSource
18+
tasks.max=1
19+
file=test.txt
20+
topic=connect-test
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# These are defaults. This file just demonstrates how to override some settings.
17+
bootstrap.servers=localhost:9092
18+
19+
# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will
20+
# need to configure these based on the format they want their data in when loaded from or stored into Kafka
21+
key.converter=org.apache.kafka.connect.json.JsonConverter
22+
value.converter=org.apache.kafka.connect.json.JsonConverter
23+
# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply
24+
# it to
25+
key.converter.schemas.enable=false
26+
value.converter.schemas.enable=false
27+
28+
offset.storage.file.filename=/tmp/connect.offsets
29+
# Flush much faster than normal, which is useful for testing/debugging
30+
offset.flush.interval.ms=10000
31+
32+
# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins
33+
# (connectors, converters, transformations). The list should consist of top level directories that include
34+
# any combination of:
35+
# a) directories immediately containing jars with plugins and their dependencies
36+
# b) uber-jars with plugins and their dependencies
37+
# c) directories immediately containing the package directory structure of classes of plugins and their dependencies
38+
# Note: symlinks will be followed to discover dependencies or plugins.
39+
# Examples:
40+
# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors,
41+
# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a
42+
# directory other than the home directory of Confluent Platform.
43+
plugin.path=C:\Software\confluent-5.0.0\share\java
44+
#plugin.path=./share/java
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
##
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
##
17+
18+
# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended
19+
# to be used with the examples, and some settings may differ from those used in a production system, especially
20+
# the `bootstrap.servers` and those specifying replication factors.
21+
22+
# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster.
23+
bootstrap.servers=localhost:9092
24+
25+
# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs
26+
group.id=connect-cluster
27+
28+
# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will
29+
# need to configure these based on the format they want their data in when loaded from or stored into Kafka
30+
key.converter=org.apache.kafka.connect.json.JsonConverter
31+
value.converter=org.apache.kafka.connect.json.JsonConverter
32+
# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply
33+
# it to
34+
key.converter.schemas.enable=true
35+
value.converter.schemas.enable=true
36+
37+
# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted.
38+
# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
39+
# the topic before starting Kafka Connect if a specific topic configuration is needed.
40+
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
41+
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
42+
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
43+
offset.storage.topic=connect-offsets
44+
offset.storage.replication.factor=1
45+
#offset.storage.partitions=25
46+
47+
# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated,
48+
# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
49+
# the topic before starting Kafka Connect if a specific topic configuration is needed.
50+
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
51+
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
52+
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
53+
config.storage.topic=connect-configs
54+
config.storage.replication.factor=1
55+
56+
# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted.
57+
# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
58+
# the topic before starting Kafka Connect if a specific topic configuration is needed.
59+
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
60+
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
61+
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
62+
status.storage.topic=connect-status
63+
status.storage.replication.factor=1
64+
#status.storage.partitions=5
65+
66+
# Flush much faster than normal, which is useful for testing/debugging
67+
offset.flush.interval.ms=10000
68+
69+
# These are provided to inform the user about the presence of the REST host and port configs
70+
# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests.
71+
#rest.host.name=
72+
#rest.port=8083
73+
74+
# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers.
75+
#rest.advertised.host.name=
76+
#rest.advertised.port=
77+
78+
# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins
79+
# (connectors, converters, transformations). The list should consist of top level directories that include
80+
# any combination of:
81+
# a) directories immediately containing jars with plugins and their dependencies
82+
# b) uber-jars with plugins and their dependencies
83+
# c) directories immediately containing the package directory structure of classes of plugins and their dependencies
84+
# Examples:
85+
# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors,
86+
# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a
87+
# directory other than the home directory of Confluent Platform.
88+
plugin.path=./share/java
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "local-file-sink",
3+
"config": {
4+
"connector.class": "FileStreamSink",
5+
"tasks.max": 1,
6+
"file": "test-distributed.sink.txt",
7+
"topics": "connect-distributed"
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "local-file-source",
3+
"config": {
4+
"connector.class": "FileStreamSource",
5+
"tasks.max": 1,
6+
"file": "test-distributed.txt",
7+
"topic": "connect-distributed"
8+
}
9+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
##
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
##
17+
18+
# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended
19+
# to be used with the examples, and some settings may differ from those used in a production system, especially
20+
# the `bootstrap.servers` and those specifying replication factors.
21+
22+
# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster.
23+
bootstrap.servers=localhost:9092
24+
25+
# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs
26+
group.id=connect-cluster
27+
28+
# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will
29+
# need to configure these based on the format they want their data in when loaded from or stored into Kafka
30+
key.converter=org.apache.kafka.connect.json.JsonConverter
31+
value.converter=org.apache.kafka.connect.json.JsonConverter
32+
# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply
33+
# it to
34+
key.converter.schemas.enable=false
35+
value.converter.schemas.enable=false
36+
37+
# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted.
38+
# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
39+
# the topic before starting Kafka Connect if a specific topic configuration is needed.
40+
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
41+
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
42+
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
43+
offset.storage.topic=connect-offsets
44+
offset.storage.replication.factor=1
45+
#offset.storage.partitions=25
46+
47+
# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated,
48+
# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
49+
# the topic before starting Kafka Connect if a specific topic configuration is needed.
50+
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
51+
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
52+
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
53+
config.storage.topic=connect-configs
54+
config.storage.replication.factor=1
55+
56+
# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted.
57+
# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create
58+
# the topic before starting Kafka Connect if a specific topic configuration is needed.
59+
# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value.
60+
# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able
61+
# to run this example on a single-broker cluster and so here we instead set the replication factor to 1.
62+
status.storage.topic=connect-status
63+
status.storage.replication.factor=1
64+
#status.storage.partitions=5
65+
66+
# Flush much faster than normal, which is useful for testing/debugging
67+
offset.flush.interval.ms=10000
68+
69+
# These are provided to inform the user about the presence of the REST host and port configs
70+
# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests.
71+
#rest.host.name=
72+
#rest.port=8083
73+
74+
# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers.
75+
#rest.advertised.host.name=
76+
#rest.advertised.port=
77+
78+
# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins
79+
# (connectors, converters, transformations). The list should consist of top level directories that include
80+
# any combination of:
81+
# a) directories immediately containing jars with plugins and their dependencies
82+
# b) uber-jars with plugins and their dependencies
83+
# c) directories immediately containing the package directory structure of classes of plugins and their dependencies
84+
# Examples:
85+
# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors,
86+
# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a
87+
# directory other than the home directory of Confluent Platform.
88+
plugin.path=./share/java
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "local-file-source",
3+
"config": {
4+
"connector.class": "FileStreamSource",
5+
"tasks.max": 1,
6+
"file": "transformation.txt",
7+
"topic": "connect-transformation",
8+
"transforms": "MakeMap,InsertSource",
9+
"transforms.MakeMap.type": "org.apache.kafka.connect.transforms.HoistField$Value",
10+
"transforms.MakeMap.field": "line",
11+
"transforms.InsertSource.type": "org.apache.kafka.connect.transforms.InsertField$Value",
12+
"transforms.InsertSource.static.field": "data_source",
13+
"transforms.InsertSource.static.value": "test-file-source"
14+
}
15+
}

0 commit comments

Comments
 (0)