ratadepally opened a new issue, #8294:
URL: https://github.com/apache/seatunnel/issues/8294

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   When we are using Postgres-CDC as a Source and RabbitMq, JDBC and Console as 
Sink we are getting duplicate data in case of RabbitMq and Console. This issue 
occurs only when we receive update record from CDC Source. Is there any way to 
avoid the duplicates when we receive Updates from CDC ? This doesn't happen for 
JDBC because as per the codebase the **UPDATE_BEFORE**  ROW_KIND transaction is 
being skipped.
   
   
![image](https://github.com/user-attachments/assets/c1862274-e3ae-4f24-b9f5-0dfa27d4f40e)
   
   
   
   ### SeaTunnel Version
   
   2.3.8
   
   ### SeaTunnel Config
   
   ```conf
   env {
     execution.parallelism = 1
     job.mode = "STREAMING"
     checkpoint.interval = 5000
     read_limit.bytes_per_second=7000000
     read_limit.rows_per_second=400
   }
   
   source {
     Postgres-CDC {
       result_table_name = "employees"
       username = "postgres"
       password = "password"
       database-names = ["postgres"]
       schema-names = ["public"]
        slot.name = "employeesslot"
       table-names = ["postgres.public.employees"]
       base-url = "jdbc:postgresql://localhost:5432/postgres"
        startup.mode = "latest"
     }
   }
   
   transform {
     
     Filter {
       source_table_name = "employees"
       result_table_name = "employeesfieldtransform"
       include_fields = [id]
     }
   }
   
   sink {
     
     Jdbc {
           source_table_name = "employees"
           url = "jdbc:postgresql://localhost:5432/postgres"
           driver = org.postgresql.Driver
           user = postgres
           password = "password"
           database = postgres
           table = "public.employees"
                generate_sink_sql = true
       }
        
        RabbitMQ {
              source_table_name = "employeesfieldtransform"
                  host = "localhost"
                  port = 5672
                  virtual_host = "/"
                  username = "guest"
                  password = "guest"
                  queue_name = "test"
                  durable = "true"
             exclusive = "false"
             auto_delete = "false"
                  rabbitmq.config = {
                  requested-heartbeat = 10
                  connection-timeout = 10
                  }
          }
          
        Console {
           source_table_name = "employeesfieldtransform"
        }  
   }
   ```
   
   
   ### Running Command
   
   ```shell
   ./bin/seatunnel.sh --config config/employees.template --async -n 
employeessync
   ```
   
   
   ### Error Exception
   
   ```log
   No Exception or Error. But we see duplicate entries as below.
   
   
   
   [920011071916343221] 2024-12-13 17:09:41,074 INFO  [i.d.u.Threads            
     ] [debezium-reader-0] - Requested thread factory for connector 
   PostgresConnector, id = postgres_cdc_source named = keep-alive
   [920011071916343221] 2024-12-13 17:09:41,075 INFO  [i.d.u.Threads            
     ] [debezium-reader-0] - Creating thread 
   debezium-postgresconnector-postgres_cdc_source-keep-alive
   [920011071916343221] 2024-12-13 17:09:42,559 INFO  
[.a.s.c.s.c.s.ConsoleSinkWriter] [st-multi-table-sink-writer-1] - 
subtaskIndex=0  rowIndex=1:  
   SeaTunnelRow#tableId=postgres.public.employees 
SeaTunnelRow#kind=UPDATE_BEFORE : d3133dd3-d385-4606-9f3d-5bc179c81b7c
   [920011071916343221] 2024-12-13 17:09:42,559 INFO  
[.a.s.c.s.c.s.ConsoleSinkWriter] [st-multi-table-sink-writer-1] - 
subtaskIndex=0  rowIndex=2:  
   SeaTunnelRow#tableId=postgres.public.employees 
SeaTunnelRow#kind=UPDATE_AFTER : d3133dd3-d385-4606-9f3d-5bc179c81b7c
   ```
   
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   1.8
   
   ### Screenshots
   
   
![image](https://github.com/user-attachments/assets/3d5ef281-0dda-480c-83ca-fb9af921157b)
   
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to