fix:fix caller disposable metadata handle when using tracing. (#1483)

2023
Haotian Zhang 1 week ago committed by GitHub
parent 6992011ed5
commit f59e820c73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -42,3 +42,4 @@
- [feat:support auth.](https://github.com/Tencent/spring-cloud-tencent/pull/1479) - [feat:support auth.](https://github.com/Tencent/spring-cloud-tencent/pull/1479)
- [feat:upgrade trace plugin.](https://github.com/Tencent/spring-cloud-tencent/pull/1480) - [feat:upgrade trace plugin.](https://github.com/Tencent/spring-cloud-tencent/pull/1480)
- [feat:support smooth upgrade from tsf.](https://github.com/Tencent/spring-cloud-tencent/pull/1482) - [feat:support smooth upgrade from tsf.](https://github.com/Tencent/spring-cloud-tencent/pull/1482)
- [fix:fix caller disposable metadata handle when using tracing.](https://github.com/Tencent/spring-cloud-tencent/pull/1483)

@ -166,9 +166,11 @@ public final class MetadataContextHolder {
} }
// caller disposable metadata to caller custom disposable metadata // caller disposable metadata to caller custom disposable metadata
MetadataContainer metadataContainerDownstream = metadataManager.getMetadataContainer(MetadataType.CUSTOM, false); MetadataContainer metadataContainerDownstream = metadataManager.getMetadataContainer(MetadataType.CUSTOM, false);
MetadataContainer callerCustomMetadataContainer = metadataManager.getMetadataContainer(MetadataType.CUSTOM, true);
if (!CollectionUtils.isEmpty(dynamicDisposableMetadata)) { if (!CollectionUtils.isEmpty(dynamicDisposableMetadata)) {
for (Map.Entry<String, String> entry : dynamicDisposableMetadata.entrySet()) { for (Map.Entry<String, String> entry : dynamicDisposableMetadata.entrySet()) {
metadataContainerDownstream.putMetadataStringValue(entry.getKey(), entry.getValue(), TransitiveType.NONE); metadataContainerDownstream.putMetadataStringValue(entry.getKey(), entry.getValue(), TransitiveType.NONE);
callerCustomMetadataContainer.putMetadataStringValue(entry.getKey(), entry.getValue(), TransitiveType.DISPOSABLE);
} }
} }
// caller application metadata to caller application disposable metadata // caller application metadata to caller application disposable metadata

Loading…
Cancel
Save