Skip to content
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

Upgrade libthrift #20

Merged
merged 3 commits into from
Feb 10, 2025
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
18 changes: 12 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.12.0</version>
<version>0.20.0</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Expand All @@ -57,11 +57,16 @@
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.35</version>
</dependency>
</dependencies>


Expand Down Expand Up @@ -100,6 +105,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.11.2</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.apache.thrift.TProcessor;
import org.apache.thrift.server.TNonblockingServer;
import org.apache.thrift.server.TServer;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TNonblockingServerSocket;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;
Expand Down Expand Up @@ -40,7 +39,6 @@ public void start() {
TNonblockingServer.Args serverArgs = new TNonblockingServer.Args(serverTransport);
serverArgs.processor(tProcessor);
serverArgs.protocolFactory(serverConfig.getTProtocolFactory());
serverArgs.transportFactory(new TFramedTransport.Factory());
tServer = new TNonblockingServer(serverArgs);
tServer.serve();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public TBase getResult(Object iface, TBase args) throws TException {

@Override
public TBase getEmptyArgsInstance() {
return isPrimitive ? mockResultFunction.apply(args) : new MockResult(methodName, mockResultFunction.apply(args));
return args;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.didiglobal.thriftmock.test.source;


import org.apache.thrift.TConfiguration;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
Expand All @@ -22,7 +23,7 @@ public static TProtocol initTProtocol(String host, int port,
if (timeout == null || timeout <= 0){
transport = new TSocket(host, port);
} else {
transport = new TSocket(host, port, timeout);
transport = new TSocket(new TConfiguration(), host, port, timeout);
}
transport.open();
return new TBinaryProtocol(transport);
Expand Down