Class ReactorNetty
- Author:
- Stephane Maldini
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringSpecifies whether the Http Server access log will be enabled.static final StringSpecifies whether the Http Server error log will be enabled.static final StringDefault selector thread count, fallback to -1 (no selector thread)static final StringDefault worker thread count, fallback to available processor (but with a minimum value of 4).static final StringDefault value whether the native transport (epoll, io_uring, kqueue) will be preferred, fallback it will be preferred when available.static final StringDefault acquisition timeout (milliseconds) before error.static final StringDefaultgetPermitsSamplingRate(between 0d and 1d (percentage)) to be used with aSamplingAllocationStrategy.static final StringDefault leasing strategy (fifo, lifo), fallback to fifo.static final StringDefault max connections.static final StringDefault max idle time, fallback - max idle time is not specified.static final StringDefault max life time, fallback - max life time is not specified.static final StringDefaultreturnPermitsSamplingRate(between 0d and 1d (percentage)) to be used with aSamplingAllocationStrategy.static final StringDefault prefetch size (Subscription.request(long)) for data stream Publisher, fallback to 128.static final StringDefault quiet period that guarantees that the disposal of the underlying LoopResources will not happen, fallback to 2 seconds.static final StringDefault maximum amount of time to wait until the disposal of the underlying LoopResources regardless if a task was submitted during the quiet period, fallback to 15 seconds.static final StringDefault value whether the SSL debugging on the client side will be enabled/disabled, fallback to SSL debugging disabled.static final StringDefault SSL handshake timeout (milliseconds), fallback to 10 seconds.static final StringDefault value whether the SSL debugging on the server side will be enabled/disabled, fallback to SSL debugging disabled.static final StringDefault worker thread count for UDP, fallback to available processor (but with a minimum value of 4).static final ZoneIdSpecifies the zone id used by the access log.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringAppend channel ID to a log message for correlated traces.static @Nullable ContextViewgetChannelContext(Channel channel) ReturnsContextViewfrom the channel attributes when exists otherwise returnsnull.static voidsafeRelease(Object msg) Try to callReferenceCounted.release()if the specified message implementsReferenceCounted.static voidsetChannelContext(Channel channel, @Nullable ContextView contextView) AddsContextViewto the channel attributes.static StringtoPrettyHexDump(Object msg) Deprecated.as of 1.1.0.static RuntimeExceptionwrapException(Throwable throwable) Wrap possibly fatal or singleton exception into a new exception instance in order to propagate in reactor flows without side effect.
- 
Field Details- 
IO_WORKER_COUNTDefault worker thread count, fallback to available processor (but with a minimum value of 4).- See Also:
 
- 
IO_SELECT_COUNTDefault selector thread count, fallback to -1 (no selector thread)Note: In most use cases using a worker thread also as a selector thread works well. A possible use case for specifying a separate selector thread might be when the worker threads are too busy and connections cannot be accepted fast enough. Note: Although more than 1 can be configured as a selector thread count, in reality only 1 thread will be used as a selector thread. - See Also:
 
- 
UDP_IO_THREAD_COUNTDefault worker thread count for UDP, fallback to available processor (but with a minimum value of 4).- See Also:
 
- 
SHUTDOWN_QUIET_PERIODDefault quiet period that guarantees that the disposal of the underlying LoopResources will not happen, fallback to 2 seconds.- See Also:
 
- 
SHUTDOWN_TIMEOUTDefault maximum amount of time to wait until the disposal of the underlying LoopResources regardless if a task was submitted during the quiet period, fallback to 15 seconds.- See Also:
 
- 
NATIVEDefault value whether the native transport (epoll, io_uring, kqueue) will be preferred, fallback it will be preferred when available.Note: On Linux,Epollwill be preferred by default. IfIO_Uringneeds to be configured, a dependency toio.netty:netty-transport-native-io_uringhas to be added.- See Also:
 
- 
POOL_MAX_CONNECTIONSDefault max connections. Fallback to 2 * available number of processors (but with a minimum value of 16)- See Also:
 
- 
POOL_ACQUIRE_TIMEOUTDefault acquisition timeout (milliseconds) before error. If -1 will never wait to acquire before opening a new connection in an unbounded fashion. Fallback 45 seconds- See Also:
 
- 
POOL_MAX_IDLE_TIMEDefault max idle time, fallback - max idle time is not specified.Note: This configuration is not applicable for TcpClient. A TCP connection is always closed and never returned to the pool.- See Also:
 
- 
POOL_MAX_LIFE_TIMEDefault max life time, fallback - max life time is not specified.Note: This configuration is not applicable for TcpClient. A TCP connection is always closed and never returned to the pool.- See Also:
 
- 
POOL_LEASING_STRATEGYDefault leasing strategy (fifo, lifo), fallback to fifo.- fifo - The connection selection is first in, first out
- lifo - The connection selection is last in, first out
 Note: This configuration is not applicable for TcpClient. A TCP connection is always closed and never returned to the pool.- See Also:
 
- 
POOL_GET_PERMITS_SAMPLING_RATEDefaultgetPermitsSamplingRate(between 0d and 1d (percentage)) to be used with aSamplingAllocationStrategy. This strategy wraps asizeBetweenAllocationStrategyand samples calls toAllocationStrategy.getPermits(int). Fallback - sampling is not enabled.- See Also:
 
- 
POOL_RETURN_PERMITS_SAMPLING_RATEDefaultreturnPermitsSamplingRate(between 0d and 1d (percentage)) to be used with aSamplingAllocationStrategy. This strategy wraps asizeBetweenAllocationStrategyand samples calls toAllocationStrategy.returnPermits(int). Fallback - sampling is not enabled.- See Also:
 
- 
SSL_HANDSHAKE_TIMEOUTDefault SSL handshake timeout (milliseconds), fallback to 10 seconds.- See Also:
 
- 
SSL_CLIENT_DEBUGDefault value whether the SSL debugging on the client side will be enabled/disabled, fallback to SSL debugging disabled.- See Also:
 
- 
SSL_SERVER_DEBUGDefault value whether the SSL debugging on the server side will be enabled/disabled, fallback to SSL debugging disabled.- See Also:
 
- 
ACCESS_LOG_ENABLEDSpecifies whether the Http Server access log will be enabled. By default, it is disabled.- See Also:
 
- 
ERROR_LOG_ENABLEDSpecifies whether the Http Server error log will be enabled. By default, it is disabled.- See Also:
 
- 
ZONE_ID_SYSTEMSpecifies the zone id used by the access log.
- 
REACTOR_NETTY_SEND_MAX_PREFETCH_SIZEDefault prefetch size (Subscription.request(long)) for data stream Publisher, fallback to 128.- See Also:
 
- 
PREDICATE_GROUP_FLUSH
 
- 
- 
Method Details- 
safeReleaseTry to callReferenceCounted.release()if the specified message implementsReferenceCounted. If the specified message doesn't implementReferenceCountedor it is already released, this method does nothing.
- 
formatAppend channel ID to a log message for correlated traces.- Parameters:
- channel- current channel associated with the msg
- msg- the log msg
- Returns:
- a formatted msg
 
- 
toPrettyHexDumpDeprecated.as of 1.1.0. This will be removed in 2.0.0 as the functionality is not used anymore.Pretty hex dump will be returned when the object isByteBuforByteBufHolder.
- 
getChannelContextReturnsContextViewfrom the channel attributes when exists otherwise returnsnull.- Parameters:
- channel- the channel
- Returns:
- ContextViewfrom the channel attributes when exists otherwise returns- null
- Since:
- 1.0.26
 
- 
setChannelContextAddsContextViewto the channel attributes. Whennullis provided, the channel attribute's value will be deleted.- Parameters:
- channel- the channel
- contextView-- ContextViewthat will be added to the channel attributes
- Since:
- 1.0.26
 
- 
wrapExceptionWrap possibly fatal or singleton exception into a new exception instance in order to propagate in reactor flows without side effect.- Returns:
- a wrapped RuntimeException
 
 
-