KafkaIOItemType Property

General info

Label

Client Type

Description

Kafka IO-item can only be either a producer or a consumer.

Data type

Int32

Default value

1 (syslib.model.codes.KafkaIOItemType.KAFKAIOITEMPRODUCER)

Type

CodingGroup

Code

13143

Symbolic name

MODEL_PROP_KAFKAIOITEMTYPE

Lua access code

syslib.model.properties.KafkaIOItemType

Available since

1.84

Parent classes

IoTypeKafka

Attributes

Name Tooltip
PROP_CONFIGURABLE The property is configurable and can be changed with DataStudio and the various inmation APIs.
PROP_VISIBLE The property is visible in DataStudio and can be read by the inmation APIs.
PROP_HAS_DEFAULT The property has a default value as standard.

Codings

Coding group: KafkaIOItemType

Name Code Label Tooltip

KAFKAIOITEMPRODUCER

1

Producer

The IO-item which is used to send messages to Kafka.

KAFKAIOITEMCONSUMER

2

Consumer

The IO-item which is used to receive messages from Kafka.

Examples

Read from or write to the KafkaIOItemType property.

  • Lua

  • C#

-- Read from the KafkaIOItemType
syslib.getvalue("<OBJECT FULL PATH>.KafkaIOItemType")

-- Write to the KafkaIOItemType
syslib.setvalue("<OBJECT FULL PATH>.KafkaIOItemType",
    syslib.model.codes.KafkaIOItemType.KAFKAIOITEMPRODUCER)
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);

// Read from the KafkaIOItemType
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.KafkaIOItemType"));
// Write to the KafkaIOItemType
Result result = sli.WriteValue(sc, new WriteItem(KafkaIOItemType.KAFKAIOITEMPRODUCER, "<OBJECT FULL PATH>.KafkaIOItemType"));

A switch-like function of the codings.

function get_coding_name(code)
    local _kioit = syslib.model.codes.KafkaIOItemType
    if _kioit.KAFKAIOITEMPRODUCER==code then return 'KAFKAIOITEMPRODUCER'
    elseif _kioit.KAFKAIOITEMCONSUMER==code then return 'KAFKAIOITEMCONSUMER'
    end
end
return get_coding_name(syslib.model.codes.KafkaIOItemType.KAFKAIOITEMPRODUCER)