Class CoreGlobalConfig
- Since:
- 25.1
- Author:
- 渔民小镇
- date:
- 2025-08-24
-
Field Summary
FieldsModifier and TypeFieldDescriptionBroadcast trace hook used to record diagnostic information when broadcast messages are sent.intFrequency in milliseconds for cleaning up expired futures.booleanWhether development mode is enabled, providing extra diagnostics.booleanWhether to enable the Aeron fragment assembler for large messages.intMaximum number of fragments to assemble per poll operation.Human-readable publication name derived fromnetId.intBuffer size in bytes for the Aeron publisher.intMaximum messages drained per publication per publisher loop; values less than or equal to 0 drain all.longMaximum park duration in nanoseconds for publisher idle backoff.intMaximum spin iterations for publisher idle backoff.intMaximum yield iterations for publisher idle backoff.longMinimum park duration in nanoseconds for publisher idle backoff.intMaximum retry attempts for retryable Aeron offer failures; 0 disables retry and values less than 0 retry indefinitely.intMaximum queued messages per Aeron publication; values less than or equal to 0 use an unbounded queue.final BarSkeletonSettingGlobal business framework settings.intDefault timeout in milliseconds for request-response operations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the future timeout in milliseconds, with a 200ms buffer added to the base timeout.voidsetNetId(int netId) Set the network ID.
-
Field Details
-
setting
Global business framework settings. -
netPubName
Human-readable publication name derived fromnetId. -
timeoutMillis
public int timeoutMillisDefault timeout in milliseconds for request-response operations. -
cleanFrequency
public int cleanFrequencyFrequency in milliseconds for cleaning up expired futures. -
enableFragmentAssembler
public boolean enableFragmentAssemblerWhether to enable the Aeron fragment assembler for large messages.Aeron fragments any message whose encoded length exceeds the MTU (Aeron's default MTU is 1408 bytes for both network and IPC), and the receiver can only reassemble such multi-fragment messages when this is enabled. Turn it on whenever a single message can exceed the MTU, i.e. roughly when the payload can exceed ~1.4 KB; otherwise oversized messages will not be reassembled correctly. It is enabled by default so large messages are handled safely.
-
fragmentLimit
public int fragmentLimitMaximum number of fragments to assemble per poll operation. -
publisherBufferSize
public int publisherBufferSizeBuffer size in bytes for the Aeron publisher.This is the encoding-side upper bound and defaults to 64 KiB. The effective message cap is the minimum of this buffer size, the relevant SBE field limit, and the Aeron publication's maximum message length. Different projects can tune this value without regenerating the SBE codecs up to the payload field's 8 MiB minus 4 KiB schema ceiling.
The buffer must hold the whole encoded message, not just the payload: the SBE message header plus fixed fields and each variable-data length prefix add roughly 100+ bytes of overhead (more if an attachment is present). So the maximum usable payload is this buffer size minus that overhead - size this value with headroom above your largest payload, never exactly equal.
Upper bound: Aeron's maximum message length is
min(termBufferLength / 8, 16 MiB), which is 8 MiB with Aeron's default 64 MiB IPC term buffer. Do not exceed 8 MiB unless the Aeron IPC term buffer length is increased accordingly. Also note that any value above the MTU (~1.4 KB) means large messages get fragmented, soenableFragmentAssemblermust be enabled. -
publisherQueueCapacity
public int publisherQueueCapacityMaximum queued messages per Aeron publication; values less than or equal to 0 use an unbounded queue. -
publisherDrainLimit
public int publisherDrainLimitMaximum messages drained per publication per publisher loop; values less than or equal to 0 drain all. -
publisherOfferRetryLimit
public int publisherOfferRetryLimitMaximum retry attempts for retryable Aeron offer failures; 0 disables retry and values less than 0 retry indefinitely. -
publisherIdleMaxSpins
public int publisherIdleMaxSpinsMaximum spin iterations for publisher idle backoff. -
publisherIdleMaxYields
public int publisherIdleMaxYieldsMaximum yield iterations for publisher idle backoff. -
publisherIdleMinParkNanos
public long publisherIdleMinParkNanosMinimum park duration in nanoseconds for publisher idle backoff. -
publisherIdleMaxParkNanos
public long publisherIdleMaxParkNanosMaximum park duration in nanoseconds for publisher idle backoff. -
devMode
public boolean devModeWhether development mode is enabled, providing extra diagnostics. -
broadcastTrace
Broadcast trace hook used to record diagnostic information when broadcast messages are sent.
-
-
Constructor Details
-
CoreGlobalConfig
public CoreGlobalConfig()
-
-
Method Details
-
setNetId
public void setNetId(int netId) Set the network ID. Must be greater than 1000.- Parameters:
netId- the network ID to set
-
getFutureTimeoutMillis
public int getFutureTimeoutMillis()Get the future timeout in milliseconds, with a 200ms buffer added to the base timeout.- Returns:
- the timeout value in milliseconds
-