andrewinci/Insulator

View on GitHub
app/src/main/kotlin/insulator/di/modules/TopicModule.kt

Summary

Maintainability
A
1 hr
Test Coverage
F
0%
package insulator.di.modules

import dagger.Module
import dagger.Provides
import insulator.di.TopicScope
import insulator.helper.GlobalState
import insulator.jsonhelper.avrotojson.AvroToJsonConverter
import insulator.kafka.consumer.consumer
import insulator.kafka.model.Cluster

@Module
class TopicModule {

    @Provides
    @TopicScope
    fun providesConsumer(cluster: Cluster, converter: AvroToJsonConverter) =
        consumer(cluster) { converter.parse(it, GlobalState.humanReadableAvroProperty.value) }
}