Merge branch 'dev' into test
This commit is contained in:
@@ -24,8 +24,7 @@ public class ApiFlowDispatcher {
|
||||
private final MessagingTemplate messagingTemplate;
|
||||
|
||||
public ApiInvocationContext dispatch(String apiCode, String version, ApiInvocationContext context) {
|
||||
MessageChannel channel = integrationFlowManager.locateInputChannel(apiCode, version)
|
||||
.orElseThrow(() -> ServiceExceptionUtil.exception(API_FLOW_NOT_FOUND, apiCode, version));
|
||||
MessageChannel channel = requireInputChannel(apiCode, version);
|
||||
Message<ApiInvocationContext> message = MessageBuilder.withPayload(context)
|
||||
.setHeader("apiCode", apiCode)
|
||||
.setHeader("version", version)
|
||||
@@ -36,4 +35,14 @@ public class ApiFlowDispatcher {
|
||||
}
|
||||
return (ApiInvocationContext) reply.getPayload();
|
||||
}
|
||||
|
||||
private MessageChannel requireInputChannel(String apiCode, String version) {
|
||||
// 未命中时,进行一次兜底补偿查询
|
||||
return integrationFlowManager.locateInputChannel(apiCode, version)
|
||||
.or(() -> {
|
||||
integrationFlowManager.refresh(apiCode, version);
|
||||
return integrationFlowManager.locateInputChannel(apiCode, version);
|
||||
})
|
||||
.orElseThrow(() -> ServiceExceptionUtil.exception(API_FLOW_NOT_FOUND, apiCode, version));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class DatabusApiInvocationExample {
|
||||
queryParams.put("businessCode", "11");
|
||||
queryParams.put("fileId", "11");
|
||||
queryParams.put("null", null);
|
||||
String signature = ZTJGCryptoSignatureUtils.generateSignature(queryParams, Map.of(), APP_ID, TIMESTAMP);
|
||||
String signature = generateSignature(queryParams, Map.of());
|
||||
URI requestUri = buildUri(TARGET_API, queryParams);
|
||||
String nonce = "171615676c7d4d96b9f55f3d90ad27e0";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user