Skip to content

Add Netty-based frame handler #1663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test-rabbitmq-alphas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ jobs:
RABBITMQ_IMAGE: ${{ matrix.rabbitmq-image }}
- name: Get dependencies
run: make deps
- name: Test with NIO
- name: Test with Netty
run: |
./mvnw verify -P use-nio -Drabbitmqctl.bin=DOCKER:rabbitmq0 \
./mvnw verify -Dio.layer=netty -Drabbitmqctl.bin=DOCKER:rabbitmq0 \
-Dtest-broker.A.nodename=rabbit@node0 -Dtest-broker.B.nodename=rabbit@node1 \
-Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \
-Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \
-Dmaven.javadoc.skip=true \
--no-transfer-progress
- name: Test with blocking IO
run: |
./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq0 \
./mvnw verify -Dio.layer=socket -Drabbitmqctl.bin=DOCKER:rabbitmq0 \
-Dtest-broker.A.nodename=rabbit@node0 -Dtest-broker.B.nodename=rabbit@node1 \
-Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \
-Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-supported-java-versions-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
run: make deps
- name: Show version
run: ./mvnw --version
- name: Test with NIO
- name: Test with Netty
run: |
./mvnw verify -P use-nio -Drabbitmqctl.bin=DOCKER:rabbitmq \
./mvnw verify -Dio.layer=netty -Drabbitmqctl.bin=DOCKER:rabbitmq \
-Dtest-broker.A.nodename=rabbit@$(hostname) -Dmaven.javadoc.skip=true \
-Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \
-Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \
Expand All @@ -50,7 +50,7 @@ jobs:
-Dnet.bytebuddy.experimental=true
- name: Test with blocking IO
run: |
./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \
./mvnw verify -Dio.layer=socket -Drabbitmqctl.bin=DOCKER:rabbitmq \
-Dtest-broker.A.nodename=rabbit@$(hostname) -Dmaven.javadoc.skip=true \
-Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \
-Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,21 @@ jobs:
run: ci/start-cluster.sh
- name: Get dependencies
run: make deps
- name: Test with NIO
- name: Test with Netty
run: |
./mvnw verify -P use-nio -Drabbitmqctl.bin=DOCKER:rabbitmq0 \
./mvnw verify -Dio.layer=netty -Drabbitmqctl.bin=DOCKER:rabbitmq0 \
-Dtest-broker.A.nodename=rabbit@node0 -Dtest-broker.B.nodename=rabbit@node1 \
-Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \
-Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \
-Dmaven.javadoc.skip=true \
--no-transfer-progress
- name: Test with blocking IO
run: |
./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq0 \
./mvnw verify -Dio.layer=socket -Drabbitmqctl.bin=DOCKER:rabbitmq0 \
-Dtest-broker.A.nodename=rabbit@node0 -Dtest-broker.B.nodename=rabbit@node1 \
-Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \
-Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \
-Dmaven.javadoc.skip=true \
-Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \
--no-transfer-progress
- name: Stop cluster
run: docker compose --file ci/cluster/docker-compose.yml down
Expand Down
59 changes: 35 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

<spotless.check.skip>true</spotless.check.skip>
<slf4j.version>1.7.36</slf4j.version>
<netty.version>4.2.3.Final</netty.version>
<metrics.version>4.2.33</metrics.version>
<micrometer.version>1.15.2</micrometer.version>
<opentelemetry.version>1.52.0</opentelemetry.version>
Expand Down Expand Up @@ -245,30 +246,6 @@
</build>
</profile>

<!--
Profile to activate the NIO mode in the test suite:
mvn verify -P use-nio
-->
<profile>
<id>use-nio</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.failsafe.plugin.version}</version>
<configuration>
<systemPropertyVariables>
<net.bytebuddy.experimental>true</net.bytebuddy.experimental>
<use.nio>true</use.nio>
</systemPropertyVariables>
<argLine>${test-arguments}</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<!--
The "snapshots" Maven profile is used to push release artifacts to a
Expand Down Expand Up @@ -401,6 +378,21 @@
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
Expand Down Expand Up @@ -509,6 +501,20 @@
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<version>${netty.version}</version>
<classifier>osx-aarch_64</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
<classifier>linux-x86_64</classifier>
<scope>test</scope>
</dependency>

</dependencies>

Expand Down Expand Up @@ -768,8 +774,13 @@
<configuration>
<java>
<includes>
<include>src/main/java/com/rabbitmq/client/ConnectionFactory.java</include>
<include>src/main/java/com/rabbitmq/client/impl/NettyFrameHandlerFactory.java</include>
<include>src/main/java/com/rabbitmq/client/observation/**/*.java</include>
<include>src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java</include>
<include>src/test/java/com/rabbitmq/client/test/NettyTest.java</include>
<include>src/test/java/com/rabbitmq/client/test/ProtocolVersionMismatch.java</include>
<include>src/test/java/com/rabbitmq/client/test/TestUtils.java</include>
</includes>
<googleJavaFormat>
<version>${google-java-format.version}</version>
Expand Down
Loading
Loading