11package io .a2a .client .transport .jsonrpc ;
22
33import io .a2a .client .http .A2AHttpClient ;
4- import io .a2a .client .http .JdkA2AHttpClient ;
4+ import io .a2a .client .http .A2AHttpClientFactory ;
55import io .a2a .client .transport .spi .ClientTransportConfigBuilder ;
66import org .jspecify .annotations .Nullable ;
77
1111 * This builder provides a fluent API for configuring the JSON-RPC transport protocol.
1212 * All configuration options are optional - if not specified, sensible defaults are used:
1313 * <ul>
14- * <li><b>HTTP client:</b> {@link JdkA2AHttpClient } (JDK's built-in HTTP client )</li>
14+ * <li><b>HTTP client:</b> Auto-selected via {@link A2AHttpClientFactory } (prefers Vert.x, falls back to JDK )</li>
1515 * <li><b>Interceptors:</b> None</li>
1616 * </ul>
1717 * <p>
@@ -78,7 +78,7 @@ public class JSONRPCTransportConfigBuilder extends ClientTransportConfigBuilder<
7878 * <li>Custom header handling</li>
7979 * </ul>
8080 * <p>
81- * If not specified, the default {@link JdkA2AHttpClient} is used .
81+ * If not specified, a client is auto-selected via {@link A2AHttpClientFactory} .
8282 * <p>
8383 * Example:
8484 * <pre>{@code
@@ -101,16 +101,16 @@ public JSONRPCTransportConfigBuilder httpClient(A2AHttpClient httpClient) {
101101 /**
102102 * Build the JSON-RPC transport configuration.
103103 * <p>
104- * If no HTTP client was configured, the default {@link JdkA2AHttpClient} is used .
104+ * If no HTTP client was configured, one is auto-selected via {@link A2AHttpClientFactory} .
105105 * Any configured interceptors are transferred to the configuration.
106106 *
107107 * @return the configured JSON-RPC transport configuration
108108 */
109109 @ Override
110110 public JSONRPCTransportConfig build () {
111- // No HTTP client provided, fallback to the default one (JDK-based implementation)
111+ // No HTTP client provided, use factory to get best available implementation
112112 if (httpClient == null ) {
113- httpClient = new JdkA2AHttpClient ();
113+ httpClient = A2AHttpClientFactory . create ();
114114 }
115115
116116 JSONRPCTransportConfig config = new JSONRPCTransportConfig (httpClient );
0 commit comments