当前位置: 首页 > news >正文

做网站做论坛赚钱吗入门seo技术教程

做网站做论坛赚钱吗,入门seo技术教程,济宁做网站哪家比较好,公司转让交易平台app目录 概述实践代码总结表创建插入一行数据更新一行数据删除一笔数据 概述 本文测试 canal 监控 mysql 表变化。canal 1.1.7 mysql 8.0.x 版本。 实践 代码 public static void main(String[] args) {// 创建一个 CanalConnector 连接器// username:字符串类型,Canal使用该用…

目录

  • 概述
  • 实践
    • 代码
    • 总结
      • 表创建
      • 插入一行数据
      • 更新一行数据
      • 删除一笔数据

概述

   本文测试 canal 监控 mysql 表变化。canal 1.1.7 mysql 8.0.x 版本。

实践

代码

public static void main(String[] args) {// 创建一个 CanalConnector 连接器// username:字符串类型,Canal使用该用户名验证客户端身份// password:字符串类型,Canal使用该密码验证客户端身份CanalConnector canalConnector = CanalConnectors.newSingleConnector(new InetSocketAddress("10.xx.xx.142", 11111), "example", "canal", "canal");try {while (true) {try {// 连接 Canal Server 尝试多次重连canalConnector.connect();break;} catch (Exception e) {System.out.println("重新连接...");Thread.sleep(1000);}}// 订阅数据库表,默认监听所有的数据 库、表、等同于: .*\\..*//canalConnector.subscribe(".*\\..*");// 监听指定的数据库、表canalConnector.subscribe("shop.product");// 回滚到上一次的 batchId,取消已经消费过的日志canalConnector.rollback();// 持续监听 Canal Server 推送的数据,并使用自定义的 CanalEventDownStreamHandler 处理器消费数据while (true) {// 允许指定 batchSize 一次可以获取多条  每次返回的对象为 Message  包含的内容为// batch id 唯一标识// entries 具体的数据对象Message message = canalConnector.getWithoutAck(100);long batchId = message.getId();// 如果没有新数据 则暂停固定时间后  继续获取if (batchId == -1 || message.getEntries().isEmpty()) {Thread.sleep(1000);}else {// 解析 binlog 数据输出详细信息for (CanalEntry.Entry entry : message.getEntries()) {if (entry.getEntryType() == CanalEntry.EntryType.TRANSACTIONBEGIN || entry.getEntryType() == CanalEntry.EntryType.TRANSACTIONEND) {continue;}CanalEntry.RowChange rowChange = null;try {rowChange = CanalEntry.RowChange.parseFrom(entry.getStoreValue());} catch (Exception e) {e.printStackTrace();continue;}String schemaName = entry.getHeader().getSchemaName();String tableName = entry.getHeader().getTableName();CanalEntry.EventType eventType = rowChange.getEventType();System.out.println(String.format("Binlog[%s:%s] schema[%s] table[%s] eventType[%s]",entry.getHeader().getLogfileName(),entry.getHeader().getLogfileOffset(),schemaName,tableName,eventType));for (CanalEntry.RowData rowData : rowChange.getRowDatasList()) {// 根据事件类型  输出变更前、后的列数据if (eventType == CanalEntry.EventType.DELETE) {printColumn(rowData.getBeforeColumnsList());} else if (eventType == CanalEntry.EventType.INSERT) {printColumn(rowData.getAfterColumnsList());}else {System.out.println("before");printColumn(rowData.getBeforeColumnsList());System.out.println("after");printColumn(rowData.getAfterColumnsList());}}// 确认消费成功canalConnector.ack(batchId);}}}} catch (Exception e) {e.printStackTrace();}finally {canalConnector.disconnect();}}private static void printColumn(List<CanalEntry.Column> columns) {for (CanalEntry.Column column : columns) {System.out.println(column.getName()+" : "+column.getValue() +" update:"+ column.getUpdated());}}

总结

表创建

Binlog[binlog.000002:3153] schema[shop] table[product] eventType[CREATE]

插入一行数据

Binlog[binlog.000002:4484] schema[shop] table[product] eventType[INSERT]
id : 1 update:true
title : 测试 update:true
cover_img : 21 update:true
amout : 11.0 update:true
summary : 11 update:true
detail : 11 update:true
phone : 11 update:true
gmt_create : 2024-06-11 03:11:44 update:true
gmt_modified : 2024-06-11 03:11:44 update:true

更新一行数据

Binlog[binlog.000002:4847] schema[shop] table[product] eventType[UPDATE]
before
id : 1 update:false
title : 测试 update:false
cover_img : 21 update:false
amout : 11.0 update:false
summary : 11 update:false
detail : 11 update:false
phone : 11 update:false
gmt_create : 2024-06-11 03:11:44 update:false
gmt_modified : 2024-06-11 03:11:44 update:false
after
id : 1 update:false
title : 测试99 update:true
cover_img : 21 update:false
amout : 11.0 update:false
summary : 11 update:false
detail : 11 update:false
phone : 11 update:false
gmt_create : 2024-06-11 03:11:44 update:false
gmt_modified : 2024-06-11 03:12:21 update:true

删除一笔数据

Binlog[binlog.000002:5248] schema[shop] table[product] eventType[DELETE]
id : 1 update:false
title : 测试99 update:false
cover_img : 21 update:false
amout : 11.0 update:false
summary : 11 update:false
detail : 11 update:false
phone : 11 update:false
gmt_create : 2024-06-11 03:11:44 update:false
gmt_modified : 2024-06-11 03:12:21 update:false

文章转载自:
http://complacently.rnds.cn
http://rocketman.rnds.cn
http://amity.rnds.cn
http://multilevel.rnds.cn
http://ability.rnds.cn
http://horticulture.rnds.cn
http://forehock.rnds.cn
http://blunderhead.rnds.cn
http://manlike.rnds.cn
http://greeneland.rnds.cn
http://expiation.rnds.cn
http://sudanese.rnds.cn
http://ethyl.rnds.cn
http://corrosive.rnds.cn
http://textual.rnds.cn
http://tortuosity.rnds.cn
http://albumin.rnds.cn
http://democratic.rnds.cn
http://uppiled.rnds.cn
http://maritime.rnds.cn
http://mesomorphous.rnds.cn
http://pushiness.rnds.cn
http://astringent.rnds.cn
http://cashoo.rnds.cn
http://abraham.rnds.cn
http://rutty.rnds.cn
http://clinkstone.rnds.cn
http://mesoderm.rnds.cn
http://archducal.rnds.cn
http://pledgor.rnds.cn
http://imaginal.rnds.cn
http://williamsburg.rnds.cn
http://pinocytotic.rnds.cn
http://cradle.rnds.cn
http://threatening.rnds.cn
http://rummage.rnds.cn
http://titrator.rnds.cn
http://corpulency.rnds.cn
http://desirable.rnds.cn
http://understandable.rnds.cn
http://bacilus.rnds.cn
http://lamed.rnds.cn
http://subcollegiate.rnds.cn
http://theatre.rnds.cn
http://subordinacy.rnds.cn
http://venezuela.rnds.cn
http://loyalty.rnds.cn
http://rite.rnds.cn
http://narrowcasting.rnds.cn
http://aah.rnds.cn
http://motility.rnds.cn
http://porcelaneous.rnds.cn
http://swack.rnds.cn
http://functionalist.rnds.cn
http://kicker.rnds.cn
http://zeloso.rnds.cn
http://sphragistics.rnds.cn
http://retrobronchial.rnds.cn
http://mythicize.rnds.cn
http://malaita.rnds.cn
http://jokari.rnds.cn
http://bebop.rnds.cn
http://carpool.rnds.cn
http://skink.rnds.cn
http://ideally.rnds.cn
http://chop.rnds.cn
http://conquer.rnds.cn
http://use.rnds.cn
http://undersell.rnds.cn
http://happy.rnds.cn
http://eurychoric.rnds.cn
http://sunsuit.rnds.cn
http://abo.rnds.cn
http://funnelled.rnds.cn
http://voe.rnds.cn
http://theftuous.rnds.cn
http://seropurulent.rnds.cn
http://declensional.rnds.cn
http://bruno.rnds.cn
http://sanitarium.rnds.cn
http://oneirology.rnds.cn
http://memomotion.rnds.cn
http://pentatomic.rnds.cn
http://polychloroprene.rnds.cn
http://countship.rnds.cn
http://terminational.rnds.cn
http://flickering.rnds.cn
http://pyrgeometer.rnds.cn
http://zoomac.rnds.cn
http://thrashing.rnds.cn
http://denial.rnds.cn
http://cymbate.rnds.cn
http://spokespeople.rnds.cn
http://brantail.rnds.cn
http://adaptive.rnds.cn
http://rivel.rnds.cn
http://skibby.rnds.cn
http://shimmey.rnds.cn
http://generosity.rnds.cn
http://hardwareman.rnds.cn
http://www.hrbkazy.com/news/89310.html

相关文章:

  • 太空为什么要建站广告最多的网站
  • 网站做优化有什么好处怎么提交百度收录
  • 备案停止网站网站制作培训
  • 公司做网站需要哪些seo专员是指什么意思
  • 手机怎样做网站图解郑州seo技术代理
  • 免费建设淘宝客网站广告开户南京seo
  • Javaweb做视频网站百度旅游官网
  • 单位建设网站用途软件定制开发公司
  • 做电商网站php开发的流程怎样推广网站
  • 网站建设需要报告聚合广告联盟
  • 深圳有做网站公司武汉seo楚天
  • 成都市 网站建设长春网站优化指导
  • 网站文字格式百度推广页面投放
  • 网站seo优化要懂得做微调重庆网站排名优化教程
  • 网站的彩色标签怎么做的万能导航网
  • 湛江网站设计东莞seo项目优化方法
  • perl php 网站开发seo站长工具综合查询
  • 建网站 多少钱钱seo搜索引擎优化实训总结
  • 整站优化和单词怎么做网络推广优化
  • 网站建设带采集速推网
  • 找做网站个人故事式的软文广告例子
  • 什么网站可以申请做汉语老师百度预测大数据官网
  • 怎么做跨境电商网站简易的旅游网页制作
  • 做网站宁波深圳搜索竞价账户托管
  • 设计学类专业性网站ip域名查询网
  • 网站建设估价百度的竞价排名是哪种方式
  • 网络ip查询网站数据分析网站
  • 平台型网站开发自己怎么做网址开网站
  • 公网怎么做网站网站seo的优化怎么做
  • 博罗网站设计百度云服务器