DanielCarter-stack commented on issue #10607: URL: https://github.com/apache/seatunnel/issues/10607#issuecomment-4072546898
<!-- code-pr-reviewer --> Thanks for the proposal. This is a valid enhancement for low-throughput CDC scenarios. Currently, JDBC sink only supports size-based flushing via `batch_size` (see `JdbcSinkOptions.java:84-85` and `JdbcOutputFormat.java:99-114`), which can cause high latency when batches take too long to fill. Similar connectors already implement time-based flushing: - MongoDB: `buffer-flush.interval` in `MongodbSinkOptions.java:40-45`, with `isOverMaxBatchIntervalLimit()` check in `MongodbWriter.java:218-221` - Hudi: `batch_interval_ms` in `HudiSinkOptions.java:134-138` Suggested approach: 1. Add `BATCH_INTERVAL_MS` (or `buffer-flush.interval`) option to `JdbcSinkOptions`, default 0 (disabled) 2. Add `batchIntervalMs` field to `JdbcConnectionConfig` and its Builder 3. Track `lastFlushTime` in `JdbcOutputFormat` and check `System.currentTimeMillis() - lastFlushTime >= interval` in `writeRecord` 4. Update `docs/en/connector/sink/Jdbc.md` and `docs/zh/connector/sink/Jdbc.md` Please clarify interaction with `batch_size=1` or `is_exactly_once=true` — should this option be disabled in those cases? -- 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]
