1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

adapter: use seata-spring-boot-starter's autoConfiguration instead of spring-cloud-alibaba-seata-starter's autoConfiguration

Signed-off-by: slievrly <slievrly@163.com>
This commit is contained in:
slievrly
2019-12-31 18:40:14 +08:00
parent 54d97a37b4
commit 34d8267068
24 changed files with 181 additions and 785 deletions

View File

@@ -20,6 +20,10 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>

View File

@@ -24,6 +24,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.LinkedMultiValueMap;
@@ -87,11 +88,13 @@ public class HomeController {
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<MultiValueMap<String, String>>(
map, headers);
ResponseEntity<String> response = restTemplate.postForEntity(url, request,
String.class);
ResponseEntity<String> response;
try {
response = restTemplate.postForEntity(url, request, String.class);
} catch (Exception exx) {
return "mock error";
}
result = response.getBody();
if (!SUCCESS.equals(result)) {
throw new RuntimeException();
}

View File

@@ -6,3 +6,18 @@ spring.application.name=business-service
#feign.sentinel.enabled=true
logging.level.io.seata=debug
seata.enabled=true
seata.service.vgroup-mapping=default
seata.service.grouplist=127.0.0.1:8091
seata.service.disable-global-transaction=false
## if use registry center
#seata.registry.type=nacos
#seata.registry.nacos.cluster=default
#seata.registry.nacos.server-addr=localhost
#
## if use config center
#seata.config.type=apollo
#seata.config.apollo.apollo-meta=http://192.168.1.204:8801
#seata.config.apollo.app-id=seata-server

View File

@@ -1,67 +1,4 @@
transport {
# tcp udt unix-domain-socket
type = "TCP"
#NIO NATIVE
server = "NIO"
#enable heartbeat
heartbeat = false
#thread factory for netty
thread-factory {
boss-thread-prefix = "NettyBoss"
worker-thread-prefix = "NettyServerNIOWorker"
server-executor-thread-prefix = "NettyServerBizHandler"
share-boss-worker = false
client-selector-thread-prefix = "NettyClientSelector"
client-selector-thread-size = 1
client-worker-thread-prefix = "NettyClientWorkerThread"
# netty boss thread size,will not be used for UDT
boss-thread-size = 1
#auto default pin or 8
worker-thread-size = 8
}
shutdown {
# when destroy server, wait seconds
wait = 3
}
serialization = "seata"
compressor = "none"
}
service {
#vgroup->rgroup
vgroup_mapping.business-service-seata-service-group = "default"
#only support single node
default.grouplist = "127.0.0.1:8091"
#degrade current not support
enableDegrade = false
#disable
disable = false
#unit ms,s,m,h,d represents milliseconds, seconds, minutes, hours, days, default permanent
max.commit.retry.timeout = "-1"
max.rollback.retry.timeout = "-1"
}
client {
async.commit.buffer.limit = 10000
lock {
retry.internal = 10
retry.times = 30
}
report.retry.count = 5
tm.commit.retry.count = 1
tm.rollback.retry.count = 1
}
transaction {
undo.data.validation = true
undo.log.serialization = "jackson"
undo.log.save.days = 7
#schedule delete expired undo_log in milliseconds
undo.log.delete.period = 86400000
undo.log.table = "undo_log"
}
support {
## spring
spring {
# auto proxy the DataSource bean
datasource.autoproxy = false
}
disableGlobalTransaction = false
}