Commit 9a7a53bb authored by Jürgen Hannus's avatar Jürgen Hannus

TEIS-487: added existing cache re-initializations for every micro-service

parent 24b3f205
theGroup=ee.sm.ti.teis
theVersion=0.2.0-SNAPSHOT
commonsVersion=0.19.16-SNAPSHOT
commonsVersion=0.21.0-SNAPSHOT
officeApiGatewayVersion=0.7.0-SNAPSHOT
pluginVersion=0.0.18-SNAPSHOT
mapstructVersion=1.3.0.Final
......
......@@ -2,6 +2,7 @@ package ee.sm.ti.teis.officials.config;
import ee.sm.ti.teis.cache.BaseCacheUpdateService;
import ee.sm.ti.teis.cache.classifier.ClassifierDefinitionCacheUpdateService;
import ee.sm.ti.teis.cache.classifier.ClassifierDefinitionCacheUpdateService.ClassifierDefinitionReinitializeDTO;
import ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService;
import ee.sm.ti.teis.configuration.DomainCacheList;
import lombok.RequiredArgsConstructor;
......@@ -10,6 +11,11 @@ import org.springframework.stereotype.Component;
import java.util.Set;
import static ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService.ClassifierItemCacheResponseDTO;
import static ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService.ClassifierItemCreatedDTO;
import static ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService.ClassifierItemReinitializeDTO;
import static ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService.ClassifierItemUpdatedDTO;
@Component
@RequiredArgsConstructor
public class DomainCacheConfig implements DomainCacheList {
......@@ -24,7 +30,7 @@ public class DomainCacheConfig implements DomainCacheList {
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.cacheResponseQueueName}")
public void classifierItemCacheResponseEvent(ClassifierItemCacheUpdateService.ClassifierItemCacheResponseDTO cacheResponseDTO) {
public void classifierItemCacheResponseEvent(ClassifierItemCacheResponseDTO cacheResponseDTO) {
classifierItemCacheUpdateService.processSnapshot(cacheResponseDTO.getPayload(), cacheResponseDTO.getRequestMetaDTO());
}
......@@ -34,12 +40,22 @@ public class DomainCacheConfig implements DomainCacheList {
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.createdEventsQueueName}")
public void classifierItemCreatedEvent(ClassifierItemCacheUpdateService.ClassifierItemCreatedDTO createdDTO) {
public void classifierItemCreatedEvent(ClassifierItemCreatedDTO createdDTO) {
classifierItemCacheUpdateService.created(createdDTO.getPayload());
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.updatedEventsQueueName}")
public void classifierItemCreatedEvent(ClassifierItemCacheUpdateService.ClassifierItemUpdatedDTO updatedDTO) {
public void classifierItemCreatedEvent(ClassifierItemUpdatedDTO updatedDTO) {
classifierItemCacheUpdateService.updated(updatedDTO.getPayload().getId(), updatedDTO.getPayload());
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.cacheReinitializeQueueName}")
public void classifierItemReinitializeEvent(ClassifierItemReinitializeDTO reinitializeDTO) {
classifierItemCacheUpdateService.reinitialize();
}
@RabbitListener(queues = "#{@classifierDefinitionCacheUpdateService.cacheReinitializeQueueName}")
public void classifierDefinitionReinitializeEvent(ClassifierDefinitionReinitializeDTO reinitializeDTO) {
classifierDefinitionCacheUpdateService.reinitialize();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment