feat:release 1.2.0-Greenwich

pull/94/head
skyehtzhang 3 years ago
parent 472910c54e
commit f7bed3999d

@ -77,7 +77,7 @@
<properties>
<!-- Project revision -->
<revision>1.2.0-Greenwich-SNAPSHOT</revision>
<revision>1.2.0-Greenwich</revision>
<!-- Spring Cloud -->
<spring.cloud.version>Greenwich.SR6</spring.cloud.version>

@ -41,13 +41,14 @@ public class MetadataFeignAspect {
/**
* Get service name before execution of Feign client.
*
* @param joinPoint join point
*/
@Before("execute()")
public void doBefore(JoinPoint joinPoint) {
Request request = (Request) joinPoint.getArgs()[0];
MetadataContextHolder.get().putSystemMetadata(MetadataConstant.SystemMetadataKey.PEER_SERVICE,
MetadataContextHolder.get().putSystemMetadata(
MetadataConstant.SystemMetadataKey.PEER_SERVICE,
URI.create(request.url()).getAuthority());
}
}

@ -55,27 +55,33 @@ public class MetadataFirstScgFilter implements GlobalFilter, Ordered {
Route route = exchange.getAttribute(GATEWAY_ROUTE_ATTR);
// get metadata of current thread
MetadataContext metadataContext = exchange.getAttribute(MetadataConstant.HeaderName.METADATA_CONTEXT);
MetadataContext metadataContext = exchange
.getAttribute(MetadataConstant.HeaderName.METADATA_CONTEXT);
if (metadataContext == null) {
metadataContext = MetadataContextHolder.get();
}
// TODO The peer namespace is temporarily the same as the local namespace
metadataContext.putSystemMetadata(MetadataConstant.SystemMetadataKey.PEER_NAMESPACE,
metadataContext.putSystemMetadata(
MetadataConstant.SystemMetadataKey.PEER_NAMESPACE,
MetadataContext.LOCAL_NAMESPACE);
if (route != null) {
metadataContext.putSystemMetadata(MetadataConstant.SystemMetadataKey.PEER_SERVICE,
metadataContext.putSystemMetadata(
MetadataConstant.SystemMetadataKey.PEER_SERVICE,
route.getUri().getAuthority());
}
else {
metadataContext.putSystemMetadata(MetadataConstant.SystemMetadataKey.PEER_SERVICE,
metadataContext.putSystemMetadata(
MetadataConstant.SystemMetadataKey.PEER_SERVICE,
exchange.getRequest().getURI().getAuthority());
}
metadataContext.putSystemMetadata(MetadataConstant.SystemMetadataKey.PEER_PATH,
exchange.getRequest().getURI().getPath());
exchange.getAttributes().put(MetadataConstant.HeaderName.METADATA_CONTEXT, metadataContext);
exchange.getAttributes().put(MetadataConstant.HeaderName.METADATA_CONTEXT,
metadataContext);
return chain.filter(exchange);
}
}

@ -62,7 +62,7 @@
</developers>
<properties>
<revision>1.2.0-Greenwich-SNAPSHOT</revision>
<revision>1.2.0-Greenwich</revision>
<polaris.version>1.3.1</polaris.version>
<!-- Dependencies -->

Loading…
Cancel
Save