mysql-binlog-connector-java icon indicating copy to clipboard operation
mysql-binlog-connector-java copied to clipboard

Limit speed

Open Xinshiyou opened this issue 6 years ago • 2 comments

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.

Xinshiyou avatar Aug 08 '18 09:08 Xinshiyou

You can control the flow rate in the EventListener.onEvent method, such as sleep(timestamp)

yangzhongj avatar Sep 19 '18 03:09 yangzhongj

@Xinshiyou You can use some rate-limiter in EventListener.onEvent(), e.g. https://www.baeldung.com/guava-rate-limiter.

ahmedahamid avatar Jun 29 '19 21:06 ahmedahamid