Kafka Config Reference

Below is a comprehensive list of each configuration option on the Kafka driver with its default, a description of its purpose and what effect it will have.

The driver options are set on the Drivers screen. The options a tag uses to consume from Kafka are set per tag on the Tags screen, and are listed under Consumer tag properties.

Minimum configuration requirements

These are the fields that need a value before the driver will do anything. Everything else has a working default.

FieldNeeded forNotes
Driver Interface NameBothThe name tags refer to in Select Driver Interface.
DriverBothSet to Kafka.
Bootstrap ServersBothDefaults to localhost:9092, which is a real address - the driver will try it.
EnableBothThe interface is not active until this is on and the changes are applied.
Publish Selected TagsProducerOff by default. A driver interface with this off is a consumer only.
Tags To PublishProducerNothing is published until tags are added.
TopicConsumerSet on the tag, not on the driver.

Driver interface

PropertyDefaultNotes
Driver Interface Name-The name used to identify this driver interface. Tags reference it from their Select Driver Interface property.
DriverModbusSet to Kafka to produce and consume with Apache Kafka clusters.
EnableonEnable communications. Hidden when Enable by Tag is on.
Enable by TagoffEnable and disable the driver from a Boolean tag instead, named in the field beside it.
Good Quality When DisabledoffOn: tags on this driver keep good quality while the driver is disabled, and can be written to. Off: they go to bad quality.
SimulateoffDisable communications and hold every value static with good quality.
Return to Online60 SecondsHow often to re-check communications after the interface has been taken offline.

Connection

PropertyDefaultNotes
Bootstrap Serverslocalhost:9092Comma-delimited list of broker addresses as host:port. This is a seed list only - the addresses are used to fetch cluster metadata and the full broker set is then learned from the cluster, so listing more than one buys startup and reconnect resilience rather than load balancing. Every entry must be a broker of the same cluster; a disaster-recovery cluster belongs in Failover Bootstrap Servers, not here.
Security ProtocolPlaintextPlaintext, Ssl, SaslPlaintext or SaslSsl. Plaintext suits a cluster on the local network; a hosted cluster will want SSL or SASL.
SASL MechanismPlainGssapi, Plain, ScramSha256, ScramSha512 or OAuthBearer. Shown for the SASL protocols.
SASL UsernameblankShown for Plain, ScramSha256 and ScramSha512. For Confluent Cloud this is the API key.
SASL PasswordblankAs above. For Confluent Cloud this is the secret.

TLS certificates

Shown when the Security Protocol is Ssl or SaslSsl. Each certificate can be given as a file path or pasted as PEM text - use one or the other, not both.

PropertyDefaultNotes
SSL CA LocationblankPath to the CA certificate file.
SSL CA PemblankThe CA certificate as PEM text.
SSL Certificate LocationblankPath to the client certificate file.
SSL Certificate PemblankThe client certificate as PEM text.
SSL Key LocationblankPath to the client private key file.
SSL Key PemblankThe client private key as PEM text.
SSL Key PasswordblankPassphrase for an encrypted private key.
SSL Keystore LocationblankPath to a PKCS#12 keystore, as an alternative to the separate certificate and key.
SSL Keystore PasswordblankPassword for the keystore.

Producer tuning

These tune throughput against latency on the producer side. Each has a working default, and the defaults suit most clusters.

PropertyDefaultNotes
AcksLeaderNone, Leader or All. How many brokers must acknowledge a write before it counts as delivered. All is the durable choice; None is the fastest and can lose messages.
Client Idoas-kafkaThe identifier the driver sends with its requests, and what the broker logs it as.
Compression TypeNoneNone, Gzip, Snappy, Lz4 or Zstd.
Batch Num Messages10000Maximum number of messages in one producer batch.
Batch Size1000000Maximum size in bytes of one producer batch.
Linger5 msHow long to wait for more messages before sending a batch. Higher gives larger, better-compressed batches at the cost of latency.
Max In Flight1000000Requests allowed in flight per broker connection before the producer blocks.
Message Max Bytes1000000Maximum size of a single message. Must not exceed the broker's own limit.
Message Timeout300000 msHow long the producer keeps trying to deliver a message before it fails.
Queue Buffering Max Kbytes1048576Maximum total size of the producer's send queue.
Queue Buffering Max Messages100000Maximum number of messages in the producer's send queue.
Request Timeout30000 msHow long to wait for a broker to answer a produce request.
Socket Connection Timeout30000 msHow long to wait for a broker socket to be set up.
Socket Keepalive EnableoffEnable TCP keep-alives on broker sockets.
Socket Timeout60000 msHow long a broker socket may stall before it is treated as failed.
Transaction Timeout60000 msHow long a transaction may remain open.

Topic creation

PropertyDefaultNotes
Automatically Create TopicsonBefore a topic is written to for the first time, create it if it does not exist already.
Replication Factor-1Used when a topic is created. -1 leaves it to the broker's default. Shown when Automatically Create Topics is on.
Number Partitions-1Used when a topic is created. -1 leaves it to the broker's default. Shown when Automatically Create Topics is on.

Message format New

PropertyDefaultNotes
Output FormatDefaultDefault - JSON, with field names taken from the payload field names. ISA-95 Lite - the built-in unified namespace schema. Custom AVRO Schema - your own schema.
Batched MessagesonOn: the tags of each publish that share a topic go in one message, up to Max Tags Per Publish. Off: each tag value is published as its own message, still using the same structure. Shown with the Default format, and New with Custom AVRO Schema when Publish All Tags As One Topic is on: there, a schema needs a tag array or tag map to hold many tags, and without one each message holds one tag. The same switch is in the Edit AVRO schema dialog.
AVRO SchemablankThe AVRO schema the message is published against, and which part of a tag fills each of its fields. Both are built in the Edit AVRO schema dialog, opened with Edit… - see Schema mapping. Shown when the Output Format is Custom AVRO Schema.
Force AVRO Binary NewoffPublish AVRO binary using the Avro single-object encoding, which carries a fingerprint of the schema in place of a Schema Registry ID. The consumer needs a copy of the same schema, so click Download .avsc beside Output Format and give the file to the consumer - that is what keeps the two ends in step. When this is off, messages are published as JSON. There is no JSON fallback while this is on: a value that cannot be encoded is discarded and logged. With the Default format, changed payload field names, or Publish All Tags As One Topic off, are encoded with a schema that matches them, and Download .avsc gives that schema. Shown when the Schema Registry is off - with the registry on the wire format is already AVRO binary and the schema ID comes from the registry.

ISA-95 Lite

ISA-95 Lite publishes a fixed record aligned with the ISA-95 Part 2 equipment hierarchy model, for a unified namespace. It is not an official ISA or MESA publication.

FieldFilled from
equipmentHierarchy.enterprise .site .siteId .areaThe ISA-95 level assigned to the tag groups that enclose the tag
equipmentHierarchy.workCenter .workCenterTypeWork Center tier - Process Cell, Production Unit, Production Line or Storage Zone
equipmentHierarchy.workUnit .workUnitType .workUnitIdWork Unit tier - Unit, Work Cell or Storage Unit
equipmentHierarchy.equipmentModule .equipmentModuleId .controlModule .controlModuleIdThe lower two tiers
groupPathThe tag's group path verbatim, as an array, at any depth
tagNameThe full tag path
timestampThe tag's own timestamp, as epoch milliseconds
dataTypeBOOLEAN, INT, LONG, FLOAT, DOUBLE or STRING
valueThe tag value
quality.isGood quality.severityOAS quality, normalised to GOOD or BAD
units sourceProtocolThe tag's Units and Data Source
metadataAdditional key/value pairs

Info

The hierarchy fields are resolved by walking the tag groups that enclose the tag and reading the ISA-95 level assigned to each group. A group with no level assigned contributes nothing, and a tag at the root of the configuration publishes null for the hierarchy fields. Where a group has an export name override, the override is published instead of the group's own name.

Schema mapping New

A custom AVRO schema has to be told which part of a tag fills each of its fields. Both the schema and that mapping are built in the Edit AVRO schema dialog, which the MQTT driver and the schema library use too. Its three tabs, Schema Editor, Field Mapping and Data Test, are covered on the shared page: The Edit AVRO schema dialog. Nothing is written back to the driver until you click OK.

On the Kafka driver:

  • A message holds many tags only with Custom AVRO Schema, a schema with a tag array or tag map, Batched Messages on and Publish All Tags As One Topic on. Otherwise each message holds one tag.
  • The new Custom Format and Sequence sources work as they do on the MQTT driver.
  • Data Test shows each message with the Kafka topic it would go to.

Schema Registry New

PropertyDefaultNotes
Enable Schema RegistryoffConnect to a Confluent Schema Registry for AVRO schema management.
Schema Registry URLblankFor example http://localhost:8081.
UsernameblankIf the registry requires authentication.
API KeyblankEntered as a password.
Subject NameblankThe subject to register or retrieve schemas under. Leave blank to register under <topic name>-value. The name is used exactly as written: it cannot hold variables, braces are kept as typed, and the web app warns about them. New Required when Publish Topic Id is a topic pattern and Publish All Tags As One Topic is on: left blank, the driver does not connect, raises a schema alarm, and the web app shows an error on the setting.

Warning

With the Schema Registry enabled and the Default output format, the message always follows the standard Default schema, with its fixed field names - values, id, value, quality, timestamp - and always includes quality and timestamp. That holds with Publish All Tags As One Topic off too. The payload field names below do not apply and are hidden; Timestamp Type and its Format still do.

With a topic pattern, the schema is registered once, when the driver connects, under the one Subject Name, and every topic's messages carry its ID. A subject for each topic is not supported.

Publishing

Publishing is off until Publish Selected Tags is turned on. A driver interface with it off is a consumer only.

PropertyDefaultNotes
Publish Selected TagsoffTurns publishing on for this driver interface.
Tags To Publish-The tags to publish, each with the Id that names it in the message. The Id is also the topic when Publish All Tags As One Topic is off. A tag can be listed more than once, each time with a different Id, and is published under every Id. An Id can be made of parts separated by a vertical bar, such as SITE-A|PQM-1|P01, which {tagIdPart1}, {tagIdPart2} and so on read - see Message Variables. The spaces around each part are dropped.
Publish TypeContinuousContinuous on an interval, Event Driven from a trigger tag, or Specific Time of Day.
Publish Interval10 SecondsContinuous only.
Publish On StartuponContinuous only. Publish immediately on startup rather than waiting out the first interval.
Trigger Tag-Event Driven only. A Boolean tag triggers on transition; an Integer tag triggers whenever its value changes to a non-zero value.
Digital Trigger TypeFalse to TrueEvent Driven only. False to True, True to False or Both.
Time of Day-Specific Time of Day only.
Publish Latest Value OnlyonOn: publish only the current value of each tag. Off: publish every value change since the last publish. Turn this off when the target is a historian.
Publish Boolean As NumberoffPublish 1 and 0 rather than true and false.
Include All Tags Each PublishoffInclude every selected tag in each publish, even the ones that have not changed.
Include Tags For PeriodoffInclude all tag values in each publish for the period set beside it, then drop the unchanged ones from further publishing. The period defaults to 1 second.
Publish All Tags As One TopiconOn: all values go to Publish Topic Id. Off: each tag goes to its own topic, named by its Id in Tags To Publish.
Max Tags Per Publish New1000The most tags in one message, with Batched Messages on - in the Default format, or in a schema with a tag array or tag map. A publish with more is sent as several messages on the same topic, in order. With a topic pattern it limits each topic's message. 0 means no limit: every tag in one message.
Publish Topic Idoas_tagsThe topic used when Publish All Tags As One Topic is on. New It can be a topic pattern, such as oas.{groupPath}, that gives each tag a topic of its own.
Override Value When BadNoneWhat to publish when a tag's quality is bad: None (publish it bad), Do Not Send, Hold Last Value, Set To Value or Hold Then Set.
Override Time60 SecondsHow long to hold the last good value. Shown for Hold Last Value and Hold Then Set.
Value When Bad0The value to publish instead. Shown for Set To Value and Hold Then Set.

Upgrading

A Default format driver with Batched Messages on that publishes more tags at once than Max Tags Per Publish now sends several messages, each with its own values array, where before it sent one. Set Max Tags Per Publish to 0 to keep one message.

Topic patterns New

With Publish All Tags As One Topic on, Publish Topic Id can hold message variables in braces, as on the MQTT driver. Each tag goes to the topic the pattern gives it, the topic is created under that name, and the tags of one publish that share a topic share a message.

Each topic must also be a legal Kafka topic name: 1 to 249 characters of letters, digits, ., _ and -, and not . or ... So:

  • use {groupPath}, {tagPath} and {hierarchyPath}, not their slash forms, which always fail - oas.{groupPath} gives oas.Plant.Line1,
  • a group, tag or override name with a space or any other character outside that set fails, and so does a {property:Name} whose value holds one.

A tag whose topic breaks the rule, or has no value for a variable in it, is not published, and System Errors gets one entry for it. The line under Publish Topic Id in the web app shows an example topic, offers Insert a variable… and Try a tag…, and warns about a topic Kafka would refuse before you apply. Topics are worked out again once a minute.

With the Schema Registry on, a topic pattern needs a Subject Name.

Payload field names

These name the fields inside a Default format message. They do not apply to ISA-95 Lite or Custom AVRO Schema, where the schema's field mapping sets the names, and they do not apply when the Schema Registry is enabled. New They are shown only where they apply: with the Default format and the Schema Registry off. Timestamp Type and its Format are also shown with the Schema Registry on, whose message always carries the timestamp. Values saved before are kept.

PropertyDefaultNotes
Values IdvaluesThe name of the array that holds the values.
Publish Tag IdidThe field carrying each tag's identifier.
Publish Value IdvalueThe field carrying the value.
Include QualityonInclude the quality with each value.
Id (quality)qualityThe field carrying the quality.
Include TimestamponInclude the timestamp with each value.
Id (timestamp)timestampThe field carrying the timestamp.
Timestamp TypeISO 8601ISO 8601, Unix, Unix ms, Ticks or Custom.
Formatyyyy-MM-dd HH:mm:ss.ffffffShown when the Timestamp Type is Custom.

Store and Forward

PropertyDefaultNotes
Enable Store and ForwardoffBuffer values when the cluster cannot be reached, rather than discarding them, and forward them once communication is restored.
Last In First OutoffProcess buffered data newest first. Shown when Store and Forward is on, and requires Store Buffer to Disk.

Info

Where the buffer is kept is not a driver property. It is set once for the whole engine under Configure → Options → Store and Forward: Store Buffer to Disk, Directory for Buffer, Limit Disk Buffering and, for buffering data published from a remote engine, Buffer Data for Remote IoT Publish.

Failover

Shown when Enable Failover is on. These describe a second, independent cluster - not more brokers of the primary cluster, which belong in Bootstrap Servers.

PropertyDefaultNotes
Enable FailoveroffEnable fail over to the backup connection when the primary interface fails.
Failover Bootstrap Serverslocalhost:9092Comma-delimited broker addresses of the failover cluster.
Failover Security ProtocolPlaintextAs the primary, for the failover connection.
Failover SASL MechanismPlainShown for the SASL protocols.
Failover SASL UsernameblankShown for Plain, ScramSha256 and ScramSha512.
Failover SASL PasswordblankAs above.
Failover SSL CA LocationblankShown for Ssl and SaslSsl.
Failover SSL CA PemblankAs above.
Failover SSL Certificate LocationblankAs above.
Failover SSL Certificate PemblankAs above.
Failover SSL Key LocationblankAs above.
Failover SSL Key PemblankAs above.
Failover SSL Key PasswordblankAs above.
Failover SSL Keystore LocationblankAs above.
Failover SSL Keystore PasswordblankAs above.
Failover Schema Registry URLblankShown when the Schema Registry is enabled.
UsernameblankThe failover registry's own, beneath Failover Schema Registry URL.
API KeyblankAs above.

Warning

The failover cluster needs its own Schema Registry. Schema IDs are issued by, and only mean anything within, the cluster that issued them, so the failover brokers cannot borrow the primary cluster's registry.

Consumer tag properties

A tag consumes from Kafka through its own properties on the Tags screen, not through the driver.

PropertyDefaultNotes
Data Type-String or JSON. A JSON tag parses the payload into its members; a String tag holds it as text.
Data Source-Set to Kafka.
Select Driver Interface-The Kafka driver interface the tag subscribes through.
TopicblankThe Kafka topic that supplies this parameter's value.
Read OnlyoffThe value cannot be written to.
Write OnlyoffThe value is not read from the topic, but writes are allowed.

Where next