Skip to content

Commit

Permalink
Usage of configuration file in JSON format for the Sink connector (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfinocchiaro authored Sep 4, 2024
1 parent ff1d0c9 commit 01800c3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,7 @@ To manually install Kafka Connect Lightstreamer Sink Connector to a local Conflu

3. Edit the connector configuration properties file as detailed in the [Configuration Reference](#configuration-reference) section.

You may want to use the provided [`quickstart-lightstreamer-local.properties`](./kafka-connector-project/config/kafka-connect-config/connect-standalone-local.properties) file as starting pint. This file provides the set of pre-configured settings to feed Lightstreamer with stock market events, as already shown in the [installation instruction](#installation) for the Lightstreamer Kafka Connector.
You may want to use the provided [`quickstart-lightstreamer-local.properties`](./kafka-connector-project/config/kafka-connect-config/quickstart-lightstreamer-local.properties) or [`quickstart-lightstreamer-local.json`](./kafka-connector-project/config/kafka-connect-config/quickstart-lightstreamer-local.json) files as starting pint. This file provides the set of pre-configured settings to feed Lightstreamer with stock market events, as already shown in the [installation instruction](#installation) for the Lightstreamer Kafka Connector.

4. Launch the Lightstreamer Server instance already configured in the [Lightstreamer Setup](#lightstreamer-setup) section.

Expand Down
2 changes: 2 additions & 0 deletions examples/quickstart-kafka-connect/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ services:
- connect-standalone
- /config/connect-standalone-docker.properties
- /config/quickstart-lightstreamer-docker.properties
# You may also use the provided json file:
#- /config/quickstart-lightstreamer-docker.json
depends_on:
- broker
- lightstreamer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "lightstreamer-sink",
"connector.class": "com.lightstreamer.kafka.connect.LightstreamerSinkConnector",
"topics": "stocks",
"lightstreamer.server.proxy_adapter.address": "lightstreamer:6661",
"lightstreamer.server.proxy_adapter.socket.connection.setup.timeout.ms": 15000,
"lightstreamer.server.proxy_adapter.socket.connection.setup.max.retries": 5,
"lightstreamer.server.proxy_adapter.socket.connection.setup.retry.delay.ms": 15000,
"item.templates": "stock-template:stock-#{index=KEY}",
"topic.mappings": "stocks:item-template.stock-template",
"record.mapping": "timestamp:#{VALUE.timestamp},time:#{VALUE.time},stock_name:#{VALUE.name},last_price:#{VALUE.last_price},ask:#{VALUE.ask},ask_quantity:#{VALUE.ask_quantity},bid:#{VALUE.bid},bid_quantity:#{VALUE.bid_quantity},pct_change:#{VALUE.pct_change},min:#{VALUE.min},max:#{VALUE.max},ref_price:#{VALUE.ref_price},open_price:#{VALUE.open_price},item_status:#{VALUE.item_status},ts:#{TIMESTAMP},topic:#{TOPIC},offset:#{OFFSET},partition:#{PARTITION}"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "lightstreamer-sink",
"connector.class": "com.lightstreamer.kafka.connect.LightstreamerSinkConnector",
"topics": "stocks",
"lightstreamer.server.proxy_adapter.address": "localhost:6661",
"lightstreamer.server.proxy_adapter.socket.connection.setup.timeout.ms": 15000,
"lightstreamer.server.proxy_adapter.socket.connection.setup.max.retries": 5,
"lightstreamer.server.proxy_adapter.socket.connection.setup.retry.delay.ms": 15000,
"item.templates": "stock-template:stock-#{index=KEY}",
"topic.mappings": "stocks:item-template.stock-template",
"record.mapping": "timestamp:#{VALUE.timestamp},time:#{VALUE.time},stock_name:#{VALUE.name},last_price:#{VALUE.last_price},ask:#{VALUE.ask},ask_quantity:#{VALUE.ask_quantity},bid:#{VALUE.bid},bid_quantity:#{VALUE.bid_quantity},pct_change:#{VALUE.pct_change},min:#{VALUE.min},max:#{VALUE.max},ref_price:#{VALUE.ref_price},open_price:#{VALUE.open_price},item_status:#{VALUE.item_status},ts:#{TIMESTAMP},topic:#{TOPIC},offset:#{OFFSET},partition:#{PARTITION}"
}

0 comments on commit 01800c3

Please sign in to comment.