Skip to content

SpringCloud Quick Start

纳兰丶 edited this page Aug 17, 2018 · 4 revisions
spring:
  datasource:
      driver-class-name:  com.mysql.jdbc.Driver
      url: jdbc:mysql://192.168.1.68:3306/tcc_account?useUnicode=true&characterEncoding=utf8
      username: xiaoyu
      password: Wgj@555888
  • Modifiy applicationContext.xml on Indicator Item And choose repositorySupport and modifiy it
    • If you use database compensation , You have to create a new database 。 for example:tcc

     <context:component-scan base-package="com.hmily.tcc.*"/>
     <aop:aspectj-autoproxy expose-proxy="true"/>
      <bean id="hmilyTransactionBootstrap" class="com.hmily.tcc.core.bootstrap.HmilyTransactionBootstrap">
        <property name="serializer" value="kryo"/>
        <property name="recoverDelayTime" value="120"/>
        <property name="retryMax" value="3"/>
        <property name="scheduledDelay" value="120"/>
        <property name="scheduledThreadMax" value="4"/>
        <property name="repositorySupport" value="db"/>
        <property name="tccDbConfig">
            <bean class="com.hmily.tcc.common.config.TccDbConfig">
                <property name="url"
                          value="jdbc:mysql://192.168.1.98:3306/tcc?useUnicode=true&amp;characterEncoding=utf8"/>
                <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
                <property name="username" value="root"/>
                <property name="password" value="123456"/>
            </bean>
        </property>
    </bean>
  • run EurekaServerApplication.java
  • run SpringcloudTccAccountApplication.java
  • run SpringCloudTccInventoryApplication.java
  • run SpringCloudTccOrderApplication.java