KafkaAboutToProduceMessageCb Property

General info

Label

Preprocess Callback

Description

Enter script for custom preprocessing of values for outgoing kafka messages.

Data type

String

Default value

"return function(item_numid, v, q, t) end"

Type

Regular

Code

13141

Symbolic name

MODEL_PROP_KAFKAABOUTTOPRODUCEMESSAGECB

Lua access code

syslib.model.properties.KafkaAboutToProduceMessageCb

Available since

1.84

Parent properties

KafkaIOItemProducerProperties

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.

Examples

Read from or write to the KafkaAboutToProduceMessageCb property.

  • Lua

  • C#

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

-- Write to the KafkaAboutToProduceMessageCb
syslib.setvalue("<OBJECT FULL PATH>.KafkaIOItemProducerProperties.KafkaAboutToProduceMessageCb", "return function(item_numid, v, q, t) end")
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);

// Read from the KafkaAboutToProduceMessageCb
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.KafkaIOItemProducerProperties.KafkaAboutToProduceMessageCb"));
// Write to the KafkaAboutToProduceMessageCb
Result result = sli.WriteValue(sc, new WriteItem("return function(item_numid, v, q, t) end", "<OBJECT FULL PATH>.KafkaIOItemProducerProperties.KafkaAboutToProduceMessageCb"));