Skip to content

Commit

Permalink
添加thrift client方式调用服务签名及打包
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaopei0418 committed Jul 9, 2024
1 parent d67f4c2 commit bffdee6
Show file tree
Hide file tree
Showing 14 changed files with 1,477 additions and 14 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ dependencies {
// https://mvnrepository.com/artifact/commons-lang/commons-lang
implementation group: 'commons-lang', name: 'commons-lang', version: '2.6'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
implementation group: 'org.apache.thrift', name: 'libthrift', version: '0.20.0'
// implementation group: 'io.netty', name: 'netty-all', version: '4.1.111.Final'
implementation group: 'org.apache.commons', name: 'commons-pool2', version: '2.12.0'

implementation fileTree(dir: 'libs', includes: ['*.jar'])
testImplementation 'org.springframework.boot:spring-boot-starter-test'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class DistributionProp {

private List<String> signAndWrapChain;

private List<String> thriftSignAndWrapChain;

private Boolean conditionMutualExclusion;

private Map<String, String> dxpidDistribution;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.github.distributionmessage.thread.RabbitSendMessageThread;
import com.github.distributionmessage.thread.SendMessageThread;
import com.github.distributionmessage.transformer.SignAndWrapTransformer;
import com.github.distributionmessage.transformer.ThriftSignAndWrapTransformer;
import com.github.distributionmessage.transformer.WrapTransformer;
import com.github.distributionmessage.utils.DistributionUtils;
import com.github.distributionmessage.utils.HttpClientUtils;
Expand Down Expand Up @@ -173,6 +174,12 @@ public SignAndWrapTransformer signAndWrapTransformer() {
return new SignAndWrapTransformer();
}

@Bean
@ServiceActivator(inputChannel = ChannelConstant.THRIFT_SIGN_WRAP_CHANNEL, outputChannel = ChannelConstant.IBMMQ_RECEIVE_CHANNEL)
public ThriftSignAndWrapTransformer thriftSignAndWrapTransformer() {
return new ThriftSignAndWrapTransformer();
}

@Bean
@ServiceActivator(inputChannel = ChannelConstant.FILE_RECEIVE_CHANNEL, outputChannel = ChannelConstant.IBMMQ_RECEIVE_CHANNEL)
public FileToByteArrayTransformer fileToByteArrayTransformer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ public interface ChannelConstant {

String WRAP_CHANNEL = "wrapChannel";

String SIGN_WRAP_CHANNEL = "wrapSignChannel";
String SIGN_WRAP_CHANNEL = "signWrapChannel";

String THRIFT_SIGN_WRAP_CHANNEL = "thriftSignWrapChannel";
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public File reading(File file) {
FileUtils.moveFile(file, dest);
return dest;
} catch (Exception e) {
log.error("reading file error", e);
log.info("reading file error cause:[{}]", e.getMessage());
return null;
}
}
Expand Down
Loading

0 comments on commit bffdee6

Please sign in to comment.