mysql-binlog-connector-java
mysql-binlog-connector-java copied to clipboard
Limit speed
Hi, is there any way to limit the speed of events?
My APP sync mysql events realtime from backup db. But there is some peeks, which means high cpu and disk consumes, so the warnings come. I want to set some limit for events in some period.
You can control the flow rate in the EventListener.onEvent method, such as sleep(timestamp)
@Xinshiyou You can use some rate-limiter in EventListener.onEvent()
, e.g. https://www.baeldung.com/guava-rate-limiter.