This project hosts a sample Gradle project you may use as a starting point to provide your implementation of the Kafka Connector Metadata Adapter class.
To customize, build, and deploy an adapter implementation, follow the steps:
Edit the CustomKafkaConnectorAdapter.java file by implementing the required hook methods or provide your completely new custom class that must extend com.lightstreamer.kafka.adapters.pub.KafkaConnectorMetadataAdapter.
Important
Add all required dependencies to the build.gradle file in the dependencies
section.
Build the project with the command:
$ ./gradlew build
which generates the build/libs/custom-kafka-connector-adapter.jar
file.
Update the LS_HOME/adapters/lightstreamer-kafka-connector-<version>/adapters.xml
file by editing the parameter adapter_class as follows:
...
<metadata_provider>
...
<adapter_class>com.lightstreamer.kafka.examples.CustomKafkaConnectorAdapter</adapter_class>
...
</metadata_provider>
...
Copy the generated jar file - along with all dependencies (if any) - under the LS_HOME/adapters/lightstreamer-kafka-connector-<version>/lib
folder.
Start Lighststreamer Server and verify that the console log shows something similar:
12.Mar.24 16:51:36,169 < INFO> Loading Metadata Adapter for Adapter Set KafkaConnector
...
###### Custom KafkaConnector Adapter initialized ######
12.Mar.24 16:51:36,256 < INFO> Finished loading Metadata Adapter for Adapter Set KafkaConnector
...