-
Notifications
You must be signed in to change notification settings - Fork 0
/
adapters.xml
86 lines (62 loc) · 4.13 KB
/
adapters.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0"?>
<!--
This is the configuration file of the Lightstreamer Kafka Connector pluggable into Lightstreamer Server.
A very simple variable-expansion feature is available; see
<enable_expansion_for_adapters_config> in the Server's main configuration file.
-->
<!-- Mandatory. Define the Kafka Connector Adapter Set and its unique ID. -->
<adapters_conf id="KafkaConnector">
<metadata_provider>
<!-- Mandatory. Java class name of the Kafka Connector Metadata Adapter. It is possible to provide a
custom implementation by extending this class. -->
<adapter_class>com.lightstreamer.kafka_connector.adapters.pub.KafkaConnectorMetadataAdapter</adapter_class>
<!-- Mandatory. The path of the reload4j configuration file, relative to the deployment folder
(LS_HOME/adapters/lightstreamer-kafka-connector). -->
<param name="logging.configuration.path">log4j.properties</param>
</metadata_provider>
<!-- Mandatory. Kafka Connector allows the configuration of different independent connections to different Kafka
broker/clusters.
Every single connection is configured via the definition of its own Lightstreamer Data Adapter. At least one connection
configuration must be provided.
Since the Kafka Connector manages the physical connection to Kafka by wrapping an internal Kafka Consumer, several
configuration settings in the Data Adapter are identical to those required by the usual Kafka Consumer
configuration.
The Kafka Connector leverages the "name" attribute of the <data_provider> tag as the connection name, which will
be used by the Clients to request real-time data from this specific Kafka connection through a Subscription object.
The connection name is also used to group all logging messages belonging to the same connection.
Its default value is "DEFAULT", but only one "DEFAULT" configuration is permitted. -->
<data_provider name="AirpotDemo">
<!-- ##### GENERAL PARAMETERS ##### -->
<!-- Java class name of the Kafka Connector Data Adapter. DO NOT EDIT IT. -->
<adapter_class>com.lightstreamer.kafka_connector.adapters.KafkaConnectorDataAdapter</adapter_class>
<!-- The Kafka cluster address -->
<param name="bootstrap.servers">localhost:9092</param>
<!-- ##### RECORD EVALUATION SETTINGS ##### -->
<param name="record.consume.from">EARLIEST</param>
<param name="record.key.evaluator.type">STRING</param>
<param name="record.value.evaluator.type">JSON</param>
<!-- ##### RECORD ROUTING SETTINGS ##### -->
<!-- The "Flights" item template, which defines the format of the items the Lighstreamer Clients
must subscribe to to receive real-time updates. -->
<param name="item-template.flights">flights-#{key=KEY}</param>
<!-- Map the topic "Flights" to the previously defined "flights" item template. -->
<param name="map.Flights.to">item-template.flights</param>
<!-- ##### RECORD MAPPING SETTINGS ##### -->
<!-- Extraction of the record key mapped to the field "key". -->
<param name="field.key">#{KEY}</param>
<!-- Extraction of the record value attributes mapped to corresponding field names. -->
<param name="field.destination">#{VALUE.destination}</param>
<param name="field.departure">#{VALUE.departure}</param>
<param name="field.flightNo">#{VALUE.flightNo}</param>
<param name="field.terminal">#{VALUE.terminal}</param>
<param name="field.status">#{VALUE.status}</param>
<param name="field.airline">#{VALUE.airline}</param>
<param name="field.currentTime">#{VALUE.currentTime}</param>
<!-- Extraction of the record timestamp to the field "ts". -->
<param name="field.ts">#{TIMESTAMP}</param>
<!-- Extraction of the record partition mapped to the field "partition". -->
<param name="field.partition">#{PARTITION}</param>
<!-- Extraction of the record offset mapped to the field "offset". -->
<param name="field.offset">#{OFFSET}</param>
</data_provider>
</adapters_conf>