Class CommandsConsumer
java.lang.Object
app.l2nx.gs.adapter.core.commands.CommandsConsumer
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-Type →
CommandStatus.UNSUPPORTED_COMMAND; Gson failure →
CommandStatus.VALIDATION_FAILED; HostExecutorTimeoutException
→ CommandStatus.UNAVAILABLE; other RuntimeException or
null return → CommandStatus.INTERNAL_ERROR; Error
(OOM) escapes uncaught.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBridge to the actual Kafka send. -
Method Summary
Modifier and TypeMethodDescriptionapp.l2nx.gs.adapter.api.kafka.ops.ModuleStatusHeartbeat slot snapshot for thecommandsmodule.voidstop()Signal the daemon to stop, wake it from any blocking poll, await join up toshutdownTimeoutMs, then close the Kafka consumer.
-
Method Details
-
stop
public void stop()Signal the daemon to stop, wake it from any blocking poll, await join up toshutdownTimeoutMs, then close the Kafka consumer. Idempotent. -
currentStatus
public app.l2nx.gs.adapter.api.kafka.ops.ModuleStatus currentStatus()Heartbeat slot snapshot for thecommandsmodule.
-