azure-docs-sdk-java/docs-ref-autogen/com.azure.core.http.netty.N...

231 строка
28 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder"
name: "NettyAsyncHttpClientBuilder"
nameWithType: "NettyAsyncHttpClientBuilder"
summary: "Builder class responsible for creating instances of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient\"></xref> backed by Reactor Netty."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public class **NettyAsyncHttpClientBuilder**"
constructors:
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.NettyAsyncHttpClientBuilder()"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.NettyAsyncHttpClientBuilder()"
name: "NettyAsyncHttpClientBuilder()"
nameWithType: "NettyAsyncHttpClientBuilder.NettyAsyncHttpClientBuilder()"
summary: "Creates a new builder instance, where a builder is capable of generating multiple instances of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient\"></xref> backed by Reactor Netty."
syntax: "public NettyAsyncHttpClientBuilder()"
desc: "Creates a new builder instance, where a builder is capable of generating multiple instances of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient\"></xref> backed by Reactor Netty."
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.NettyAsyncHttpClientBuilder(reactor.netty.http.client.HttpClient)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.NettyAsyncHttpClientBuilder(HttpClient nettyHttpClient)"
name: "NettyAsyncHttpClientBuilder(HttpClient nettyHttpClient)"
nameWithType: "NettyAsyncHttpClientBuilder.NettyAsyncHttpClientBuilder(HttpClient nettyHttpClient)"
summary: "Creates a new builder instance, where a builder is capable of generating multiple instances of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> based on the provided Reactor Netty Http<wbr>Client."
parameters:
- description: "base reactor netty HttpClient"
name: "nettyHttpClient"
type: "<xref href=\"reactor.netty.http.client.HttpClient?alt=reactor.netty.http.client.HttpClient&text=HttpClient\" data-throw-if-not-resolved=\"False\" />"
syntax: "public NettyAsyncHttpClientBuilder(HttpClient nettyHttpClient)"
desc: "Creates a new builder instance, where a builder is capable of generating multiple instances of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpClient\"></xref> based on the provided Reactor Netty HttpClient.\n\n```java\n// Creates a reactor-netty client with netty logging enabled.\n reactor.netty.http.client.HttpClient baseHttpClient = reactor.netty.http.client.HttpClient.create()\n .wiretap(TcpClient.class.getName(), LogLevel.INFO);\n // Create an HttpClient based on above reactor-netty client and configure EventLoop count.\n HttpClient client = new NettyAsyncHttpClientBuilder(baseHttpClient)\n .eventLoopGroup(new NioEventLoopGroup(5))\n .build();\n```"
methods:
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.build()"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.build()"
name: "build()"
nameWithType: "NettyAsyncHttpClientBuilder.build()"
summary: "Creates a new Netty-backed <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient\"></xref> instance on every call, using the configuration set in the builder at the time of the build method call."
syntax: "public HttpClient build()"
desc: "Creates a new Netty-backed <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient\"></xref> instance on every call, using the configuration set in the builder at the time of the build method call. Please be aware that client built from this builder can support synchronously and asynchronously call of sending request. Use <xref uid=\"com.azure.core.http.HttpClient.sendSync*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient#sendSync(HttpRequest, Context)\"></xref> to send the provided request synchronously with contextual information."
returns:
description: "A new Netty-backed <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient\"></xref> instance."
type: "<xref href=\"com.azure.core.http.HttpClient?alt=com.azure.core.http.HttpClient&text=HttpClient\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.configuration(com.azure.core.util.Configuration)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.configuration(Configuration configuration)"
name: "configuration(Configuration configuration)"
nameWithType: "NettyAsyncHttpClientBuilder.configuration(Configuration configuration)"
summary: "Sets the configuration store that is used during construction of the HTTP client."
parameters:
- description: "The configuration store used to"
name: "configuration"
type: "<xref href=\"com.azure.core.util.Configuration?alt=com.azure.core.util.Configuration&text=Configuration\" data-throw-if-not-resolved=\"False\" />"
syntax: "public NettyAsyncHttpClientBuilder configuration(Configuration configuration)"
desc: "Sets the configuration store that is used during construction of the HTTP client.\n\nThe default configuration store is a clone of the <xref uid=\"Configuration#getGlobalConfiguration()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"global\n configuration store\"></xref>, use <xref uid=\"com.azure.core.util.Configuration.NONE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#NONE\"></xref> to bypass using configuration settings during construction."
returns:
description: "The updated NettyAsyncHttpClientBuilder object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.connectTimeout(java.time.Duration)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.connectTimeout(Duration connectTimeout)"
name: "connectTimeout(Duration connectTimeout)"
nameWithType: "NettyAsyncHttpClientBuilder.connectTimeout(Duration connectTimeout)"
summary: "Sets the connection timeout for a request to be sent."
parameters:
- description: "Connect timeout duration."
name: "connectTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public NettyAsyncHttpClientBuilder connectTimeout(Duration connectTimeout)"
desc: "Sets the connection timeout for a request to be sent.\n\nThe connection timeout begins once the request attempts to connect to the remote host and finishes once the connection is resolved.\n\nIf `connectTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_CONNECT_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_CONNECT_TIMEOUT\"></xref> or a 10-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout will be applied. When applying the timeout the greatest of one millisecond and the value of `connectTimeout` will be used.\n\nBy default, the connection timeout is 10 seconds."
returns:
description: "The updated <xref uid=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NettyAsyncHttpClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.connectionProvider(reactor.netty.resources.ConnectionProvider)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.connectionProvider(ConnectionProvider connectionProvider)"
name: "connectionProvider(ConnectionProvider connectionProvider)"
nameWithType: "NettyAsyncHttpClientBuilder.connectionProvider(ConnectionProvider connectionProvider)"
summary: "Sets the connection provider."
parameters:
- description: "the connection provider"
name: "connectionProvider"
type: "<xref href=\"reactor.netty.resources.ConnectionProvider?alt=reactor.netty.resources.ConnectionProvider&text=ConnectionProvider\" data-throw-if-not-resolved=\"False\" />"
syntax: "public NettyAsyncHttpClientBuilder connectionProvider(ConnectionProvider connectionProvider)"
desc: "Sets the connection provider.\n\n**Code Sample**\n\n```java\n// The following creates a connection provider which will have each connection use the base name\n // 'myHttpConnection', has a limit of 500 concurrent connections in the connection pool, has no limit on the\n // number of connection requests that can be pending when all connections are in use, and removes a connection\n // from the pool if the connection isn't used for 60 seconds.\n ConnectionProvider connectionProvider = ConnectionProvider.builder(\"myHttpConnection\")\n .maxConnections(500)\n .pendingAcquireMaxCount(-1)\n .maxIdleTime(Duration.ofSeconds(60))\n .build();\n\n HttpClient client = new NettyAsyncHttpClientBuilder()\n .connectionProvider(connectionProvider)\n .build();\n```"
returns:
description: "the updated <xref uid=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NettyAsyncHttpClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.disableBufferCopy(boolean)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.disableBufferCopy(boolean disableBufferCopy)"
name: "disableBufferCopy(boolean disableBufferCopy)"
nameWithType: "NettyAsyncHttpClientBuilder.disableBufferCopy(boolean disableBufferCopy)"
summary: "Disables deep copy of response <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ByteBuffer\"></xref> into a heap location that is managed by this client as opposed to the underlying netty library which may use direct buffer pool."
parameters:
- description: "If set to <code>true</code>, the client built from this builder will not deep-copy response\n <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ByteBuffers\"></xref>."
name: "disableBufferCopy"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "public NettyAsyncHttpClientBuilder disableBufferCopy(boolean disableBufferCopy)"
desc: "Disables deep copy of response <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ByteBuffer\"></xref> into a heap location that is managed by this client as opposed to the underlying netty library which may use direct buffer pool.\n **Caution: Disabling this is not recommended as it can lead to data corruption if the downstream consumers of the response do not handle the byte buffers before netty releases them.** If copy is disabled, underlying Netty layer can potentially reclaim byte array backed by the `ByteBuffer` upon the return of `onNext()`. So, users should ensure they process the <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ByteBuffer\"></xref> immediately and then return.\n\n```java\nHttpClient client = new NettyAsyncHttpClientBuilder()\n .port(8080)\n .disableBufferCopy(true)\n .build();\n\n client.send(httpRequest)\n .flatMapMany(response -> response.getBody())\n .map(byteBuffer -> completeProcessingByteBuffer(byteBuffer))\n .subscribe();\n```"
returns:
description: "The updated <xref uid=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NettyAsyncHttpClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.eventLoopGroup(io.netty.channel.EventLoopGroup)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.eventLoopGroup(EventLoopGroup eventLoopGroup)"
name: "eventLoopGroup(EventLoopGroup eventLoopGroup)"
nameWithType: "NettyAsyncHttpClientBuilder.eventLoopGroup(EventLoopGroup eventLoopGroup)"
summary: "Sets the IO event loop group that will be used to run IO loops."
parameters:
- description: "The <xref uid=\"io.netty.channel.EventLoopGroup\" data-throw-if-not-resolved=\"false\" data-raw-source=\"EventLoopGroup\"></xref> that will run IO loops."
name: "eventLoopGroup"
type: "<a href=\"https://netty.io/4.1/api/io/netty/channel/EventLoopGroup.html\">EventLoopGroup</a>"
syntax: "public NettyAsyncHttpClientBuilder eventLoopGroup(EventLoopGroup eventLoopGroup)"
desc: "Sets the IO event loop group that will be used to run IO loops.\n\n**Code Samples**\n\n```java\nint threadCount = 5;\n HttpClient client = new NettyAsyncHttpClientBuilder()\n .eventLoopGroup(new NioEventLoopGroup(threadCount))\n .build();\n```"
returns:
description: "the updated NettyAsyncHttpClientBuilder object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.nioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.nioEventLoopGroup(NioEventLoopGroup nioEventLoopGroup)"
name: "nioEventLoopGroup(NioEventLoopGroup nioEventLoopGroup)"
nameWithType: "NettyAsyncHttpClientBuilder.nioEventLoopGroup(NioEventLoopGroup nioEventLoopGroup)"
summary: "Sets the NIO event loop group that will be used to run IO loops."
deprecatedTag: "deprecated in favor of <xref uid=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder.eventLoopGroup(io.netty.channel.EventLoopGroup)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#eventLoopGroup(EventLoopGroup)\"></xref>."
parameters:
- description: "The <xref uid=\"io.netty.channel.nio.NioEventLoopGroup\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NioEventLoopGroup\"></xref> that will run IO loops."
name: "nioEventLoopGroup"
type: "<a href=\"https://netty.io/4.1/api/io/netty/channel/nio/NioEventLoopGroup.html\">NioEventLoopGroup</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public NettyAsyncHttpClientBuilder nioEventLoopGroup(NioEventLoopGroup nioEventLoopGroup)"
desc: "Sets the NIO event loop group that will be used to run IO loops."
hasDeprecatedTag: true
returns:
description: "the updated NettyAsyncHttpClientBuilder object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.port(int)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.port(int port)"
name: "port(int port)"
nameWithType: "NettyAsyncHttpClientBuilder.port(int port)"
summary: "Sets the port which this client should connect, which by default will be set to port 80."
parameters:
- description: "The port to connect to."
name: "port"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public NettyAsyncHttpClientBuilder port(int port)"
desc: "Sets the port which this client should connect, which by default will be set to port 80."
returns:
description: "the updated NettyAsyncHttpClientBuilder object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.proxy(com.azure.core.http.ProxyOptions)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.proxy(ProxyOptions proxyOptions)"
name: "proxy(ProxyOptions proxyOptions)"
nameWithType: "NettyAsyncHttpClientBuilder.proxy(ProxyOptions proxyOptions)"
summary: "Sets the <xref uid=\"com.azure.core.http.ProxyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"proxy options\"></xref> that the client will use."
parameters:
- description: "The proxy configuration to use."
name: "proxyOptions"
type: "<xref href=\"com.azure.core.http.ProxyOptions?alt=com.azure.core.http.ProxyOptions&text=ProxyOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public NettyAsyncHttpClientBuilder proxy(ProxyOptions proxyOptions)"
desc: "Sets the <xref uid=\"com.azure.core.http.ProxyOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"proxy options\"></xref> that the client will use."
returns:
description: "the updated NettyAsyncHttpClientBuilder object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.readTimeout(java.time.Duration)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.readTimeout(Duration readTimeout)"
name: "readTimeout(Duration readTimeout)"
nameWithType: "NettyAsyncHttpClientBuilder.readTimeout(Duration readTimeout)"
summary: "Sets the read timeout duration used when reading the server response."
parameters:
- description: "Read timeout duration."
name: "readTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public NettyAsyncHttpClientBuilder readTimeout(Duration readTimeout)"
desc: "Sets the read timeout duration used when reading the server response.\n\nThe read timeout begins once the first response read is triggered after the server response is received. This timeout triggers periodically but won't fire its operation if another read operation has completed between when the timeout is triggered and completes.\n\nIf `readTimeout` is null or <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_READ_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_READ_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout period will be applied to response read. When applying the timeout the greatest of one millisecond and the value of `readTimeout` will be used."
returns:
description: "The updated <xref uid=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NettyAsyncHttpClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.responseTimeout(java.time.Duration)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.responseTimeout(Duration responseTimeout)"
name: "responseTimeout(Duration responseTimeout)"
nameWithType: "NettyAsyncHttpClientBuilder.responseTimeout(Duration responseTimeout)"
summary: "Sets the response timeout duration used when waiting for a server to reply."
parameters:
- description: "Response timeout duration."
name: "responseTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public NettyAsyncHttpClientBuilder responseTimeout(Duration responseTimeout)"
desc: "Sets the response timeout duration used when waiting for a server to reply.\n\nThe response timeout begins once the request write completes and finishes once the first response read is triggered when the server response is received.\n\nIf `responseTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_RESPONSE_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_RESPONSE_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no timeout will be applied to the response. When applying the timeout the greatest of one millisecond and the value of `responseTimeout` will be used."
returns:
description: "The updated <xref uid=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NettyAsyncHttpClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.wiretap(boolean)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.wiretap(boolean enableWiretap)"
name: "wiretap(boolean enableWiretap)"
nameWithType: "NettyAsyncHttpClientBuilder.wiretap(boolean enableWiretap)"
summary: "Enables the Netty wiretap feature."
deprecatedTag: "If logging should be enabled as the Reactor Netty level, construct the builder using <xref uid=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder.NettyAsyncHttpClientBuilder(reactor.netty.http.client.HttpClient)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#NettyAsyncHttpClientBuilder(HttpClient)\"></xref> where the passed Reactor Netty Http<wbr>Client has logging configured."
parameters:
- description: "Flag indicating wiretap status"
name: "enableWiretap"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public NettyAsyncHttpClientBuilder wiretap(boolean enableWiretap)"
desc: "Enables the Netty wiretap feature."
hasDeprecatedTag: true
returns:
description: "the updated NettyAsyncHttpClientBuilder object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.writeTimeout(java.time.Duration)"
fullName: "com.azure.core.http.netty.NettyAsyncHttpClientBuilder.writeTimeout(Duration writeTimeout)"
name: "writeTimeout(Duration writeTimeout)"
nameWithType: "NettyAsyncHttpClientBuilder.writeTimeout(Duration writeTimeout)"
summary: "Sets the writing timeout for a request to be sent."
parameters:
- description: "Write operation timeout duration."
name: "writeTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public NettyAsyncHttpClientBuilder writeTimeout(Duration writeTimeout)"
desc: "Sets the writing timeout for a request to be sent.\n\nThe writing timeout does not apply to the entire request but to the request being sent over the wire. For example a request body which emits `10` `8KB` buffers will trigger `10` write operations, the last write tracker will update when each operation completes and the outbound buffer will be periodically checked to determine if it is still draining.\n\nIf `writeTimeout` is null either <xref uid=\"com.azure.core.util.Configuration.PROPERTY_AZURE_REQUEST_WRITE_TIMEOUT\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Configuration#PROPERTY_AZURE_REQUEST_WRITE_TIMEOUT\"></xref> or a 60-second timeout will be used, if it is a <xref uid=\"java.time.Duration\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration\"></xref> less than or equal to zero then no write timeout will be applied. When applying the timeout the greatest of one millisecond and the value of `writeTimeout` will be used."
returns:
description: "The updated <xref uid=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NettyAsyncHttpClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.core.http.netty.NettyAsyncHttpClientBuilder?alt=com.azure.core.http.netty.NettyAsyncHttpClientBuilder&text=NettyAsyncHttpClientBuilder\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Builder class responsible for creating instances of <xref uid=\"com.azure.core.http.HttpClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient\"></xref> backed by Reactor Netty. The client built from this builder can support sending requests synchronously and asynchronously. Use <xref uid=\"com.azure.core.http.HttpClient.sendSync*\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.http.HttpClient#sendSync(HttpRequest, Context)\"></xref> to send the provided request synchronously with contextual information.\n\n**Building a new HttpClient instance**\n\n```java\nHttpClient client = new NettyAsyncHttpClientBuilder()\n .port(8080)\n .build();\n```\n\n**Building a new HttpClient instance using http proxy.**\n\nConfiguring the Netty client with a proxy is relevant when your application needs to communicate with Azure services through a proxy server.\n\n```java\nHttpClient client = new NettyAsyncHttpClientBuilder()\n .port(8080)\n .build();\n```\n\n**Building a new HttpClient instance with HTTP/2 Support.**\n\n```java\nHttpClient client = new NettyAsyncHttpClientBuilder()\n .port(8080)\n .build();\n```\n\nIt is also possible to create a Netty HttpClient that only supports HTTP/2.\n\n```java\n// Constructs an HttpClient that only supports HTTP/2.\n HttpClient client = new NettyAsyncHttpClientBuilder(reactor.netty.http.client.HttpClient.create()\n .protocol(HttpProtocol.H2))\n .build();\n```"
metadata: {}
package: "com.azure.core.http.netty"
artifact: com.azure:azure-core-http-netty:1.15.6