栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

debezium集成MongoDB嵌入式方式

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

debezium集成MongoDB嵌入式方式

        最近在研究debezium相关功能,因为官网上推荐使用kafka的方式,但是kafka比较繁琐,使用起来配置比较麻烦,所以使用嵌入式方式摆脱kafka的束缚,以下是嵌入式相关配置:

 
    @Bean
    io.debezium.config.Configuration debeziumConfig() {

        return io.debezium.config.Configuration.create()
                //连接器的唯一名称
                .with("name", "mongoDB-connector")
//            连接器的Java类名称
                .with("connector.class", "io.debezium.connector.mongodb.MongoDbConnector")
                //数据库的hostname
                .with("mongodb.hosts", "myrs/192.168.137.100:27017")

                .with("mongodb.name", "myrs")

                .with("collection.include.list", "articledb.SYS_USER")

                .with("include.schema.changes", "false")
                .with("tasks.max","1")

                .with("offset.storage","org.apache.kafka.connect.storage.FileOffsetBackingStore")
                .with("offset.storage.file.filename", "D://kaifa/spring-boot-debezium/tmp/offsets_mongodb.dat")
                .with("database.history", "io.debezium.relational.history.FileDatabaseHistory")
                历史变更记录存储位置
                .with("database.history.file.filename", "D://kaifa/spring-boot-debezium/tmp/dbhistory_mongodb.dat")
                .with("snapshot.delay.ms",6000)

                .build();

    }

相关嵌入式debezium demo地址参考:https://gitee.com/felord/spring-boot-debezium.git
 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/872194.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号