Skip to content

Commit fd34d84

Browse files
committed
Document NIO configurators
1 parent f02566a commit fd34d84

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

src/main/java/com/rabbitmq/client/impl/nio/NioParams.java

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,16 @@ public SocketChannelConfigurator getSocketChannelConfigurator() {
325325
}
326326

327327
/**
328-
* Set the {@link java.nio.channels.SocketChannel} configurator.
329-
* This gets a chance to "configure" a socket channel
330-
* before it has been opened. The default implementation disables
331-
* Nagle's algorithm.
328+
* Set the {@link java.nio.channels.SocketChannel} configurator. This gets a chance to "configure"
329+
* a socket channel before it has been opened. The default implementation disables Nagle's
330+
* algorithm.
331+
*
332+
* <p>Avoid setting the socket channel configurator directly with this method, as it can replace
333+
* an existing configurator that performs important work (like disabling Nagle's algorithm).
334+
*
335+
* <p>Prefer <em>adding</em> some behavior by using {@link #getSocketChannelConfigurator()} and
336+
* calling {@link
337+
* com.rabbitmq.client.SocketChannelConfigurator#andThen(com.rabbitmq.client.SocketChannelConfigurator)}.
332338
*
333339
* @param configurator the configurator to use
334340
*/
@@ -341,11 +347,16 @@ public SslEngineConfigurator getSslEngineConfigurator() {
341347
}
342348

343349
/**
344-
* Set the {@link SSLEngine} configurator.
345-
* This gets a change to "configure" the SSL engine
346-
* before the connection has been opened. This can be
347-
* used e.g. to set {@link javax.net.ssl.SSLParameters}.
348-
* The default implementation doesn't do anything.
350+
* Set the {@link SSLEngine} configurator. This gets a change to "configure" the SSL engine before
351+
* the connection has been opened. This can be used e.g. to set {@link
352+
* javax.net.ssl.SSLParameters}. The default implementation doesn't do anything.
353+
*
354+
* <p>Avoid setting the SSL engine configurator directly with this method, as it can replace an
355+
* existing configurator that performs important work (like enabling hostname verification).
356+
*
357+
* <p>Prefer <em>adding</em> some behavior by using {@link #getSslEngineConfigurator()} and
358+
* calling {@link
359+
* com.rabbitmq.client.SslEngineConfigurator#andThen(com.rabbitmq.client.SslEngineConfigurator)}.
349360
*
350361
* @param configurator the configurator to use
351362
*/

0 commit comments

Comments
 (0)