Skip to content

Commit

Permalink
Merge pull request #22 from codingapi/tx-lcn-foxdd
Browse files Browse the repository at this point in the history
Tx lcn foxdd
  • Loading branch information
xlorne authored Dec 21, 2017
2 parents f9dca4e + 3ea4c04 commit 2c10b99
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ public Server proxy(List<Server> servers,Server server){

String key = MD5Util.md5((groupId + "_" + appName).getBytes());

//如果只有一个可调用模块,则用当前的,且需要将数据记录到redis中
if(servers.size() == 1){
putServer(key, txTransactionLocal, server);
logger.info("LCNBalanceProxy -> only one server available");
return server;
}

Server oldServer =getServer(txTransactionLocal,servers,key);
if(oldServer != null){
logger.info("LCNBalanceProxy - > load old server ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
Expand All @@ -26,12 +25,10 @@ public LcnZoneAwareLoadBalancerProxy(IClientConfig clientConfig, IRule rule,
@Override
public Server chooseServer(Object key){
logger.info("enter chooseServer method, key:" + key);

List<Server> serverList = new ArrayList<Server>();
//获取处理之后的serverlist
serverList = super.getServerListImpl().getUpdatedListOfServers();
//获取过滤之后的serverlist
serverList = super.getFilter().getFilteredListOfServers(serverList);
List<Server> serverList = super.getReachableServers();
if(null == serverList || serverList.isEmpty()){
return super.chooseServer(key);
}
return lcnLoadBalancerRule.proxy(serverList, super.chooseServer(key));

}
Expand Down
6 changes: 6 additions & 0 deletions tx-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@
</executions>
</plugin>


<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

</plugins>
</build>

Expand Down

0 comments on commit 2c10b99

Please sign in to comment.