use of org.springframework.kafka.core.DefaultKafkaConsumerFactory in project eventapis by kloiasoft.
the class EventListenConfiguration method startEvents.
private void startEvents() {
Map<String, Object> consumerProperties = eventApisConfiguration.getEventBus().buildConsumerProperties();
DefaultKafkaConsumerFactory<String, PublishedEventWrapper> consumerFactory = new DefaultKafkaConsumerFactory<>(consumerProperties, new StringDeserializer(), new JsonDeserializer<>(PublishedEventWrapper.class));
ContainerProperties containerProperties = new ContainerProperties(Pattern.compile(eventTopicRegexStr));
containerProperties.setMessageListener(new MultipleEventMessageListener(eventMessageListeners));
messageListenerContainer = new ConcurrentMessageListenerContainer<>(consumerFactory, containerProperties);
messageListenerContainer.setBeanName("emon-events");
messageListenerContainer.start();
}
Aggregations