Class KafkaInitializer

java.lang.Object
app.l2nx.gs.adapter.core.kafka.KafkaInitializer

public final class KafkaInitializer extends Object
Bootstraps the nx-gs-kafka singleton from a platform-issued KafkaConfig. The state listener forwarded to the factory drives the adapter's ACTIVE ↔ DEGRADED transitions once the platform handshake has completed.

The JAAS line is hard-coded against org.apache.kafka.common.security.scram.ScramLoginModule — the only SASL mechanism the platform issues in the MVP.

  • Constructor Details

    • KafkaInitializer

      public KafkaInitializer(KafkaFactory factory)
  • Method Details

    • init

      public app.l2nx.gs.kafka.KafkaState init(app.l2nx.gs.adapter.api.rest.KafkaConfig kafka, String clientId, Consumer<app.l2nx.gs.kafka.KafkaState> stateChangeListener)
      Build the Kafka client and return the post-build state. Returns KafkaState.DISCONNECTED when the broker is unreachable inside the connect timeout — the adapter should reflect this as DEGRADED; nx-gs-kafka reconnects in the background.
      Parameters:
      kafka - wire payload from the platform handshake
      clientId - composed client identifier (nx-gs-adapter-<tenant>-<server>)
      stateChangeListener - forwarded to NxKafka.onStateChange