ચકાસો કે Tables બિલ્ડરને સંપૂર્ણ HTTP પાઇપલાઇન મળે છે કે નહીં. તે ઇનપુટ તેના અલગ httpClient વિકલ્પને ઓવરરાઇડ કરે છે; જો એપ્લિકેશન પાસે પાઇપલાઇન હોય, તો તે પાઇપલાઇન બનાવતી વખતે પ્રોક્સી-જાણકાર ટ્રાન્સપોર્ટ ગોઠવો.

સીધા Netty HTTP ક્લાયન્ટ ઇનપુટ માટે, ટ્રાન્સપોર્ટ બનાવો અને તેને Tables ને પાસ કરો:

ProxyOptions proxy = new ProxyOptions(
    ProxyOptions.Type.HTTP,
    new InetSocketAddress("proxy.example.net", 8080)
);
proxy.setCredentials(proxyUser, proxyPassword);

HttpClient transport = new NettyAsyncHttpClientBuilder()
    .proxy(proxy)
    .build();

TableClient tables = new TableClientBuilder()
    .connectionString(storageConnectionString)
    .tableName("records")
    .httpClient(transport)
    .buildClient();

અહીં HttpClient એ com.azure.core.http.HttpClient છે. અન્ય પ્રકારો Azure Core HTTP/Netty, Azure Data Tables અને java.net.InetSocketAddress માંથી આવે છે. એપ્લિકેશન રૂપરેખાંકન અને ઓળખપત્ર ચલો પ્રદાન કરે છે.

ProxyOptions.Type.HTTP મધ્યસ્થી પસંદ કરે છે; setCredentials તેનું ખાતું પ્રદાન કરે છે અને પ્રમાણીકરણ વિનાના એન્ડપોઇન્ટ માટે છોડી શકાય છે. તે રૂપરેખાંકનમાં HTTP પ્રોક્સી સૂચિની એન્ટ્રી મંજૂર જાહેર Tables એન્ડપોઇન્ટ માર્ગ માટે સરનામું પ્રદાન કરી શકે છે; ટ્રાન્સપોર્ટ પર કોઈ પ્રોક્સી ઓળખપત્ર ન છોડો. સ્ટોરેજ કનેક્શન સ્ટ્રિંગ હજી પણ Tables સેવા પસંદ કરે છે.

આ કનેક્શન-સ્ટ્રિંગ પ્રમાણીકરણ વાપરે છે. ઓળખ-ઓળખપત્ર ગોઠવણીમાં ટોકન મેળવવા માટે અલગ HTTP ક્લાયન્ટ હોઈ શકે છે, જેનો માર્ગ પણ ગોઠવવો પડશે.

સંબંધિત લેખો