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.
This page contains the following information:
Kafka account is used to connect with Kafka Server. While creating Kafka account, you need to define the following properties which are used to connect to Kafka Server.
Click Configure > ACCOUNTS > Kafka.
In the Security Protocol field, enter the protocol used to communicate with brokers.
The supported protocols are PLAINTEXT and SSL. For SSL:
|
In the Addon Configuration window, enter the Add On Configurations to be used in back end for performing operation on Kafka server (e.g. param1=value,param2=value..).
Here you can use properties which are not listed on this Kafka account creation interface, for example, you may need to use a property called Serializer that converts the data to bytes. You can find the properties available at this location. |
Follow the steps below to create Kafka listener:
In the Kafka Account field, select the Kafka account. You can create a new Kafka account by clicking .
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.
You can select multiple topics. |
In the Message Type field, select the message format.
The supported message formats are JSON, XML, and PLAINTEXT. |
Click Save.
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. |
You can activate or deactivate a Kafka Listener by clicking on the Kafka listener manage page.
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. |
Follow the steps below to create Kafka target:
In the Kafka Account field, select the Kafka account.
In the Topic(s) field, select the topic to be used.
In the Message Type field, select the message format.
The supported message formats are JSON, XML, and PLAINTEXT. |
In the Message Splitter field, enter the delimiter based on which the messages will be splitted.
It depends on the Message Type.
In the Request Required Acks field, select the number of acknowledgments the producer requires the leader to have received before considering a request complete.
This controls the durability of records that are sent. The following settings are common:
if set to zero then the producer will not wait for any acknowledgment from the server at all. The record will be immediately added to the socket buffer and considered sent. No guarantee can be made that the server has received the record in this case, and the retries configuration will not take effect (as the client won't generally know of any failures). The offset given back for each record will always be set to -1.
if set to 1 then this will mean the leader will write the record to its local log but will respond without awaiting full acknowledgement from all followers. In this case should the leader fail immediately after acknowledging the record but before the followers have replicated it then the record will be lost.
if set to all then this means the leader will wait for the full set of in-sync replicas to acknowledge the record. This guarantees that the record will not be lost as long as at least one in-sync replica remains alive. This is the strongest available guarantee.
In the Request Timeout field, enter the amount of time the broker will wait trying to meet the RequestRequiredAcks requirement before sending back an error to the client.
In the Number of Retries field, enter the value.
Setting a value greater than zero will cause the client to resend any record whose send fails with a potentially transient error. Note that this retry is no different than if the client resent the record upon receiving the error. Allowing retries will potentially change the ordering of records because if two records are sent to a single partition, and the first fails and is retried but the second succeeds, then the second record may appear first.
In the Select Project field, select the project
Click Save.
You can consume and publish a Kafka message using a template. The sections below describe how a Kafka message can be used in a template.
To consume a Kafka message in a template, you can use that message as a source in the template. Follow the steps below to achieve this:
To publish a Kafka message in a template, you can use that message as a destination in the template. Follow the steps below to achieve this: