-
Notifications
You must be signed in to change notification settings - Fork 175
How to listen to multiple databases at the same time? #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not totally sure what you're trying to do. Post some sample |
There are many databases in my product environment, I need to listen all of these databases, their host, port, databaseName are different, so I have to create some BinarylogClients, every BinaryLogClient has a BinlogListener, then to listen the databases. Now I create these BinaryLogClients in different threads, it can be started and listener can connect to those databases successfully, but after listener do onEvent() once, the keepAliveThread will be shutdown, then I can't receive any databases event message anymore. the logs is like this: 16:31:38:793 INFO com.github.shyiko.mysql.binlog.BinaryLogClient - Connected to xxxxxx at binlog.000012/955973598 (cid:9704) My question is What should I do when I'm trying to create BinaryLogClient? Or is there any property need to be setup?(keepAlive/blocking/or any else could be useful) |
I found when the springboot application is running, I can create many BinaryLogClients in different thread successfully, and they will never disconnected, the keepalive thread won't be terminated and I can receive database event message. But after I restart my springboot application, console will print logs like this: 16:31:38:793 INFO com.github.shyiko.mysql.binlog.BinaryLogClient - Connected to xxxxxx at binlog.000012/955973598 (cid:9704) then the keepalive thread will be terminated, and then I can't receive any databse event message anymore. |
Uh oh!
There was an error while loading. Please reload this page.
I created two threads and set BinaryLogClient's object as :
binaryClient.setBlocking(false); ..................... binaryClient.connect(5000);
then I start those two sub threads at the same time in the main thread, but only the first thread can listened the event
The text was updated successfully, but these errors were encountered: