binlog 同步队列去除初始化大小,休眠时间缩短,警格表去除数据同步
| | |
| | | |
| | | public static final int consumerThreads = 5; |
| | | |
| | | public static final long queueSleep = 1000; |
| | | // public static final long queueSleep = 1000; |
| | | public static final long queueSleep = 200; |
| | | |
| | | } |
| | | |
| | |
| | | ); |
| | | client.setEventDeserializer(eventDeserializer); |
| | | this.parseClient = client; |
| | | this.queue = new ArrayBlockingQueue<>(1024); |
| | | this.queue = new LinkedBlockingQueue<>(); |
| | | this.conf = conf; |
| | | this.listeners = ArrayListMultimap.create(); |
| | | this.dbTableCols = new ConcurrentHashMap<>(); |
| | |
| | | consumer.submit(() -> { |
| | | while (true) { |
| | | if (queue.size() > 0) { |
| | | log.info("队列个数1:" + queue.size()); |
| | | try { |
| | | BinLogItem item = queue.take(); |
| | | log.info("队列个数2:" + queue.size()); |
| | | String dbtable = item.getDbTable(); |
| | | listeners.get(dbtable).forEach(binLogListener -> binLogListener.onEvent(item)); |
| | | } catch (InterruptedException e) { |
| | |
| | | username: root |
| | | password: 1qaz@WSX3edc |
| | | db: jczz # 监听数据库 |
| | | table: jczz_house,jczz_household,jczz_house_rental,jczz_user_house_label,jczz_label,jczz_place,jczz_place_check,jczz_place_door,jczz_place_ext,jczz_place_poi_label,jczz_place_practitioner,jczz_police_affairs_grid,jczz_task_label_reporting_event,jczz_patrol_group,jczz_patrol_group_item,jczz_patrol_record,blade_attach_data,jczz_category,jczz_grid,jczz_backblast_pub_record,jczz_backblast_warn_han_rec,jczz_dispute_record,jczz_police_alarm_records,jczz_task_residence_permit_apply |
| | | table: jczz_house,jczz_household,jczz_house_rental,jczz_user_house_label,jczz_label,jczz_place,jczz_place_check,jczz_place_door,jczz_place_ext,jczz_place_poi_label,jczz_place_practitioner,jczz_task_label_reporting_event,jczz_patrol_group,jczz_patrol_group_item,jczz_patrol_record,blade_attach_data,jczz_category,jczz_grid,jczz_backblast_pub_record,jczz_backblast_warn_han_rec,jczz_dispute_record,jczz_police_alarm_records,jczz_task_residence_permit_apply |
| | | # table: blade_attach_data |
| | | enabled: true |
| | | # 目标数据库 |