Client Configure for SEATA 1.0.0
A new feature has been released in SEATA 1.0.0 to replace the file.conf and registry.conf we introduced earlier with yaml/properties. Just 2 steps to get there:
- First, change the dependency
<! --seata--> <dependency> <groupId>io.seata</groupId> <artifactId>seata-spring-boot-starter</artifactId> <version>1.0.0</version> <exclusions> <artifactId>seata-all</artifactId> <groupId> IO. Seata </groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>io.seata</groupId> <artifactId>seata-all</artifactId> The < version > 1.0.0 < / version > < / dependency >Copy the code
The official version is seata-spring-boot-starter, but in the actual process, the internal version of the dependency is still seata-all 0.9, which will report errors, so I introduced seata-All 1.0.0 separately, submit github issue,
- Step 2: Modify the configuration
server: port: 8001 # 1.0 The new enabled enabled enables automatic configuration that we can configure in yaml/properties files, # avoiding the previous need for clients to import 2 files: # file.conf and registry. The default value is true. Tx-service-group: geekplus_tx_group: transport: # type: TCP #default value is TCP # server: NIO #default value is NIO # heartbeat: true #enable heartbeat # enable-client-batch-send-request: true # serialization: seata # compressor: none # shutdown: # wait: 3 #when destroy server, wait seconds registry: type: eureka eureka: service-url: http://localhost:8888/eureka # application: default # weight: 1 # service: # vgroup-mapping: geekplus_tx_group # disable-global-transaction: false # disableGlobalTransaction: false client: support: spring: datasource-autoproxy: false spring: application: name: seata-1-0-transaction ...Copy the code
You can find the corresponding configuration properties in the spring-configuration-metadata.json file. When using the service attribute, there is also a problem that disableGlobalTransaction and disable-global-transaction cannot take effect. Git issue.
Details of the demo can be vieweddemo/mscx-seata-1-0-demo
Running life garden | | blog segmentfault | spring4all | CSDN Denver | | OSChina book | | Jane headlines | zhihu | 51 cto