Rion Williams
10/15/2023, 1:34 PMZhong Chen
10/16/2023, 6:49 PMtransaction api for my app as well, but was very successful. My issue was that the Flink job couldn’t recover from the savepoint after an upgrade.Rion Williams
10/19/2023, 4:11 PMInvalidPidMappingException related to the transactions in Kafka which puts the job into a state where some manual intervention is required. The sources and sinks aren’t terribly crazy either:
// Example Source
KafkaSource.builder<T>()
.setBootstrapServers(parameterTool.get("bootstrap-servers"))
.setTopics(topic)
.setGroupId(parameterTool.get("consumer-group-id"))
.setProperty("isolation.level", "read_committed")
.setStartingOffsets(OffsetsInitializer.committedOffsets(OffsetResetStrategy.EARLIEST))
.setDeserializer(...)
// Example Sink
val producerProperties = Properties().apply {
setProperty("<http://transaction.timeout.ms|transaction.timeout.ms>", parameterTool.get("transaction-timeout-ms"))
}
val transactionPrefix = "${parameterTool.get("transaction-prefix")}-${parameterTool.get("version")}-$topic"
KafkaSink.builder<T>()
.setBootstrapServers(bootstrapServers)
.setDeliverGuarantee(deliveryGuarantee) // DeliveryGuarantee.EXACTLY_ONCE
.setKafkaProducerConfig(producerProperties)
.setTransactionalIdPrefix(transactionPrefix)
.setRecordSerializer(...)
.build()Zhong Chen
10/19/2023, 9:28 PM