Skip to content

Commit

Permalink
Move sources into kafka-connector-project folder
Browse files Browse the repository at this point in the history
  • Loading branch information
gfinocchiaro committed Mar 14, 2024
1 parent 4249eca commit 0f48f11
Show file tree
Hide file tree
Showing 140 changed files with 2,967 additions and 17 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ This section will guide you through the installation of Kafka Connector to get i

### Deploy

Get the deployment package from the [latest release page](https://github.com/Lightstreamer/Lightstreamer-kafka-connector/releases/latest). Alternatively, check out this repository and run the following command from the project root:
Get the deployment package from the [latest release page](https://github.com/Lightstreamer/Lightstreamer-kafka-connector/releases/latest). Alternatively, check out this repository and run the following command from the [`kafka-connector-project`](kafka-connector-project/) folder:

```sh
./gradlew distribuite
```

which generates the `lightstreamer-kafka-connector-<version>.zip` bundle under the `deploy` folder.
which generates the `lightstreamer-kafka-connector-<version>.zip` bundle under the `kafka-connector-project/deploy` folder.

Then, unzip it into the `adapters` folder of the Lightstreamer Server installation.
Finally, check that the Lightstreamer layout looks like the following:
Expand Down Expand Up @@ -243,10 +243,9 @@ where you have to replace `API.key` and `secret` with the _API Key_ and _secret_

2. Attach a Lightstreamer Consumer.

The [`kafka-connector-utils`](kafka-connector-utils) submodule hosts a simple
Lightstreamer Java client that can be used to test the consumption of Kafka events from any Kafka topics.
The [`kafka-connector-utils`](kafka-connector-project/kafka-connector-utils) submodule hosts a simple Lightstreamer Java client that can be used to test the consumption of Kafka events from any Kafka topics.

Before launching the consumer, you first need to build it with the command:
Before launching the consumer, you first need to build it from the [`kafka-connector-project`](kafka-connector-project/) folder with the command:

```sh
./gradlew distribuiteConsumer
Expand Down Expand Up @@ -306,10 +305,9 @@ where you have to replace `API.key` and `secret` with the _API Key_ and _secret_
where you have to replace `API.key` and `secret` with the _API Key_ and _secret_ generated on the _Confluent CLI_ or from the _Confluent Cloud Console_.

```sh
java -jar deploy/lightstreamer-kafka-connector-samples-producer-all-<version>.jar --bootstrap-servers <kafka.connection.string> --topic stocks --config-file <path/to/config/file>
java -jar deploy/quickstart-producer-all.jar --bootstrap-servers <kafka.connection.string> --topic stocks --config-file <path/to/config/file>
```


4. Check Consumed Events.

After starting the publisher, you should immediately see the real-time updates flowing from the consumer shell:
Expand Down Expand Up @@ -984,9 +982,12 @@ To write an extraction expression, Kafka Connector provides the _Data Extraction

- expressions must evaluate to a _scalar_ value, otherwise an error will be thrown during the extraction process. The error will be handled as per the [configured strategy](#recordextractionerrorstrategy).

The _QuickStart_ [factory configuration file](kafka-connector/src/connector/dist/adapters.xml) shows a basic example, where a simple _direct_ mapping has been defined between every attribute of the JSON record value and a Lightstreamer field with the same name. Of course, thanks to the _Data Extraction Language_, more complex mapping can be employed.
The _QuckStart_ [factory configuration](kafka-connector-project/kafka-connector/src/connector/dist/adapters.xml#L353) shows a basic example, where a simple _direct_ mapping has been defined between every attribute of the JSON record value and a Lightstreamer field with the same name. Of course, thanks to the _Data Extraction Language_, more complex mapping can be employed.

```xml
...
<param name="field.timestamp">#{VALUE.timestamp}</param>
<param name="field.time">#{VALUE.time}</param>
<param name="field.stock_name">#{VALUE.name}</param>
<param name="field.last_price">#{VALUE.last_price}</param>
<param name="field.ask">#{VALUE.ask}</param>
Expand All @@ -999,6 +1000,7 @@ The _QuickStart_ [factory configuration file](kafka-connector/src/connector/dist
<param name="field.ref_price">#{VALUE.ref_price}</param>
<param name="field.open_price">#{VALUE.open_price}</param>
<param name="field.item_status">#{VALUE.item_status}</param>
..
```

##### Filtered Record Routing (`item-template.<template-name>`)
Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart-producer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM gradle AS builder
# Set the working directory
WORKDIR /app

# Copy the project desources
# Copy the project resources
COPY src ./src
COPY build.gradle .
COPY gradlew .
Expand Down
2 changes: 1 addition & 1 deletion examples/utils/helpers.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
HELPER_DIR=$(dirname ${BASH_SOURCE[0]}) ## realpath
projectDir="$HELPER_DIR/../.."
projectDir="$HELPER_DIR/../../kafka-connector-project"

# Alias to the the local gradlew command
_gradle="${projectDir}/gradlew --project-dir ${projectDir}"
Expand Down
File renamed without changes.
67 changes: 67 additions & 0 deletions kafka-connector-project/docs/javadoc/allclasses-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>All Classes and Interfaces (kafka-connector 0.1.0 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="class index">
<meta name="generator" content="javadoc/AllClassesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="all-classes-index-page">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li><a href="com/lightstreamer/kafka_connector/adapters/pub/package-summary.html">Package</a></li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html#all-classes">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="All Classes and Interfaces" class="title">All Classes and Interfaces</h1>
</div>
<div id="all-classes-table">
<div class="caption"><span>Classes</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Class</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="com/lightstreamer/kafka_connector/adapters/pub/KafkaConnectorMetadataAdapter.html" title="class in com.lightstreamer.kafka_connector.adapters.pub">KafkaConnectorMetadataAdapter</a></div>
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
<div class="block">Implementation of a Lightstreamer Metadata Adapter for Lightstreamer Kafka Connector.</div>
</div>
</div>
</div>
</main>
</div>
</div>
</body>
</html>
63 changes: 63 additions & 0 deletions kafka-connector-project/docs/javadoc/allpackages-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>All Packages (kafka-connector 0.1.0 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="package index">
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
</head>
<body class="all-packages-index-page">
<script type="text/javascript">var pathtoroot = "./";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="index.html">Overview</a></li>
<li><a href="com/lightstreamer/kafka_connector/adapters/pub/package-summary.html">Package</a></li>
<li>Class</li>
<li><a href="overview-tree.html">Tree</a></li>
<li><a href="index-all.html">Index</a></li>
<li><a href="help-doc.html#all-packages">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div class="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<div class="header">
<h1 title="All&amp;nbsp;Packages" class="title">All&nbsp;Packages</h1>
</div>
<div class="caption"><span>Package Summary</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Package</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><a href="com/lightstreamer/kafka_connector/adapters/pub/package-summary.html">com.lightstreamer.kafka_connector.adapters.pub</a></div>
<div class="col-last even-row-color">&nbsp;</div>
</div>
</main>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 0f48f11

Please sign in to comment.