Search in sources :

Example 1 with GlobalLoadSensor

use of org.folio.kafka.GlobalLoadSensor in project mod-inventory by folio-org.

the class QuickMarcConsumerVerticle method createKafkaConsumer.

private Future<KafkaConsumerWrapper<String, String>> createKafkaConsumer(KafkaConfig kafkaConfig, QMEventTypes eventType, AsyncRecordHandler<String, String> recordHandler) {
    var subscriptionDefinition = createSubscriptionDefinition(kafkaConfig.getEnvId(), getDefaultNameSpace(), eventType.name());
    KafkaConsumerWrapper<String, String> consumerWrapper = KafkaConsumerWrapper.<String, String>builder().context(context).vertx(vertx).kafkaConfig(kafkaConfig).loadLimit(loadLimit).globalLoadSensor(new GlobalLoadSensor()).subscriptionDefinition(subscriptionDefinition).build();
    return consumerWrapper.start(recordHandler, ConsumerWrapperUtil.constructModuleName()).map(consumerWrapper);
}
Also used : GlobalLoadSensor(org.folio.kafka.GlobalLoadSensor)

Example 2 with GlobalLoadSensor

use of org.folio.kafka.GlobalLoadSensor in project mod-inventory by folio-org.

the class DataImportConsumerVerticle method createKafkaConsumerWrapper.

private Future<KafkaConsumerWrapper<String, String>> createKafkaConsumerWrapper(KafkaConfig kafkaConfig, DataImportEventTypes eventType, AsyncRecordHandler<String, String> recordHandler) {
    SubscriptionDefinition subscriptionDefinition = KafkaTopicNameHelper.createSubscriptionDefinition(kafkaConfig.getEnvId(), KafkaTopicNameHelper.getDefaultNameSpace(), eventType.value());
    KafkaConsumerWrapper<String, String> consumerWrapper = KafkaConsumerWrapper.<String, String>builder().context(context).vertx(vertx).kafkaConfig(kafkaConfig).loadLimit(loadLimit).globalLoadSensor(new GlobalLoadSensor()).subscriptionDefinition(subscriptionDefinition).build();
    return consumerWrapper.start(recordHandler, ConsumerWrapperUtil.constructModuleName()).map(consumerWrapper);
}
Also used : GlobalLoadSensor(org.folio.kafka.GlobalLoadSensor) SubscriptionDefinition(org.folio.kafka.SubscriptionDefinition)

Aggregations

GlobalLoadSensor (org.folio.kafka.GlobalLoadSensor)2 SubscriptionDefinition (org.folio.kafka.SubscriptionDefinition)1