Skip to content

Spring Boot Starter

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

    • Dubbo

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

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

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

    raincat:
      tx :
        txManagerUrl: http://localhost:8761
        serializer: kroy
        nettySerializer: kroy
        compensation: true
        compensationCacheType : db
        txDbConfig :
               driverClassName  : com.mysql.jdbc.Driver
               url :  jdbc:mysql://10.4.4.202:3306/tx?useUnicode=true&amp;characterEncoding=utf8
               username : root
               password : 123123
    
       # repositorySupport : redis
       # txRedisConfig :
             # hostName  : 192.168.1.68
             # port      :  6379
             # password  :
    
       # repositorySupport : zookeeper
       # tx-zookeeper-config :
             # host      : 92.168.1.73:2181
             # sessionTimeOut      :  100000
             # rootPath  : /tx
    
      # repositorySupport : mongodb
      # tx-mongo-config :
             # mongoDbUrl  : localost:27017
             # mongoDbName  :  xiaoyu
             # mongoUserName  : xiaoyu
             # mongoUserPwd   : 123456
    
      # repositorySupport : file
      #  tx-file-config:
             # path      : /consume
             # prefix    :  consume