All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.devlibx.easy.messaging.kafka.module.MessagingKafkaModule Maven / Gradle / Ivy

The newest version!
package io.github.devlibx.easy.messaging.kafka.module;

import com.google.inject.AbstractModule;
import com.google.inject.multibindings.MapBinder;
import io.github.devlibx.easy.messaging.consumer.IConsumerService;
import io.github.devlibx.easy.messaging.kafka.consumer.KafkaBasedConsumerService;
import io.github.devlibx.easy.messaging.kafka.producer.KafkaBasedProducerService;
import io.github.devlibx.easy.messaging.producer.IProducerService;

public class MessagingKafkaModule extends AbstractModule {
    @Override
    protected void configure() {
        super.configure();

        // Provide kafka service provider
        MapBinder lockBuilderMapBinder = MapBinder.newMapBinder(binder(), String.class, IProducerService.class);
        lockBuilderMapBinder.permitDuplicates();
        lockBuilderMapBinder.addBinding("KAFKA").to(KafkaBasedProducerService.class);

        // Provide kafka service provider
        MapBinder consumerServiceMapBinder = MapBinder.newMapBinder(binder(), String.class, IConsumerService.class);
        consumerServiceMapBinder.permitDuplicates();
        consumerServiceMapBinder.addBinding("KAFKA").to(KafkaBasedConsumerService.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy