Chapter 20. Configuring a KIE Server to send and receive Kafka messages from the process
To run a process that sends or receives Kafka messages (except when using the custom task), you must use a KIE Server. You must configure this KIE Server to integrate with Red Hat AMQ Streams.
Procedure
To enable integration with Red Hat AMQ Streams, set the following system properties according to your environment:
-
If you are using the KIE Server on Red Hat JBoss EAP, set the
org.kie.kafka.server.ext.disabled
system property of the KIE Server tofalse
. -
If you are using Spring Boot, set the
kieserver.kafka.enabled
system property totrue
.
-
If you are using the KIE Server on Red Hat JBoss EAP, set the
-
To configure the connection to the Kafka broker, set the
org.kie.server.jbpm-kafka.ext.bootstrap.servers
system property to the host and port of the broker. The default value islocalhost:9092
. You can use a comma-separated list of multiple host:port pairs. Optional: Set any of the following system properties to configure sending and receiving Kafka messages:
-
org.kie.server.jbpm-kafka.ext.client.id
: An identifier string to pass to the broker when making requests. Red Hat AMQ Streams uses this string for logging. -
org.kie.server.jbpm-kafka.ext.topics.*
: Mapping of message names to topic names. For example, if you want to send or receive a message in theExampleTopic
topic whenExampleName
is the name of the message, set theorg.kie.server.jbpm-kafka.ext.topics.ExampleName
system property toExampleTopic
. You can set any number of such system properties. If a message name is not mapped using a system property, the process engine uses this name as the topic name.
-
Optional: Set any of the following system properties to configure receiving Kafka messages:
-
org.kie.server.jbpm-kafka.ext.allow.auto.create.topics
: Allow automatic topic creation. Enabled by default. -
org.kie.server.jbpm-kafka.ext.group.id
: A unique string that identifies the group to which this Kafka message consumer belongs. The default value isjbpm-consumer
.
-
Optional: Set any of the following system properties to configure sending Kafka messages:
-
org.kie.server.jbpm-kafka.ext.acks
: The number of acknowledgements that the Kafka leader must receive before marking the request as complete. The default value is1
, which means the leader writes the record to its local log and then responds to the process engine, without waiting for full acknowledgement from all followers. -
org.kie.server.jbpm-kafka.ext.max.block.ms
: The number of milliseconds for which the publish method blocks. After this time, the process engine can resume execution of the business process. The default value is2000
(2 seconds).
-