Class McpSubscriptionsConfig

java.lang.Object
org.apache.juneau.rest.server.mcp.v20260728.McpSubscriptionsConfig

public class McpSubscriptionsConfig extends Object
Binding-owned MCP subscriptions/listen (SEP-2575) configuration for a v2 McpRevision.

Mirrors McpMrtrConfig/McpCacheConfig's exact placement precedent: subscriptions/listen is a 2026-07-28-only feature, so its configuration lives here, on the v2 adapter, never on the revision-neutral org.apache.juneau.rest.server.mcp.McpServerConfig.

Mutable during setup, effectively immutable once published. Builder-less mutable-setup bean, following the same contract as McpMrtrConfig: configure fully before handing to a binding, never mutate afterward.

Unlike the org.apache.juneau.rest.server.mcp.McpSubscriptionBroker singleton (which holds live per-connection state), this type is knobs-only — every field is a tunable numeric limit with no embedded broker reference. It is one of McpOptions's nested configs (see McpOptions.getSubscriptions()), memoized once per binding along with the rest of McpOptions; the broker itself is derived and memoized separately, sized from this config's queueSize (see McpOptions.resolveSubscriptionBroker()).

  • Field Details

  • Constructor Details

  • Method Details

    • getMaxConcurrentSubscriptions

      The cap on concurrently open subscriptions/listen streams per broker.
      Returns:
      The cap. Always > 0.
    • setMaxConcurrentSubscriptions

      Sets the cap on concurrently open subscriptions/listen streams per broker.
      Parameters:
      value - The new value. Must be > 0.
      Returns:
      This object.
      Throws:
      IllegalArgumentException - If value is not > 0.
    • getQueueSize

      public int getQueueSize()
      The per-subscription drop-oldest queue bound.
      Returns:
      The bound. Always > 0.
    • setQueueSize

      Sets the per-subscription drop-oldest queue bound.
      Parameters:
      value - The new value. Must be > 0.
      Returns:
      This object.
      Throws:
      IllegalArgumentException - If value is not > 0.
    • getHeartbeatIntervalMs

      public long getHeartbeatIntervalMs()
      The heartbeat/keepalive interval in milliseconds.
      Returns:
      The interval. Always > 0.
    • setHeartbeatIntervalMs

      Sets the heartbeat/keepalive interval.
      Parameters:
      value - The new value. Must be > 0.
      Returns:
      This object.
      Throws:
      IllegalArgumentException - If value is not > 0.
    • getIdleTimeoutMs

      public long getIdleTimeoutMs()
      The idle timeout in milliseconds.
      Returns:
      The timeout. Always >= 0 (0 means disabled).
    • setIdleTimeoutMs

      Sets the idle timeout.

      Keep this greater than heartbeatIntervalMs. A heartbeat counts as activity, so as long as heartbeatIntervalMs < idleTimeoutMs, heartbeats alone keep an otherwise-quiet stream alive indefinitely. Configuring idleTimeoutMs at or below heartbeatIntervalMs defeats that: the watchdog can fire between two heartbeats and silently reap a perfectly healthy connection. This setter accepts any non-negative value without checking against the currently-configured heartbeat interval (the two may be set in either order), so this is a configuration contract, not one this class enforces for you.

      Parameters:
      value - The new value. Must be >= 0 (0 disables idle-timeout reaping).
      Returns:
      This object.
      Throws:
      IllegalArgumentException - If value is negative.