Search in sources :

Example 1 with KafkaProperties

use of io.splitet.core.kafka.KafkaProperties in project eventapis by kloiasoft.

the class EventApisFactory method kafkaOperationsFactory.

@Bean
public ConsumerFactory<String, Operation> kafkaOperationsFactory() {
    KafkaProperties properties = eventApisConfiguration.getEventBus().clone();
    properties.getConsumer().setEnableAutoCommit(false);
    return new DefaultKafkaConsumerFactory<>(properties.buildConsumerProperties(), new StringDeserializer(), new JsonDeserializer<>(Operation.class, objectMapper));
}
Also used : KafkaProperties(io.splitet.core.kafka.KafkaProperties) StringDeserializer(org.apache.kafka.common.serialization.StringDeserializer) DefaultKafkaConsumerFactory(org.springframework.kafka.core.DefaultKafkaConsumerFactory) Operation(io.splitet.core.pojos.Operation) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with KafkaProperties

use of io.splitet.core.kafka.KafkaProperties in project eventapis by kloiasoft.

the class EventApisFactory method kafkaConsumerFactory.

@Bean
public ConsumerFactory<String, PublishedEventWrapper> kafkaConsumerFactory() {
    KafkaProperties properties = eventApisConfiguration.getEventBus().clone();
    properties.getConsumer().setEnableAutoCommit(false);
    return new DefaultKafkaConsumerFactory<>(properties.buildConsumerProperties(), new StringDeserializer(), new JsonDeserializer<>(PublishedEventWrapper.class, objectMapper));
}
Also used : PublishedEventWrapper(io.splitet.core.kafka.PublishedEventWrapper) KafkaProperties(io.splitet.core.kafka.KafkaProperties) StringDeserializer(org.apache.kafka.common.serialization.StringDeserializer) DefaultKafkaConsumerFactory(org.springframework.kafka.core.DefaultKafkaConsumerFactory) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

KafkaProperties (io.splitet.core.kafka.KafkaProperties)2 StringDeserializer (org.apache.kafka.common.serialization.StringDeserializer)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)2 Bean (org.springframework.context.annotation.Bean)2 DefaultKafkaConsumerFactory (org.springframework.kafka.core.DefaultKafkaConsumerFactory)2 PublishedEventWrapper (io.splitet.core.kafka.PublishedEventWrapper)1 Operation (io.splitet.core.pojos.Operation)1