Class ChannelConfig
Класс описывает транспортный профиль канала: локальный и удаленный Aeron endpoint, stream/session id, таймауты, heartbeat, backpressure policy, receive idle strategy, режим выполнения handler-ов и опциональные сервисные надстройки вроде protocol handshake и listeners.
Configuration of a single RPC channel. It describes the Aeron endpoints, stream/session ids, timeouts, heartbeat behavior, backpressure policy, receive idle strategy, handler execution mode, and optional service-level features such as protocol handshake and listeners.
Основные группы настроек / Main setting groups
- Сеть / Network:
localEndpoint,remoteEndpoint,streamId, optionalsessionId. - Таймауты / Timeouts: default RPC timeout, publication offer timeout, heartbeat interval and failure threshold.
- Прием / Receive path:
rxIdleStrategy()controls how the RX loop behaves while idle. - Обработка / Handler execution:
offloadExecutor()decides whether server handlers run in an executor or directly in the RX path. - Совместимость / Compatibility: protocol version, capability bits, and optional handshake timeout.
- Наблюдаемость / Observability: optional
RpcChannelListenercallbacks.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intМаксимальный размер одного transport message по умолчанию, 16 MiB.static final ExecutorServiceМаркерное значение для режима "выполнять handler прямо в RX-пути". -
Method Summary
Modifier and TypeMethodDescriptionВозвращает политику обработки backpressure.static ChannelConfig.Builderbuilder()Создает builder конфигурации канала.Возвращает таймаут RPC-вызова по умолчанию.Возвращает интервал heartbeat.intВозвращает допустимое число пропущенных heartbeat-интервалов.booleanПроверяет, настроено ли выполнение обработчиков прямо в rx-потоке.Returns the configured optional channel listeners.Возвращает локальный UDP endpoint канала.intВозвращает максимальный размер сообщения.intВозвращает MTU канала.Возвращает таймаут ожидания отправки при backpressure.intВозвращает размер одного буфера копирования для offload.intВозвращает размер пула буферов копирования для offload.intReturns how many additional offload execution states should be created when the retained pool is temporarily exhausted.booleanReturns whether pooled reusable execution state should be used for offloaded handlers.intReturns the number of reusable offload execution states retained per channel in the steady state.Возвращает executor для offload-обработчиков.intВозвращает размер пула offload-задач.intВозвращает емкость пула ожидающих вызовов.longReturns the local capability bitmask advertised by this channel.booleanReturns whether the optional protocol compatibility handshake is enabled.Returns the timeout used by the optional protocol handshake.intReturns the local protocol version advertised by this channel.Returns the reconnect behavior used when a call starts or a publish attempt happens while the channel is temporarily disconnected.intВозвращает начальную емкость реестра ожидающих вызовов.Возвращает удаленный UDP endpoint канала.longReturns the required remote capability bits when the optional handshake is enabled.Возвращает idle-стратегию rx-потока.intВозвращает Aeron session id.intВозвращает размер socket receive buffer.intВозвращает размер socket send buffer.intstreamId()Возвращает Aeron stream id.intВозвращает длину term buffer.
-
Field Details
-
DEFAULT_MAX_MESSAGE_SIZE
public static final int DEFAULT_MAX_MESSAGE_SIZEМаксимальный размер одного transport message по умолчанию, 16 MiB.Default maximum size of one transport message, 16 MiB.
- See Also:
-
DIRECT_EXECUTOR
Маркерное значение для режима "выполнять handler прямо в RX-пути".Marker value for the "execute the handler directly in the RX path" mode.
Используется через
ChannelConfig.Builder.offloadExecutor(ExecutorService): если передатьDIRECT_EXECUTOR, канал не будет offload-ить обработчик в executor и вызовет его прямо из receive path.Use it via
ChannelConfig.Builder.offloadExecutor(ExecutorService). When configured, the channel does not offload the handler and invokes it directly from the receive path.Это минимизирует latency, но блокирует прием на время работы handler-а, поэтому режим подходит только для гарантированно коротких обработчиков.
This minimizes latency, but receive progress is blocked while the handler runs, so the mode is suitable only for guaranteed short handlers.
-
-
Method Details
-
localEndpoint
Возвращает локальный UDP endpoint канала.Returns the local UDP endpoint of the channel.
- Returns:
- локальный endpoint / local endpoint
-
remoteEndpoint
Возвращает удаленный UDP endpoint канала.Returns the remote UDP endpoint of the channel.
- Returns:
- удаленный endpoint / remote endpoint
-
streamId
public int streamId()Возвращает Aeron stream id.Returns the Aeron stream id.
- Returns:
- stream id / stream id
-
sessionId
public int sessionId()Возвращает Aeron session id.Returns the Aeron session id.
- Returns:
- session id;
0означает выбор Aeron / session id;0means Aeron-selected
-
mtuLength
public int mtuLength()Возвращает MTU канала.Returns the channel MTU length.
- Returns:
- MTU в байтах / MTU length in bytes
-
termLength
public int termLength()Возвращает длину term buffer.Returns the term buffer length.
- Returns:
- длина term buffer в байтах / term buffer length in bytes
-
socketSndBuf
public int socketSndBuf()Возвращает размер socket send buffer.Returns the socket send buffer size.
- Returns:
- размер send buffer в байтах / send buffer size in bytes
-
socketRcvBuf
public int socketRcvBuf()Возвращает размер socket receive buffer.Returns the socket receive buffer size.
- Returns:
- размер receive buffer в байтах / receive buffer size in bytes
-
defaultTimeout
Возвращает таймаут RPC-вызова по умолчанию.Returns the default RPC call timeout.
- Returns:
- таймаут вызова по умолчанию / default call timeout
-
offerTimeout
Возвращает таймаут ожидания отправки при backpressure.Returns the offer timeout used while handling backpressure.
- Returns:
- таймаут offer / offer timeout
-
heartbeatInterval
Возвращает интервал heartbeat.Returns the heartbeat interval.
- Returns:
- интервал heartbeat / heartbeat interval
-
heartbeatMissedLimit
public int heartbeatMissedLimit()Возвращает допустимое число пропущенных heartbeat-интервалов.Returns the allowed number of missed heartbeat intervals.
- Returns:
- лимит пропущенных heartbeat / missed heartbeat limit
-
maxMessageSize
public int maxMessageSize()Возвращает максимальный размер сообщения.Returns the maximum message size.
- Returns:
- максимальный размер сообщения в байтах / maximum message size in bytes
-
backpressurePolicy
Возвращает политику обработки backpressure.Returns the backpressure handling policy.
- Returns:
- политика backpressure / backpressure policy
-
reconnectStrategy
Returns the reconnect behavior used when a call starts or a publish attempt happens while the channel is temporarily disconnected.ReconnectStrategy.FAIL_FASTpreserves the old behavior and fails immediately.ReconnectStrategy.WAIT_FOR_CONNECTIONwaits for the existing Aeron publication and heartbeat path to become connected again within the call timeout.- Returns:
- reconnect strategy for this channel
-
protocolHandshakeEnabled
public boolean protocolHandshakeEnabled()Returns whether the optional protocol compatibility handshake is enabled.- Returns:
trueif the handshake is enabled
-
protocolVersion
public int protocolVersion()Returns the local protocol version advertised by this channel.- Returns:
- local protocol version
-
protocolCapabilities
public long protocolCapabilities()Returns the local capability bitmask advertised by this channel.- Returns:
- local protocol capabilities
-
requiredRemoteCapabilities
public long requiredRemoteCapabilities()Returns the required remote capability bits when the optional handshake is enabled.- Returns:
- required remote capabilities
-
protocolHandshakeTimeout
Returns the timeout used by the optional protocol handshake.- Returns:
- protocol handshake timeout
-
listeners
Returns the configured optional channel listeners.- Returns:
- channel listeners, possibly empty
-
rxIdleStrategy
Возвращает idle-стратегию rx-потока.Returns the receive thread idle strategy.
- Returns:
- idle-стратегия rx-потока / receive idle strategy
-
pendingPoolCapacity
public int pendingPoolCapacity()Возвращает емкость пула ожидающих вызовов.Returns the pending call pool capacity.
- Returns:
- емкость pending-пула / pending pool capacity
-
registryInitialCapacity
public int registryInitialCapacity()Возвращает начальную емкость реестра ожидающих вызовов.Returns the initial capacity of the pending call registry.
- Returns:
- начальная емкость реестра / registry initial capacity
-
offloadExecutor
Возвращает executor для offload-обработчиков.Returns the executor used for offloaded handlers.
- Returns:
- executor или
nullдля node-default executor / executor ornullfor the node-default executor
-
offloadTaskPoolSize
public int offloadTaskPoolSize()Возвращает размер пула offload-задач.Returns the offload task pool size.
- Returns:
- размер пула offload-задач / offload task pool size
-
offloadCopyPoolSize
public int offloadCopyPoolSize()Возвращает размер пула буферов копирования для offload.Returns the offload copy buffer pool size.
- Returns:
- размер пула copy-буферов / copy buffer pool size
-
offloadCopyBufferSize
public int offloadCopyBufferSize()Возвращает размер одного буфера копирования для offload.Returns the size of one offload copy buffer.
- Returns:
- размер copy-буфера в байтах / copy buffer size in bytes
-
offloadExecutionStatePoolingEnabled
public boolean offloadExecutionStatePoolingEnabled()Returns whether pooled reusable execution state should be used for offloaded handlers.- Returns:
truewhen offload execution state pooling is enabled
-
offloadExecutionStatePoolSize
public int offloadExecutionStatePoolSize()Returns the number of reusable offload execution states retained per channel in the steady state.- Returns:
- retained offload execution state pool size
-
offloadExecutionStatePoolGrowthChunk
public int offloadExecutionStatePoolGrowthChunk()Returns how many additional offload execution states should be created when the retained pool is temporarily exhausted.- Returns:
- growth chunk for temporary pool expansion
-
isDirectExecutor
public boolean isDirectExecutor()Проверяет, настроено ли выполнение обработчиков прямо в rx-потоке.Checks whether handlers are configured to run directly in the receive thread.
- Returns:
true, если используетсяDIRECT_EXECUTOR/truewhenDIRECT_EXECUTORis used
-
builder
Создает builder конфигурации канала.Creates a channel configuration builder.
- Returns:
- новый builder / new builder
-