<- Back to NucleoCore
Skip to main content

Message Queue Service

Setting MQS

In the configuration for the table you can set the MQS type on initiating the database.

config.setMqsConfiguration(new LocalConfiguration())

This can be done using the configuration customizer

NucleoDB nucleoDB = new NucleoDB(
    NucleoDB.DBType.READ_ONLY,
    c -> c.getConnectionConfig().setMqsConfiguration(new LocalConfiguration()),
    c -> c.getDataTableConfig().setMqsConfiguration(new LocalConfiguration()),
    "com.nucleodb.library.helpers.models"
);

You can specify specific tables by comparing the table class 

c -> {
  if(c.getClazz() == Author.class){
    c.getDataTableConfig().setMqsConfiguration(new LocalConfiguration());
  }
},

Kafka MQS (Default)

Using Kafka cluster to keep the ledger of the database.

Configuration Path

com.nucleodb.library.mqs.kafka.KafkaConfiguration

Configure

This MQS is configured using environment variables. 

KAFKA_SERVERS=127.0.0.1:19092,127.0.0.1:29092,127.0.0.1:39092
KAFKA_GROUP_ID=single-node-db

Or in the settings map

servers=127.0.0.1:19092,127.0.0.1:29092,127.0.0.1:39092
groupName=498yrhebfnsfhsdjfad

Settings map can be configured in the configuration customizer.


Local MQS

Local only for testing purposes. Does not use a message queue, all messages are instantly produced directly to the consumer.

Configuration Path

com.nucleodb.library.mqs.local.LocalConfiguration