Kafka plug-in structure
In this topic you can find information about configuring Kafka event sources and Kafka event conditions.
Configuring a Kafka event source
A Generic event source that receives Kafka event types can be configured in the
following way:
- Bootstrap Server
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required
- Topic
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required
- Security protocol
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required*
- Values:
PLAINTEXTSASL_PLAINTEXTSSLSASL_SSL
- Default: if no security protocol is specified, the
default value is
PLAINTEXT
- identificationAlgo
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required*
- saslMechanism
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required*
- Values:
PLAINGSSAPISCRAM-SHA-256OAUTHBEARERSCRAM-SHA-512
- Default: if no SASL mechanism is specified, the default
value is
PLAIN
- Username
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required*
- Password
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required*
- isPassword
- pollInMS
-
- Type: nonnegativeinteger
- minlength: 1
- maxlength: 1000
- Default: if no value is specified for the interval, the default value is 100
- kerberosPrincipal
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required*
- kerberosKeytab
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required*
- kerberosService
-
- Type: string
- minlength: 1
- maxlength: 1000
- Required*
- groupID
-
- Type: string
- minlength: 1
- maxlength: 1000
- Default: if no group ID is specified, the default value is the name of the event source consumer
Note:
- If the
securityProtocolis set toSSLorSASL_SSL, theidentificationAlgois used to enable the hostname verification. - If the
securityProtocolis set toSASL_PLAINTEXTorSASL_SSL, thesaslMechanismis optional. - If the
saslMechanismis set toPLAIN,SCRAM-SHA-256orSCRAM-SHA-512, theusernameandpasswordare required. - If the
saslMechanismis set toGSSAPI, thekerberosPrincipal,kerberosKeytabandkerberosServiceare required.
Example
The following is an example of a generic type event source configured to receive
Kafka event types:
$eventsource
EVENT_SOURCE /Kafka1
DESCRIPTION "Kafka testing"
PLUGIN Kafka
TYPE Generic
CONFIGURATION {
"bootstrapServer": "bootstrapservervalue",
"topic": "topicvalue",
"securityProtocol": "SASL_SSL",
"identificationAlgo": "identificationAlgovalue",
"saslMechanism": "GSSAPI",
"kerberosPrincipal": "kerberosPrincipalvalue",
"kerberosKeytab": "kerberosKeytabvalue",
"kerberosService": "kerberosServicevalue",
"pollInMs": "30"
}
ENDKafka event condition
Kafka event type event conditions can be configured in workflows specifying
the following required properties:
- NameRestriction: If you want to start the event condition name with the prefix "in", ensure that the name is enclosed within double quotes.
- Type
- Event source
Note: When defining event conditions, all the relative
fields are case insensitive
You can also specify any number of
properties that filter the events received from the event source:- Message
- Type: string
- Operator:
EQ("=")orNE("!=") - minlength: 1
- maxlength: 1000
- Wildcard allowed: true
- Multiple filters: false
- Single predicate: true
- Case sensitive: false
- Key
- Type: string
- Operator:
EQ("=")orNE("!=") - minlength: 1
- maxlength: 1000
- Wildcard allowed: true
- Multiple filters: false
- Single predicate: true
- Case sensitive: false
- Partition
- Type: string
- Operator:
EQ("=")orNE("!=") - minlength: 1
- maxlength: 1000
- Wildcard allowed: true
- Multiple filters: false
- Single predicate: true
- Case sensitive: false
Example
The following is an example of a workflow with two Kafka
event conditions:
$jobstream
WORKFLOW /WS_AGT_1#/WF_EVT_TRIGGER_KAFKA
TRIGGER TRIGGER_KAFKA1 DESCRIPTION "Sample event trigger" TIMEOUT PT1M CONDITIONS
NAME messagebody TYPE "Kafka/KafkaEvent" SOURCE /KAFKA1 FILTERS message = "test message"
NAME KafkaKey TYPE "Kafka/KafkaEvent" SOURCE /KAFKA1 FILTERS key = mockKafkaKey
ENDTRIGGER
:
END