#
# 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-source
connector.class=org.apache.plc4x.kafka.Plc4xSourceConnector
default.topic=DefaultTopic
tasks.max=2

#----PLC4X specific properties
#List of source names. Each source is a specification for a device.
#It can containg mulitple job references
sources=machineA

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

#The source 'poll' method should return control to Kafka Connect every so often.
#This value controls how often it returns when no messages are received.
sources.machineA.pollReturnInterval=5000

#There is an internal buffer between the PLC4X scraper and Kafka Connect.
#This is the size of that buffer.
sources.machineA.bufferSize=1000

#A list of jobs associated with this source.
sources.machineA.jobReferences=simulated-dashboard,simulated-heartbeat

#The Kafka topic to use to produce to. The default topic will be used if this isn't specified.
sources.machineA.jobReferences.simulated-heartbeat.topic=simulated-heartbeat-topic

#A list of jobs specified in the following section.
jobs=simulated-dashboard,simulated-heartbeat

#The poll rate for this job. the PLC4X scraper will request data every interval (ms).
jobs.simulated-dashboard.interval=1000

#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.
jobs.simulated-dashboard.fields=running,conveyorEntry,load,unload,transferLeft,transferRight,conveyorLeft,conveyorRight,numLargeBoxes,numSmallBoxes,testString
jobs.simulated-dashboard.fields.running=RANDOM/Running:Boolean
jobs.simulated-dashboard.fields.conveyorEntry=RANDOM/ConveryEntry:Boolean
jobs.simulated-dashboard.fields.load=RANDOM/Load:Boolean
jobs.simulated-dashboard.fields.unload=RANDOM/Unload:Boolean
jobs.simulated-dashboard.fields.transferLeft=RANDOM/TransferLeft:Boolean
jobs.simulated-dashboard.fields.transferRight=RANDOM/TransferRight:Boolean
jobs.simulated-dashboard.fields.conveyorLeft=RANDOM/ConveyorLeft:Boolean
jobs.simulated-dashboard.fields.conveyorRight=RANDOM/ConveyorRight:Boolean
jobs.simulated-dashboard.fields.numLargeBoxes=RANDOM/NumLargeBoxes:Integer
jobs.simulated-dashboard.fields.numSmallBoxes=RANDOM/NumSmallBoxes:Integer
jobs.simulated-dashboard.fields.testString=RANDOM/TestString:STRING

jobs.simulated-heartbeat.interval=500
jobs.simulated-heartbeat.fields=active
jobs.simulated-heartbeat.fields.active=RANDOM/Temporary:Integer

#-----Kafka Specific properties.
bootstrap.servers=localhost: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
enable.idempotence=true
acks=all
