Skip to content

Commit 187e164

Browse files
authored
[Internal]Thin Client Integration: Adds containerId to ThinClient request. (#5109)
# Pull Request Template ## Description Adding ResourceId as the proxy expects the ResourceId in the RNTBD headers otherwise the requests will start to fail. By seting request.ResourceId = containerRid, TransportSerialization.cs will automatically add the ResourceID header. ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) ## Closing issues To automatically close an issue: closes #5107
1 parent 75125de commit 187e164

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Microsoft.Azure.Cosmos/src/ThinClientStoreClient.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ namespace Microsoft.Azure.Cosmos
66
{
77
using System;
88
using System.Collections.Concurrent;
9-
using System.Diagnostics.CodeAnalysis;
109
using System.IO;
1110
using System.Net.Http;
1211
using System.Threading;
1312
using System.Threading.Tasks;
1413
using Microsoft.Azure.Cosmos.Core.Trace;
1514
using Microsoft.Azure.Cosmos.Routing;
15+
using Microsoft.Azure.Cosmos.Tracing;
1616
using Microsoft.Azure.Documents;
1717
using Newtonsoft.Json;
1818
using static Microsoft.Azure.Cosmos.ThinClientTransportSerializer;
@@ -91,6 +91,11 @@ private async ValueTask<HttpRequestMessage> PrepareRequestForProxyAsync(
9191
BufferProviderWrapper bufferProviderWrapper = this.bufferProviderWrapperPool.Get();
9292
try
9393
{
94+
ContainerProperties collection = await clientCollectionCache.ResolveCollectionAsync(
95+
request,
96+
CancellationToken.None,
97+
NoOpTrace.Singleton);
98+
request.ResourceId = collection.ResourceId;
9499
requestMessage.Headers.TryAddWithoutValidation(
95100
ThinClientConstants.ProxyOperationType,
96101
request.OperationType.ToOperationTypeString());

0 commit comments

Comments
 (0)