Skip to content

Commit 9b9ee4f

Browse files
authored
Merge pull request #5 from codingapi/tx-lcn-motan
Tx lcn motan
2 parents 1d3afd9 + 3e5c86d commit 9b9ee4f

3 files changed

Lines changed: 12 additions & 18 deletions

File tree

transaction-motan/pom.xml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6060
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6161
<java.version>1.7</java.version>
62-
<motan>0.3.1</motan>
62+
<motan>1.0.0</motan>
6363
</properties>
6464

6565
<dependencies>
@@ -153,20 +153,6 @@
153153
</execution>
154154
</executions>
155155
</plugin>
156-
<plugin>
157-
<groupId>org.apache.maven.plugins</groupId>
158-
<artifactId>maven-gpg-plugin</artifactId>
159-
<version>1.6</version>
160-
<executions>
161-
<execution>
162-
<id>sign-artifacts</id>
163-
<phase>verify</phase>
164-
<goals>
165-
<goal>sign</goal>
166-
</goals>
167-
</execution>
168-
</executions>
169-
</plugin>
170156
</plugins>
171157
</build>
172158

transaction-motan/src/main/java/com/codingapi/tx/motan/filter/TransactionFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
@SpiMeta(name = "transaction")
2222
@Activation(key = {MotanConstants.NODE_TYPE_SERVICE, MotanConstants.NODE_TYPE_REFERER})
2323
public class TransactionFilter implements Filter {
24-
24+
2525
public Response filter(Caller<?> caller, Request request) {
2626
TxTransactionLocal txTransactionLocal = TxTransactionLocal.current();
2727
if (txTransactionLocal != null) {

tx-client/src/main/java/com/codingapi/tx/netty/handler/TransactionHandler.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ public TransactionHandler(NettyControlService nettyControlService, int delay) {
4242
}
4343

4444

45-
4645
@Override
4746
public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
4847

4948
String json = SocketUtils.getJson(msg);
5049

5150
logger.info("TxManager-response->" + json);
5251

53-
nettyControlService.executeService(ctx,json);
52+
nettyControlService.executeService(ctx, json);
5453
}
5554

5655
@Override
@@ -76,9 +75,18 @@ public void channelActive(ChannelHandlerContext ctx) throws Exception {
7675
logger.info("try connection -->" + ctx);
7776

7877
nettyControlService.uploadModelInfo();
78+
//通道激活后进行心跳检查
79+
SocketUtils.sendMsg(ctx, heartJson);
7980
}
8081

8182

83+
/**
84+
* 当客户端的所有ChannelHandler中4s内没有write事件,则会触发userEventTriggered方法
85+
*
86+
* @param ctx
87+
* @param evt
88+
* @throws Exception
89+
*/
8290
@Override
8391
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
8492
//心跳配置

0 commit comments

Comments
 (0)