azure cosmosdb - DocumentDB: using TCP connection with client lib > 1.9.0 -


with microsoft.azure.documentdb 1.9.0 connectionprotocol variable in connectionpolicy has been made obsolete comment:

"this property deprecated. please use connectionmode choose communication protocol in conjution connection endpoint mode."

we still set tcp, , set connectionmode direct. however, when doing fiddler capture of our app can see requests going documentdb on https.

how force lib use tcp connection? have change endpoint string? ours of form:

https://mydocumentdb.documents.azure.com:443

as that's azure tells use. i'm not clear comment means "connection endpoint mode".

edit: request, here's connection code:

documentdbconnection connectiondata = new documentdbconnection();  connectionpolicy clientconnectionpolicy     = connectionpolicy.default; clientconnectionpolicy.connectionmode       = connectionmode.direct; clientconnectionpolicy.connectionprotocol   = protocol.tcp;  connectiondata.dbclient = new documentclient( new uri( dbendpoint ), accountkey, clientconnectionpolicy );  // initial connection upfront avoid first-query latency await connectiondata.dbclient.openasync();  databaseaccount dbaccount = await connectiondata.dbclient.getdatabaseaccountasync(); 

direct tcp mode supported requests server resources(like documents). requests master resources(like document collection) still go through gateway.

can elaborate kind of requests seeing in fiddler? note client initialization related requests go through gateway , subsequent requests server resources directed using tcp.

are using partitioned collections feature?

note brought connectionprotocol in .net sdk 1.9.2(which marked obsolete earlier). if setting protocol tcp , mode direct earlier should work expected. no need change endpoint string.

regards, rajesh


Comments