Re: How to handle BatchUpdateException when using JdbcSink

2023-10-19 Thread Feng Jin
Hi Sai, If you directly utilize JdbcSink, you may not be able to catch this exception. But, you can create your own SinkFunction and invoke the `invoke` method of JdbcSink and catch the Exception, and invoke the dlq sink. As shown below, ``` public class SinkWrapper { private JdbcSink jdbcSink;

How to handle BatchUpdateException when using JdbcSink

2023-10-18 Thread Sai Vishnu
Hi team, We are using the JdbcSink from flink-connector-jdbc artifact, version 3.1.0-1.17. I want to know if it’s possible to catch BatchUpdateException thrown and put that message to DLQ. Below is the use case: Flink job reads a packet from Kafka and writes it to Postgres using the JdbcSin