#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#-----Kafka Specific properties.
name=plc-1-sink
connector.class=org.apache.plc4x.kafka.Plc4xSinkConnector
topics=DefaultTopic,machineSinkB
tasks.max=2

#----PLC4X specific properties
#List of sink names. Each sink results in a new task being created.
sinks=machineA,machineB

#The PLC4X connection string to be used. Examples for each protocol are included on the PLC4X website.
sinks.machineA.connectionString=simulated://127.0.0.1

#The topic this sink/task should handle message from.
sinks.machineA.topic=DefaultTopic

#This timeout is the time between poll retries.
sinks.machineA.timeout=5000

#If PLC4X can't write all the values in the record it will retry this number of times.
sinks.machineA.retries=5

#A list of fields. Each field is a map between an alias and a PLC4X address.
#The address formats for each protocol can be found on the PLC4X website.
sinks.machineA.fields=running,conveyorEntry,load,unload,transferLeft,transferRight,conveyorLeft,conveyorRight,numLargeBoxes,numSmallBoxes,testString
sinks.machineA.fields.running=RANDOM/Running:Boolean
sinks.machineA.fields.conveyorEntry=RANDOM/ConveyorEntry:Boolean
sinks.machineA.fields.load=RANDOM/load:Boolean
sinks.machineA.fields.unload=RANDOM/UnLoad:Boolean
sinks.machineA.fields.transferLeft=RANDOM/TransferLeft:Boolean
sinks.machineA.fields.transferRight=RANDOM/TransferRight:Boolean
sinks.machineA.fields.conveyorLeft=RANDOM/ConveyorLeft:Boolean
sinks.machineA.fields.conveyorRight=RANDOM/ConveyorRight:Boolean
sinks.machineA.fields.numLargeBoxes=RANDOM/NumLargeBoxes:Integer
sinks.machineA.fields.numSmallBoxes=RANDOM/NumSmallBoxes:Integer
sinks.machineA.fields.testString=RANDOM/TestString:String

#We can have multiple sinks/tasks per Connnector.
sinks.machineB.connectionString=simulated://127.0.0.1
sinks.machineB.topic=machineSinkB
sinks.machineB.timeout=5000
sinks.machineB.retries=5
sinks.machineB.fields=running,conveyorEntry
sinks.machineB.fields.running=RANDOM/Temporary:Boolean
sinks.machineB.fields.conveyorEntry=RANDOM/Temporary:Boolean

#-----Kafka Specific properties.
bootstrap.servers=127.0.0.1:9092
key.converter=org.apache.kafka.connect.json.JsonConverter
value.converter=org.apache.kafka.connect.json.JsonConverter
#key.converter=io.confluent.connect.avro.AvroConverter
#value.converter=io.confluent.connect.avro.AvroConverter
#key.converter.schema.registry.url:http://127.0.0.1:8081
#value.converter.schema.registry.url:http://127.0.0.1:8081
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.file.filename=/tmp/connect.offsets
offset.flush.interval.ms=10000
plugin.path=/usr/local/share/kafka/plugins
errors.log.enable = true
errors.tolerance=all
