|
| 1 | +Migration Guide |
| 2 | +--------------- |
| 3 | + |
| 4 | +## From 1.8 to 1.9 |
| 5 | + |
| 6 | +AsyncHttpClient v1.9 is a preview of v2, so it comes with some breaking changes. |
| 7 | + |
| 8 | +* Target JDK7, drop support for JDK5 and JDK6 |
| 9 | +* Rename many AsyncHttpClientConfig parameters: |
| 10 | + * `maxTotalConnections` becomes `maxConnections` |
| 11 | + * `maxConnectionPerHost` becomes `maxConnectionsPerHost` |
| 12 | + * `connectionTimeOutInMs` becomes `connectTimeout` |
| 13 | + * `webSocketIdleTimeoutInMs` becomes `webSocketTimeout` |
| 14 | + * `idleConnectionInPoolTimeoutInMs` becomes `pooledConnectionIdleTimeout` |
| 15 | + * `idleConnectionTimeoutInMs` becomes `readTimeout` |
| 16 | + * `requestTimeoutInMs` becomes `requestTimeout` |
| 17 | + * `maxConnectionLifeTimeInMs` becomes `connectionTTL` |
| 18 | + * `redirectEnabled` becomes `followRedirect` |
| 19 | + * `allowPoolingConnection` becomes `allowPoolingConnections` |
| 20 | + * `allowSslConnectionPool` becomes `allowPoolingSslConnections` |
| 21 | + * `connectionTimeout` becomes `connectTimeout` |
| 22 | + * `compressionEnabled` becomes `compressionEnforced` (default true) so it's always enabled and can honor user defined Accept-Encoding |
| 23 | + * `useRawUrl` becomes `disableUrlEncodingForBoundedRequests`, as it's only honored by bound requests |
| 24 | + * `getAllowPoolingConnection` becomes `isAllowPoolingConnection` |
| 25 | +* Drop `PerRequestConfig`. `requestTimeOut` and `proxy` can now be directly set on the request. |
| 26 | +* Drop `java.net.URI` in favor of own `com.ning.http.client.uri.Uri`. You can use `toJavaNetURI` to convert. |
| 27 | +* Drop `Proxy.getURI` in favor of `getUrl` |
| 28 | +* Drop deprecated methods: `Request` and `RequestBuilderBase`'s `getReqType` in favor of `getMethod`, `Request.getLength` in favor of `getContentLength` |
| 29 | +* Drop deprecated `RealmBuilder.getDomain` in favor of `getNtlmDomain` |
| 30 | +* Rename `xxxParameter` (add, set, get...) into `xxxFormParam` |
| 31 | +* Rename `xxxQueryParameter` (add, set, get...) into `xxxQueryParam` |
| 32 | +* Merge `boolean Request.isRedirectEnabled` and `boolean isRedirectOverrideSet` are merged into `Boolean isRedirectEnabled` |
| 33 | +* Remove url parameter from `SignatureCalculator.calculateAndAddSignature`, as it can be fetched on the request parameter |
| 34 | +* Rename `com.ning.http.client.websocket` package into `com.ning.http.client.ws` |
| 35 | +* WebSocket Listeners now have to implement proper interfaces to be notified or fragment events: `WebSocketByteFragmentListener` and `WebSocketTextFragmentListener` |
| 36 | +* Rename WebSocket's `sendTextMessage` into `sendMessage` and `streamText` into `stream` |
| 37 | +* Rename NettyAsyncHttpProviderConfig's `handshakeTimeoutInMillis` into `handshakeTimeout` |
| 38 | +* Netty provider now creates SslEngines instances with proper hoststring and port. |
| 39 | +* Parts, Realm and ProxyServer now take a java.nio.Charset instead of a String charset name |
| 40 | +* New AsyncHandlerExtensions methods: |
| 41 | + * `onOpenConnection`, |
| 42 | + * `onConnectionOpen`, |
| 43 | + * `onPoolConnection`, |
| 44 | + * `onConnectionPooled`, |
| 45 | + * `onSendRequest`, |
| 46 | + * `onDnsResolved`, |
| 47 | + * `onSslHandshakeCompleted` |
| 48 | +* Rename FluentCaseInsensitiveStringsMap and FluentStringsMap `replace` into `replaceWith` to not conflict with new JDK8 Map methods |
| 49 | +* execute no longer throws Exceptions, all of them are notified to the handler/future |
0 commit comments