You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Improving Kafka connectors example
* Added docker-compose with local kafka cluster
* Aligned expected record schema with schema generated by Flink DataGenerator example
@@ -17,56 +17,55 @@ The JSON input follows the structure set in `Stock.java` and can be automaticall
17
17
18
18
,
19
19
20
-
> In this example, the Kafka Sink uses *exactly-once* delivery guarantees. This leverages Kafka transaction under the hood, improving guarantees but
21
-
> adding some overhead and increasing the effective latency of the output to the consumers of the destination Kafka topic.
22
-
>
23
-
> Moreover, there are failure scenarios were the Kafka Sink may still cause duplicates, even when set for exactly-once guarantees.
24
-
> See [FLIP-319](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=255071710) for more details.
25
-
>
26
-
> We recommend not to consider Kafka Sink *exactly-once* guarantees as a default setting for all sinks to Kafka.
27
-
> Make sure you understand the implications before enabling it. Refer to the [Flink Kafka sink documentation](https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/connectors/datastream/kafka/#fault-tolerance) for details.
and [`FlinkKafkaProducer`](https://nightlies.apache.org/flink/flink-docs-release-1.18/docs/connectors/datastream/kafka/#kafka-producer)
32
23
were removed in Flink 1.17 and 1.15, respectively.
33
24
34
-
## Runtime configuration
25
+
###Runtime configuration
35
26
36
27
When running on Amazon Managed Service for Apache Flink the runtime configuration is read from *Runtime Properties*.
37
28
38
29
When running locally, the configuration is read from the [`resources/flink-application-properties-dev.json`](resources/flink-application-properties-dev.json) file located in the resources folder.
The properties in the `AuthProperties` group are passed to both Kafka Source and Kafka Sink configurations.
52
+
53
+
### Data Generator
62
54
55
+
To generate the JSON data expected by this example, you can use the Python [data-generator](../../python/data-generator)
56
+
script you can find in the Python examples.
63
57
64
-
## Running locally in IntelliJ
58
+
Alternatively, you can use the [Flink DataGenerator](../FlinkDataGenerator) application, which generates the same schema.
65
59
66
-
> Due to MSK VPC networking, to run this example on your machine you need to set up network connectivity to the VPC where MSK is deployed, for example with a VPN.
67
-
> Alternatively, you can use a local Kafka installation, for example in a container.
68
-
> Setting up the connectivity or a local containerized Kafka depends on your set up and is out of scope for this example.
60
+
### Running locally in IntelliJ
61
+
62
+
To run the example locally we provide a [docker-compose](docker/docker-compose.yml) file which starts a local Kafka cluster
63
+
with 3 brokers on `locakhost:9092`, `locakhost:9093`, and `locakhost:9094`.
64
+
It also runs a Kafka UI responding on `http://localhost:8080`.
69
65
70
66
You can run this example directly in IntelliJ, without any local Flink cluster or local Flink installation.
71
67
68
+
Note that you can run both the [Flink DataGenerator](../FlinkDataGenerator) and this example locally, in the IDE, to observe
69
+
data being consumed and re-published to Kafka.
70
+
72
71
See [Running examples locally](../running-examples-locally.md) for details.
0 commit comments