KafkaKey Property

General info

Label

Key

Description

Key is an optional part of a message payload. Please see the datasource documenation for the effect if this property belongs to an IO-Item.

Data type

String

Type

Regular

Code

12389

Symbolic name

MODEL_PROP_KAFKAKEY

Lua access code

syslib.model.properties.KafkaKey

Available since

1.70

Parent classes

IoTypeKafka

Parent properties

KafkaProducerParameters

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_NULLABLE This Property can have no value.

Examples

Read from or write to the KafkaKey property.

  • Lua

  • C#

-- Read from the KafkaKey
syslib.getvalue("<OBJECT FULL PATH>.SaFGenericBufferInterfaceExtension.KafkaProducerParameters.KafkaKey")

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

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