Commit 14ae950f authored by Kristel Meikas's avatar Kristel Meikas
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Kristel Meikas

See merge request teis/officials-service!64
parents 1c1854ad a3f40ffb
......@@ -2,6 +2,7 @@ stages:
- test
- build
- deploy
- cve-test
variables:
USE_POSTGRES: "true"
......@@ -16,3 +17,5 @@ include:
file: "/gitlab/java/microservice/.gitlab-ci-microservice-build.yml"
- project: "teis/dev-ops"
file: "/gitlab/java/microservice/.gitlab-ci-microservice-deploy.yml"
- project: "teis/dev-ops"
file: "/gitlab/java/microservice/.gitlab-ci-microservice-cve-scan.yaml"
# Changelog
## [1.14.0] - 2022-03-28
* TEIS-2791: implemented functionality for updating classifier item cache in batches
* TEIS-2782: add docker CVE test step into CI/CD pipeline
## [1.13.0] - 2021-12-16
* TEIS-2498: Added functionality for updating microservices database cache via RabbitMQ batch messages. Implemented
* TEIS-2498: Added functionality for updating microservices database cache via RabbitMQ batch messages. Implemented
execution lock functionality to enable specific processes to be processed by single Kubernetes pods
* TEIS-2599: security and metrics update
......@@ -17,7 +22,8 @@
## [1.11.0] - 2021-06-14
* TEIS-2199: refactored Response classes from listeners to QueueConfig. new ms endpoint for getting official from sequence. new listener for testing getting officials from sequence
* TEIS-2199: refactored Response classes from listeners to QueueConfig. new ms endpoint for getting official from sequence.
new listener for testing getting officials from sequence
* TEIS-2185: added new tables: officials_sequence and official_in_sequence, and entities: OfficialInSequenceEntity and OfficialsSequenceEntity
* TEIS-1924: do not update modified_at value in fill_created_at_value function
......
theGroup=ee.sm.ti.teis
theVersion=1.13.0
commonsVersion=1.28.0
officeApiGatewayVersion=1.28.0
pluginVersion=1.4.1
theVersion=1.14.0
commonsVersion=1.33.0
officeApiGatewayVersion=1.33.0
pluginVersion=1.5.0
......@@ -11,3 +11,6 @@ spring:
password: seis
change-log: classpath:/db/changelog/db.changelog-integtest.xml
contexts: integtest
teis:
cache:
reinitialize-enabled: false
package ee.sm.ti.teis.officials.cache;
import ee.sm.ti.teis.cache.SnapshotBatchListener;
import ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService;
import ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService.*;
import ee.sm.ti.teis.domain.ClassifierItem;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
@Component
public class ClassifierItemBatchListener extends SnapshotBatchListener<ClassifierItemCacheUpdateService, ClassifierItem, String> {
private final ClassifierItemCacheUpdateService classifierItemCacheUpdateService;
public ClassifierItemBatchListener(ClassifierItemCacheUpdateService classifierItemCacheUpdateService) {
super(classifierItemCacheUpdateService);
this.classifierItemCacheUpdateService = classifierItemCacheUpdateService;
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.cacheBatchResponseQueueName}", concurrency = "1")
public void processCacheBatchSnapshot(ClassifierItemCacheBatchResponseDTO response) {
batchProcess(response);
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.cacheReinitializeQueueName}")
public void classifierItemReinitializeEvent() {
classifierItemCacheUpdateService.reinitialize();
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.cacheResponseQueueName}", concurrency = "1")
public void classifierItemCacheResponseEvent(ClassifierItemCacheResponseDTO cacheResponseDTO) {
classifierItemCacheUpdateService.processSnapshot(cacheResponseDTO.getPayload(), cacheResponseDTO.getRequestMetaDTO().getUserId());
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.createdEventsQueueName}")
public void classifierItemCreatedEvent(ClassifierItemCreatedDTO createdDTO) {
classifierItemCacheUpdateService.created(createdDTO.getPayload());
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.updatedEventsQueueName}")
public void classifierItemUpdatedEvent(ClassifierItemUpdatedDTO updatedDTO) {
classifierItemCacheUpdateService.updated(updatedDTO.getPayload().getId(), updatedDTO.getPayload());
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.deletedEventsQueueName}")
public void classifierItemDeletedEvent(ClassifierItemDeletedDTO deletedDTO) {
classifierItemCacheUpdateService.updated(deletedDTO.getPayload().getId(), deletedDTO.getPayload());
}
}
package ee.sm.ti.teis.officials.config;
package ee.sm.ti.teis.officials.cache;
import ee.sm.ti.teis.cache.BaseCacheUpdateService;
import ee.sm.ti.teis.cache.classifier.ClassifierDefinitionCacheUpdateService;
import ee.sm.ti.teis.cache.classifier.ClassifierDefinitionCacheUpdateService.ClassifierDefinitionCacheResponseDTO;
import ee.sm.ti.teis.cache.classifier.ClassifierDefinitionCacheUpdateService.ClassifierDefinitionReinitializeDTO;
import ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService;
import ee.sm.ti.teis.configuration.DomainCacheList;
......@@ -11,8 +12,6 @@ import org.springframework.stereotype.Component;
import java.util.Set;
import static ee.sm.ti.teis.cache.classifier.ClassifierItemCacheUpdateService.*;
@Component
@RequiredArgsConstructor
public class DomainCacheConfig implements DomainCacheList {
......@@ -26,38 +25,14 @@ public class DomainCacheConfig implements DomainCacheList {
classifierDefinitionCacheUpdateService);
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.cacheResponseQueueName}", concurrency = "1")
public void classifierItemCacheResponseEvent(ClassifierItemCacheResponseDTO cacheResponseDTO) {
classifierItemCacheUpdateService.processSnapshot(cacheResponseDTO.getPayload(), cacheResponseDTO.getRequestMetaDTO().getUserId());
}
@RabbitListener(queues = "#{@classifierDefinitionCacheUpdateService.cacheResponseQueueName}", concurrency = "1")
public void classifierDefinitionCacheResponseEvent(ClassifierDefinitionCacheUpdateService.ClassifierDefinitionCacheResponseDTO cacheResponseDTO) {
public void classifierDefinitionCacheResponseEvent(ClassifierDefinitionCacheResponseDTO cacheResponseDTO) {
classifierDefinitionCacheUpdateService.processSnapshot(cacheResponseDTO.getPayload(), cacheResponseDTO.getRequestMetaDTO().getUserId());
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.createdEventsQueueName}")
public void classifierItemCreatedEvent(ClassifierItemCreatedDTO createdDTO) {
classifierItemCacheUpdateService.created(createdDTO.getPayload());
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.updatedEventsQueueName}")
public void classifierItemCreatedEvent(ClassifierItemUpdatedDTO updatedDTO) {
classifierItemCacheUpdateService.updated(updatedDTO.getPayload().getId(), updatedDTO.getPayload());
}
@RabbitListener(queues = "#{@classifierItemCacheUpdateService.deletedEventsQueueName}")
public void classifierItemDeletedEvent(ClassifierItemCacheUpdateService.ClassifierItemDeletedDTO 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();
}
}
......@@ -63,6 +63,7 @@ teis:
od-exchange-name: od-disabled
cache:
queues: classifierItems, classifierDefinitions
batch-caching-services: classifierItems
reinitialize: OfficialsGroup, OfficialUser, Office
reset-test-data:
enabled: true
Supports Markdown
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