이 콘텐츠는 선택한 언어로 제공되지 않습니다.

14.4. Configuring the Netty transport


HornetQ uses Netty, a high-performance, low-level network library.
The Netty transport can be configured to use old (blocking) Java IO, NIO (non-blocking), TCP sockets, SSL, HTTP or HTTPS. A servlet transport is also provided.

14.4.1. Configuring Netty TCP

Netty TCP is a simple unencrypted TCP socket-based transport. Netty TCP can be configured to use blocking Java Asynchronous IO (AIO) or non-blocking Java NIO (NIO). NIO is recommended on the server-side for concurrent connection scalability; however, AIO can provide better latency if many concurrent connections are not required.

Warning

If you are running connections across an untrusted network, consider SSL or HTTPS instead.

Important

If non-blocking messages are sent then there is a chance that these could arrive on the server after the calling thread has completed. This means that the security context has been cleared. If this is the case then messages will need to be sent as blocking messages.
With the Netty TCP transport all connections are initiated from the client side. This is useful in situations where firewall policies only allow connections to be initiated in one direction.
All valid Netty transport keys are defined in org.hornetq.core.remoting.impl.netty.TransportConstants. Most parameters can be used with acceptors and connectors. Some only work with acceptors. The following parameters can be used to configure Netty for simple TCP:
use-nio
If this is true then Java non-blocking NIO will be used. If set to false the older, blocking Java IO will be used. If handling many concurrent connections to the server is a requirement, the non-blocking Java NIO method is highly recommended. Java NIO does not maintain a thread per connection so can scale to many more concurrent connections than the older blocking IO method. If handling many concurrent connections is not required, slightly better performance might be gained by using older blocking IO method. The default value for this property is false on the server side and false on the client side.
host
The host name or IP address to connect to (for connectors) or listen on (for acceptors). The default value is localhost.

Important

The default for this variable is localhost. This is not accessible from remote nodes and must be modified for the server to accept incoming connections.
Acceptors can be configured with multiple comma-delimited hosts or IP addresses. Multiple addresses are not valid for connectors. 0.0.0.0 specifies that all network interfaces of a host should be accepted.
port
Specifies the port to connect to (for connectors) or listen on (for acceptors). The default value is 5445.
tcp-no-delay
If true, Nagle's algorithm is enabled. The default value is true.
tcp-send-buffer-size
Defines the size of the TCP send buffer in bytes. The default value is 32768 (32 kilobytes). TCP buffer size should be tuned according to the bandwidth and latency of your network. The buffer size in bytes should be equal to the bandwidth in bytes-per-second multiplied by the network round-trip-time (RTT) in seconds. RTT can be measured using the ping utility. For fast networks, you may wish to increase the buffer size from the default value.
tcp-receive-buffer-size
Defines the size of the TCP receive buffer in bytes. The default value is 32768 (32 kilobytes).
batch-delay
HornetQ can be configured to place write operations into batches for up to batch-delay milliseconds. This can increase overall throughput for very small messages, but does so at the expense of an increase in average latency for message transfer. The default value is 0 milliseconds.
direct-deliver
When a message arrives on the server and is delivered to consumers, by default the delivery occurs on a different thread to that in which the message arrived. This gives the best overall throughput and scalability, especially on multi-core machines. However, it also introduces additional latency due to the context switch required. For the lowest latency (and possible reduction of throughput), set direct-deliver to true (the default). For highest throughput, set to false.
nio-remoting-threads
When configured to use NIO, by default HornetQ uses three times the number of threads as cores (or hyper-threads) reported by Runtime.getRuntime().availableProcessors() to process incoming packets. nio-remoting-threads overrides this and defines the number of threads to use. The default is -1, which represents three times the value from Runtime.getRuntime().availableProcessors().
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat