Skip to content

Commit aed8d84

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
1 parent f3c9e94 commit aed8d84

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
@@ -1883,14 +1883,7 @@ public ConnectionFactory setTrafficListener(TrafficListener trafficListener) {
18831883
return this;
18841884
}
18851885

1886-
/**
1887-
* Use Netty with the default configuration.
1888-
*
1889-
* @return the connection factory
1890-
* @see #netty()
1891-
* @since 5.27.0
1892-
*/
1893-
public ConnectionFactory useNetty() {
1886+
private ConnectionFactory useNetty() {
18941887
this.netty = true;
18951888
this.nio = false;
18961889
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)