5959import org .springframework .util .StringUtils ;
6060
6161/**
62- * Factory bean to create a RabbitMQ ConnectionFactory, delegating most setter methods and
62+ * The factory bean to create a RabbitMQ ConnectionFactory, delegating most setter methods and
6363 * optionally enabling SSL, with or without certificate validation. When
6464 * {@link #setSslPropertiesLocation(Resource) sslPropertiesLocation} is not null, the
6565 * default implementation loads a {@code PKCS12} keystore and a {@code JKS} truststore
8080 * @author Dominique Villard
8181 * @author Zachary DeLuca
8282 * @author Ngoc Nhan
83+ * @author Artem Bilan
8384 *
8485 * @since 1.4
8586 */
@@ -167,16 +168,16 @@ public RabbitConnectionFactoryBean() {
167168 }
168169
169170 /**
170- * Whether Server Side certificate has to be validated or not.
171- * @return true if Server Side certificate has to be skipped
171+ * Whether a Server Side certificate has to be validated or not.
172+ * @return true if the Server Side certificate has to be skipped
172173 * @since 1.6.6
173174 */
174175 public boolean isSkipServerCertificateValidation () {
175176 return this .skipServerCertificateValidation ;
176177 }
177178
178179 /**
179- * Whether Server Side certificate has to be validated or not.
180+ * Whether a Server Side certificate has to be validated or not.
180181 * This would be used if useSSL is set to true and should only be used on dev or Qa regions
181182 * skipServerCertificateValidation should <b> never be set to true in production</b>
182183 * @param skipServerCertificateValidation Flag to override Server side certificate checks;
@@ -598,8 +599,10 @@ public void setExceptionHandler(ExceptionHandler exceptionHandler) {
598599 /**
599600 * Whether the factory should be configured to use Java NIO.
600601 * @param useNio true to use Java NIO, false to use blocking IO
602+ * @deprecated since 4.0 in favor of {@link #setUseNetty(boolean)}
601603 * @see com.rabbitmq.client.ConnectionFactory#useNio()
602604 */
605+ @ Deprecated (since = "4.0" , forRemoval = true )
603606 public void setUseNio (boolean useNio ) {
604607 if (useNio ) {
605608 this .connectionFactory .useNio ();
@@ -609,10 +612,26 @@ public void setUseNio(boolean useNio) {
609612 }
610613 }
611614
615+ /**
616+ * Whether the factory should be configured to use Netty.
617+ * @param useNetty true to use Netty, false to use blocking IO
618+ * @see com.rabbitmq.client.ConnectionFactory#netty()
619+ */
620+ public void setUseNetty (boolean useNetty ) {
621+ if (useNetty ) {
622+ this .connectionFactory .netty ();
623+ }
624+ else {
625+ this .connectionFactory .useBlockingIo ();
626+ }
627+ }
628+
612629 /**
613630 * @param nioParams the NIO parameters
631+ * @deprecated since 4.0 in favor of {@link #setUseNetty(boolean)}
614632 * @see com.rabbitmq.client.ConnectionFactory#setNioParams(com.rabbitmq.client.impl.nio.NioParams)
615633 */
634+ @ Deprecated (since = "4.0" , forRemoval = true )
616635 public void setNioParams (NioParams nioParams ) {
617636 this .connectionFactory .setNioParams (nioParams );
618637 }
@@ -627,7 +646,7 @@ public void setMetricsCollector(MetricsCollector metricsCollector) {
627646
628647 /**
629648 * Set to true to enable amqp-client automatic recovery. Note: Spring AMQP
630- * implements its own connection recovery and this is generally not needed.
649+ * implements its own connection recovery, and this is generally not needed.
631650 * @param automaticRecoveryEnabled true to enable.
632651 * @since 1.7.1
633652 */
@@ -638,7 +657,7 @@ public void setAutomaticRecoveryEnabled(boolean automaticRecoveryEnabled) {
638657 /**
639658 * Set to true to enable amqp-client topology recovery. Note: if there is a
640659 * Rabbit admin in the application context, Spring AMQP
641- * implements its own recovery and this is generally not needed.
660+ * implements its own recovery, and this is generally not needed.
642661 * @param topologyRecoveryEnabled true to enable.
643662 * @since 1.7.1
644663 */
0 commit comments