Skip to content

Commit a15863f

Browse files
committed
Expose only ConnectionFactory#netty() to activate Netty
Having a method like useNetty() is not necessary as netty() activates Netty as well. Moreover useNetty() does not allow to set the EventLoopGroup, which is essential to configure when using Netty. References #1663 (cherry picked from commit aed8d84) Conflicts: src/main/java/com/rabbitmq/client/ConnectionFactory.java
1 parent a5a3ded commit a15863f

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/main/java/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,14 +1440,7 @@ public void setMaxInboundMessageBodySize(int maxInboundMessageBodySize) {
14401440
this.maxInboundMessageBodySize = maxInboundMessageBodySize;
14411441
}
14421442

1443-
/**
1444-
* Use Netty with the default configuration.
1445-
*
1446-
* @return the connection factory
1447-
* @see #netty()
1448-
* @since 5.27.0
1449-
*/
1450-
public ConnectionFactory useNetty() {
1443+
private ConnectionFactory useNetty() {
14511444
this.netty = true;
14521445
this.nio = false;
14531446
return this;

src/test/java/com/rabbitmq/client/test/NettyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class NettyTest {
5151
@BeforeEach
5252
void init() {
5353
cf = TestUtils.connectionFactory();
54-
cf.useNetty();
54+
TestUtils.setIoLayer(cf, TestUtils.IO_NETTY);
5555
}
5656

5757
@Test

src/test/java/com/rabbitmq/client/test/TestUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class TestUtils {
5252
public static final String IO_LAYER = System.getProperty("io.layer", "netty");
5353
private static final String IO_SOCKET = "socket";
5454
private static final String IO_NIO = "nio";
55-
private static final String IO_NETTY = "netty";
55+
public static final String IO_NETTY = "netty";
5656
public static final List<String> IO_LAYERS =
5757
Collections.unmodifiableList(Arrays.asList(IO_SOCKET, IO_NIO, IO_NETTY));
5858

@@ -103,7 +103,7 @@ public static void setIoLayer(ConnectionFactory cf, String layer) {
103103
if (isNio(layer)) {
104104
cf.useNio();
105105
} else if (isNetty(layer)) {
106-
cf.useNetty();
106+
cf.netty();
107107
} else if (isSocket(layer)) {
108108
cf.useBlockingIo();
109109
} else {

0 commit comments

Comments
 (0)