Skip to content

Spring Boot Starter

纳兰丶 edited this page Mar 9, 2018 · 1 revision
  • 首先引入rpc框架所支持的jar包,注意:版本号,根据你拉代码自己打包上传到私服一致

    • Dubbo

      <dependency>
           <groupId>com.hmily.tcc</groupId>
           <artifactId>hmily-tcc-spring-boot-starter-dubbo</artifactId>
           <version>${your version}</version>
       </dependency>
    • SpringCloud

      <dependency>
           <groupId>com.hmily.tcc</groupId>
           <artifactId>hmily-tcc-spring-boot-starter-springcloud</artifactId>
           <version>${your version}</version>
       </dependency>
    • Motan

       <dependency>
          <groupId>com.hmily.tcc</groupId>
          <artifactId>hmily-tcc-spring-boot-starter-motan</artifactId>
          <version>${your version}</version>
       </dependency>
  • 在你的 application.yml 中新增如下配置:

     hmily:
      tcc :
         serializer : kryo
          recoverDelayTime : 128
          retryMax : 30
          scheduledDelay : 128
          scheduledThreadMax :  10
          repositorySupport : db
          tccDbConfig :
                   driverClassName  : com.mysql.jdbc.Driver
                   url :  jdbc:mysql://192.168.1.68:3306/tcc?useUnicode=true&amp;characterEncoding=utf8
                   username : xiaoyu
                   password : Wgj@555888
    
         # repositorySupport : redis
         #         hostName  : 192.168.1.68
         #         port      :  6379
         #         password  :
    
    
         # repositorySupport : zookeeper
         #         host      : 92.168.1.73:2181
         #         sessionTimeOut      :  100000
         #         rootPath  : /tcc
    
         # repositorySupport : mongodb
         #       mongoDbUrl  : 192.168.1.68:27017
         #       mongoDbName  :  happylife
         #       mongoUserName  : xiaoyu
         #       mongoUserPwd   : 123456
    
         # repositorySupport : file
         #         path      : /account
         #         prefix    :  account