Kafka messages sometimes remain unprocessed by a JMS source for unexplained reasons. To ensure that all the Kafka messages are consumed and published successfully, Adeptia Connect integrates Apache Kafka using which the application components can create, send, receive, and read messages using reliable communication.
To use Apache Kafka, you need to create a Kafka account and define a Kafka listener and a target. Kafka messages can be consumed and published by a template, transaction, or process flow.
...
- Click Configure > EVENTS > Kafka Listener.
- Click Create Kafka Listener.
- In Create Kafka Listener window, do the following:
- In the Name and Description fields, enter the name and description respectively for the Kafka listener.
In the Kafka Account field, select the Kafka account. You can create a new Kafka account by clicking .
Note Click Test to check if you are able to connect with Kafka server using this Kafka account.
In the Topic(s) field, select the topic to be used.Anchor StepC StepC Tip You can select multiple topics. - In the Consumer Group field, enter the string that uniquely identifies the group of consumer processes to which this consumer belongs. By setting the same consumer group multiple processes indicate that they are all part of the same consumer group.
- In the Key(s) to Filter Messages field, enter the Name of the message key to process. You can use comma to provide multiple message keys.
- In the Consumer Count field, enter the number of consumers that connect to Kafka server.
- In the Process Flow Name field, select the process flow.
- In the Auto Offset Reset field, select the value to define the offset when there is no initial offset in ZooKeeper or if an offset is out of range:
- EARLIEST : Automatically reset the offset to the earliest offset
- LATEST : Automatically reset the offset to the latest offset fail: throw exception to the consumer.
- NONE
- Select the Enable Message Aggregator check box to define the message aggregator properties:
- In the Number of Messages for Aggregation field, enter the number of message should be aggregated.
- In the Aggregation Timespan field, enter the time in seconds, messages received within the provided timespan will be aggregated.
In the Message Type field, select the message format.
Tip The supported message formats are JSON, XML, and PLAINTEXT.
- In the Message Joiner field, enter the delimiter based on which the messages will be aggregated.
It depends on the Message Type.
- XML : It will be an XPath.
- PLAINTEXT : It will be a delimiter.
- JSON : It can be empty or an element name.
- In the Seek To field, select if the Kafka Consumer will read the message from beginning or end on startup.
- In the Heartbeat Interval field, enter the heartbeat interval.
The expected time between heartbeats to the consumer coordinator when using Kafka group management facilities. Heartbeats are used to ensure that the consumers session stays active and to facilitate rebalancing when new consumers join or leave the group. The value must be set lower than session timeout, but typically should be set no higher than 1/3 of that value. It can be adjusted even lower to control the expected time for normal rebalances. - In the Session Timeout field, enter the time interval for session timeout.
The timeout used to detect failures when using Kafka group management facilities. - In the Select Project field, select the project.
Click Save.
Note Kafka Listener and Target created from the manage page are available to be used only in the process flow. Every time you create a template with Kafka as a source, you need to define the properties for the Kafka listener. The same holds true when you create a template with Kafka as a destination.
- In the Name and Description fields, enter the name and description respectively for the Kafka listener.
Activating or deactivating the Kafka Listener
You can activate or deactivate a Kafka Listener by clicking on the Kafka listener manage page.
Note |
---|
Activate or Deactivate options will be available only for the Kafka Listeners that have been created from the manage page and published as a process flow. |
- Once activated, the listener will start consuming the messages from Kafka Server and trigger the process flow for the received message.
- Once deactivated, the listener will stop receiving Kafka messages from server.
Anchor | ||||
---|---|---|---|---|
|
...
- Select Kafka as a source application.
- In the Which event should trigger the data transfer? field, select New Message and click Next.
- In the Provide Kafka account information field, select the Kafka account and click Next.
- In the Kafka Settings page, follow the instructions from the step c through step l from the section Creating Kafka Listener.
- Click Next to complete the steps that follow to create the template.
Publishing Kafka message to a Kafka server
...
- Select Kafka as a destination application.
- In the Provide Kafka account information field, select the Kafka account and click Next.
- In the How the data should be delivered to destination? field, select Send Message and click Next.
- In the Kafka Settings page, follow the instructions from the step c through step l from the section Creating Kafka Target.
- Click Next to complete the steps that follow to create the template.