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.

  • Field Details

  • Constructor Details

  • Method Details

    • init

      public app.l2nx.gs.kafka.KafkaState init(app.l2nx.gs.adapter.api.rest.KafkaConfig kafka, String clientId, Map<String,byte[]> staticHeaders, 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>)
      staticHeaders - Kafka headers stamped on every produced record (e.g. Nx-Server-Id); may be empty
      stateChangeListener - forwarded to NxKafka.onStateChange
    • buildJaas

      public static String buildJaas(String username, String password)