Skip to content

发布v4.0.2 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.codingapi</groupId>
<artifactId>tx-lcn</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>
<packaging>pom</packaging>

<name>tx-lcn</name>
Expand Down
4 changes: 2 additions & 2 deletions transaction-dubbo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.codingapi</groupId>
<artifactId>transaction-dubbo</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>

<name>transaction-dubbo</name>
<url>https://github.com/codingapi/tx-lcn</url>
Expand Down Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>com.codingapi</groupId>
<artifactId>tx-client</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TimeOutServiceImpl implements TimeOutService {

@Override
public void loadOutTime(int timeOut) {
int finalTimeOut = (null != providerConfig.getTimeout()) ? providerConfig.getTimeout() : timeOut;
int finalTimeOut = (null != providerConfig.getTimeout()) ? providerConfig.getTimeout() : (timeOut * 1000);
Constants.maxOutTime = finalTimeOut;
}
}
4 changes: 2 additions & 2 deletions transaction-motan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.codingapi</groupId>
<artifactId>transaction-motan</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>

<name>transaction-motan</name>
<url>https://github.com/codingapi/tx-lcn</url>
Expand Down Expand Up @@ -66,7 +66,7 @@
<dependency>
<groupId>com.codingapi</groupId>
<artifactId>tx-client</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>
</dependency>

<!-- motan config start-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class TimeOutServiceImpl implements TimeOutService {
* @param timeOut timeOut
*/
public void loadOutTime(int timeOut) {
int finalTimeOut = (null != basicServiceConfigBean.getRequestTimeout() ? basicServiceConfigBean.getRequestTimeout() : timeOut);
Constants.maxOutTime = timeOut;
int finalTimeOut = (null != basicServiceConfigBean.getRequestTimeout()) ? basicServiceConfigBean.getRequestTimeout() : (timeOut * 1000);
Constants.maxOutTime = finalTimeOut;
}
}
4 changes: 2 additions & 2 deletions transaction-springcloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.codingapi</groupId>
<artifactId>transaction-springcloud</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>

<name>transaction-springcloud</name>
<url>https://github.com/codingapi/tx-lcn</url>
Expand Down Expand Up @@ -69,7 +69,7 @@
<dependency>
<groupId>com.codingapi</groupId>
<artifactId>tx-client</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ public class TimeOutServiceImpl implements TimeOutService {

@Override
public void loadOutTime(int timeOut) {
//todo 暂时写死
/*int timeOut = 20*1000;
Constants.maxOutTime = timeOut;*/
//从txManager取
if(timeOut < 0){
if(timeOut <= 0){
Constants.maxOutTime = 20*1000;
} else {
Constants.maxOutTime = timeOut*1000;
Expand Down
2 changes: 1 addition & 1 deletion tx-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.codingapi</groupId>
<artifactId>tx-client</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>

<name>tx-client</name>
<url>https://github.com/codingapi/tx-lcn</url>
Expand Down
4 changes: 2 additions & 2 deletions tx-client/src/main/java/com/codingapi/tx/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public class Constants {


/**
* 最大模块超时时间
* 最大模块超时时间(毫秒)
*/
public static int maxOutTime = 10;
public static int maxOutTime = 10000;

/**
* 模块唯一标示
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class NettyServiceImpl implements NettyService {

@Autowired
private NettyControlService nettyControlService;

@Autowired
private TimeOutService timeOutService;

Expand All @@ -62,7 +62,7 @@ public synchronized void start() {
int autoCompensateLimit = Constants.txServer.getAutoCompensateLimit();

final TransactionHandler transactionHandler = new TransactionHandler(nettyControlService, delay);

timeOutService.loadOutTime(autoCompensateLimit);
workerGroup = new NioEventLoopGroup();
try {
Expand Down Expand Up @@ -102,16 +102,7 @@ public void run() {
});

} catch (Exception e) {
e.printStackTrace();

// isStarting = false;
//
// //断开重新连接机制
// close();
//
// if (e instanceof ConnectTimeoutException) {
// start();
// }
logger.error(e.getLocalizedMessage());
}
}

Expand All @@ -126,11 +117,6 @@ public synchronized void close() {
}
}

//
// @Override
// public String sendMsg(Request request) {
// return transactionHandler.sendMsg(request);
// }

@Override
public boolean checkState() {
Expand Down
2 changes: 1 addition & 1 deletion tx-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.codingapi</groupId>
<artifactId>tx-manager</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>
<packaging>jar</packaging>

<name>tx-manager</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
Expand All @@ -16,7 +14,7 @@
* Created by lorne on 2017/7/5.
*/

@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
@Configuration
public class RedisConfig {

private static Logger logger = LoggerFactory.getLogger(RedisConfig.class);
Expand Down
2 changes: 1 addition & 1 deletion tx-manager/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ tm.compensate.notifyUrl=http://ip:port/path
#补偿失败,再次尝试间隔(秒),最大尝试次数3次,当超过3次即为补偿失败。
tm.compensate.tryTime=30

#各组件自动补偿的时间上限
#各事务模块自动补偿的时间上限
tm.auto.compensate.limit=20


Expand Down
10 changes: 8 additions & 2 deletions tx-manager/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"/>
<title>TxManager v4.0.2-SNAPSHOT</title>
<title>TxManager v4.0.2</title>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css"/>
<script src="static/jquery/jquery.min.js"></script>
Expand All @@ -24,7 +24,7 @@
<body>
<div class="container">

<h3 class="text-center">TxManagerV4.0.2-SNAPSHOT 服务已启动</h3>
<h3 class="text-center">TxManagerV4.0.2 服务已启动</h3>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<colgroup>
Expand Down Expand Up @@ -116,6 +116,12 @@ <h3 class="text-center">TxManagerV4.0.2-SNAPSHOT 服务已启动</h3>
</th>
<td><span id="compensateTryTime"></span></td>
</tr>
<tr>
<th scope="row">
各事务模块自动补偿的时间上限(秒)
</th>
<td><span id="autoCompensateLimit"></span></td>
</tr>
</tbody>
</table>

Expand Down
4 changes: 2 additions & 2 deletions tx-plugins-db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.codingapi</groupId>
<artifactId>tx-plugins-db</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>

<name>tx-plugins-db</name>
<url>https://github.com/codingapi/tx-lcn</url>
Expand Down Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>com.codingapi</groupId>
<artifactId>tx-client</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>
</dependency>


Expand Down
4 changes: 2 additions & 2 deletions tx-plugins-nodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.codingapi</groupId>
<artifactId>tx-plugins-nodb</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>

<name>tx-plugins-nodb</name>
<url>https://github.com/codingapi/tx-lcn</url>
Expand Down Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>com.codingapi</groupId>
<artifactId>tx-client</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>
</dependency>


Expand Down
4 changes: 2 additions & 2 deletions tx-plugins-redis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.codingapi</groupId>
<artifactId>tx-plugins-redis</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>

<name>tx-plugins-redis</name>
<description>tx-plugins-redis project for Spring Boot</description>
Expand Down Expand Up @@ -74,7 +74,7 @@
<dependency>
<groupId>com.codingapi</groupId>
<artifactId>tx-client</artifactId>
<version>4.0.2-SNAPSHOT</version>
<version>4.0.2</version>
</dependency>

<dependency>
Expand Down