The connector for Apache Kafka listener continually monitors a Kafka topic for messages.
When a message is produced on a topic, the listener fetches the message and passes it to a listener
notification for further processing.
Before you begin
To create a listener for a project, you must have a Kafka consumer account that is created and
enabled. For more information, see Kafka.
Procedure
-
Go to the project in which you want to create a listener.
- Click Events > Listeners.
- Click New Listener. The Add Listener screen
appears.
- Enter the required details in the Add Listener screen.
- In the Type of listener field, select Kafka from the list for
which you want to create a listener.
- In the Select version field, select the connector
version.
- Enter the required details in the Listener page of the
Add Listener configuration screen.
- In the Listener name field, provide a name of the listener that
listens for messages on a Kafka topic.
- In the Connection name field, specify a name of the connection
that the listener must use to connect to the server to retrieve messages. From the list of
connections, select an appropriate consumer connection.
Note: The list contains both the producer and consumer connections. Select the consumer
connection.
- In the Retry limit field, specify a value for the number of
reconnection attempts a listener makes when it fails to connect or loses its connection with the
Kafka server. The default value is 5.
- In the Retry backoff timeout (ms) field, specify a time in
milliseconds that must elapse between each of the retries that are specified in the Retry
Limit. The default value is 10.
- In the Topic name(s) field, specify a comma-separated list of
topics on which the Kafka listener listens.
- In the Poll interval (ms) field, specify the polling interval
time in milliseconds. The default value is 10000.
- In the Partition(s) field, specify a comma-separated list of
partitions.
- In the Offset(s) field, specify a comma-separated offset from
where the consumer needs to start consuming the messages.
Note:
- The number of offsets cannot be greater than the number of partitions.
- Listener is not supported for multiple topic subscriptions when multiple partitions or seek
offset are provided.
- The offset values are ignored if the partition is not specified.
- Click Next. The Overview page
appears.
- Review the listener configuration details.
- Click Add listener. The listener is saved and
enabled.
- Click Done to complete and close the listener configurations
without adding the Listener Notification. If you want to continue adding a
listener notification, click Next. For more information, see Adding Kafka listener notifications.