Class CommandsConsumer

java.lang.Object
app.l2nx.gs.adapter.core.commands.CommandsConsumer

public final class CommandsConsumer extends Object
Inbound commands consumer + dispatcher. Single Kafka consumer on the nx-commands-consumer daemon thread; CommandHandler.handle(C, app.l2nx.gs.adapter.api.spi.CommandContext) runs synchronously on it, so game-state mutations MUST hop via HostExecutor.sync(Runnable) (bounded by l2nx.commands.host-sync-timeout-ms).

At-most-once. commitSync runs BEFORE dispatch — a crash or commit failure mid-batch drops the in-flight records (no redelivery). Caller times out, operator re-issues. Handlers do NOT need to be idempotent. Reply sends are fire-and-forget.

Error boundaries: unknown Nx-Message-TypeCommandStatus.UNSUPPORTED_COMMAND; Gson failure → CommandStatus.VALIDATION_FAILED; HostExecutorTimeoutExceptionCommandStatus.UNAVAILABLE; other RuntimeException or null return → CommandStatus.INTERNAL_ERROR; Error (OOM) escapes uncaught.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    Bridge to the actual Kafka send.
  • Method Summary

    Modifier and Type
    Method
    Description
    app.l2nx.gs.adapter.api.kafka.ops.ModuleStatus
    Heartbeat slot snapshot for the commands module.
    void
    Signal the daemon to stop, wake it from any blocking poll, await join up to shutdownTimeoutMs, then close the Kafka consumer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • stop

      public void stop()
      Signal the daemon to stop, wake it from any blocking poll, await join up to shutdownTimeoutMs, then close the Kafka consumer. Idempotent.
    • currentStatus

      public app.l2nx.gs.adapter.api.kafka.ops.ModuleStatus currentStatus()
      Heartbeat slot snapshot for the commands module.