use of com.kloia.eventapis.api.emon.service.MultipleEventMessageListener in project eventapis by kloiasoft.
the class EventListenConfiguration method startOperations.
private void startOperations() {
Map<String, Object> consumerProperties = eventApisConfiguration.getEventBus().buildConsumerProperties();
DefaultKafkaConsumerFactory<String, Operation> operationConsumerFactory = new DefaultKafkaConsumerFactory<>(consumerProperties, new StringDeserializer(), new JsonDeserializer<>(Operation.class));
ContainerProperties operationContainerProperties = new ContainerProperties(Operation.OPERATION_EVENTS);
operationContainerProperties.setMessageListener(new MultipleEventMessageListener(eventMessageListeners));
operationListenerContainer = new ConcurrentMessageListenerContainer<>(operationConsumerFactory, operationContainerProperties);
operationListenerContainer.setBeanName("emon-operations");
operationListenerContainer.start();
}
use of com.kloia.eventapis.api.emon.service.MultipleEventMessageListener 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