tzulitai commented on a change in pull request #63: [FLINK-16557][docs] Document YAML-ized Kafka egresses / ingresses in … URL: https://github.com/apache/flink-statefun/pull/63#discussion_r396063200
########## File path: statefun-docs/docs/io_module/kafka.rst ########## @@ -90,30 +225,111 @@ It accepts the following arguments: 1) The egress identifier associated with this egress 2) The address of the bootstrap servers -3) A ``KafkaEgressSerializer`` for serializing data into Kafka +3) A ``KafkaEgressSerializer`` for serializing data into Kafka (Java only) 4) The fault tolerance semantic 5) Properties for the Kafka producer -.. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/kafka/EgressSpecs.java - :language: java - :lines: 18- +.. tabs:: + + .. group-tab:: Java + + .. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/kafka/EgressSpecs.java + :language: java + :lines: 18- + + .. group-tab:: Yaml + + .. code-block:: yaml + + version: "1.0" + + module: + meta: + type: remote + spec: + egresses: + - egress: + meta: + type: statefun.kafka.io/generic-egress + id: example/output-messages + spec: + address: kafka-broker:9092 + deliverySemantic: + type: exactly-once + transactionTimeoutMillis: 100000 + properties: + - foo.config: bar Please refer to the Kafka `producer configuration <https://docs.confluent.io/current/installation/configuration/producer-configs.html>`_ documentation for the full list of available properties. Kafka Egress and Fault Tolerance -"""""""""""""""""""""""""""""""" +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ With fault tolerance enabled, the Kafka egress can provide exactly-once delivery guarantees. -You can choose three different modes of operating based through the ``KafkaEgressBuilder``. +You can choose three different modes of operation. + +**None** + +Nothing is guaranteed, produced records can be lost or duplicated. + +.. tabs:: + + .. group-tab:: Java + + .. code-block:: none + + KafkaEgressBuilder#withNoProducerSemantics(); + + .. group-tab:: Yaml + + .. code-block:: yaml + + deliverySemantic: + type: none + +**At Least Once** + +Stateful Functions will guarantee that nor records will be lost but they can be duplicated. + +.. tabs:: + + .. group-tab:: Java + + .. code-block:: none + + KafkaEgressBuilder#withNoProducerSemantics(); + + .. group-tab:: Yaml + + .. code-block:: yaml + + deliverySemantic: + type: none Review comment: Should be `type: at-least-once` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
