RED-9658: Fixed Remove old ocr service queues in migration #603
@ -6,6 +6,7 @@ import static com.knecon.fforesight.service.layoutparser.internal.api.queue.Layo
|
||||
|
||||
import org.springframework.amqp.core.Queue;
|
||||
import org.springframework.amqp.core.QueueBuilder;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@ -193,6 +194,7 @@ public class MessagingConfiguration {
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "persistence-service", name = "migrateOnly", havingValue = "false")
|
||||
public Queue ocrStatusUpdateResponseQueue() {
|
||||
|
||||
return QueueBuilder.durable(OCR_STATUS_UPDATE_RESPONSE_QUEUE)
|
||||
@ -203,6 +205,7 @@ public class MessagingConfiguration {
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "persistence-service", name = "migrateOnly", havingValue = "false")
|
||||
public Queue ocrStatusUpdateResponseDQL() {
|
||||
|
||||
return QueueBuilder.durable(OCR_STATUS_UPDATE_RESPONSE_DQL).build();
|
||||
@ -239,6 +242,7 @@ public class MessagingConfiguration {
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "persistence-service", name = "migrateOnly", havingValue = "false")
|
||||
public Queue ocrRequestQueue() {
|
||||
|
||||
return QueueBuilder.durable(OCR_REQUEST_QUEUE)
|
||||
@ -250,6 +254,7 @@ public class MessagingConfiguration {
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "persistence-service", name = "migrateOnly", havingValue = "false")
|
||||
public Queue ocrResponseQueue() {
|
||||
|
||||
return QueueBuilder.durable(OCR_RESPONSE_QUEUE)
|
||||
@ -258,6 +263,7 @@ public class MessagingConfiguration {
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "persistence-service", name = "migrateOnly", havingValue = "false")
|
||||
public Queue ocrDLQ() {
|
||||
|
||||
return QueueBuilder.durable(OCR_DLQ)
|
||||
|
||||
@ -5,6 +5,7 @@ import static com.iqser.red.service.persistence.management.v1.processor.configur
|
||||
|
||||
import org.springframework.amqp.core.AmqpAdmin;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.iqser.red.service.persistence.management.v1.processor.settings.FileManagementServiceSettings;
|
||||
|
||||
@ -12,6 +13,7 @@ import lombok.RequiredArgsConstructor;
|
||||
|
||||
// This can not run with migration starter service, it needs to be an InitializingBean otherwise it would be executed after queue listeners are initialized
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class OldQueueCleanup implements InitializingBean {
|
||||
|
||||
@ -31,6 +33,7 @@ public class OldQueueCleanup implements InitializingBean {
|
||||
amqpAdmin.deleteQueue(OCR_DLQ);
|
||||
amqpAdmin.deleteQueue(OCR_STATUS_UPDATE_RESPONSE_QUEUE);
|
||||
amqpAdmin.deleteQueue(OCR_STATUS_UPDATE_RESPONSE_DQL);
|
||||
amqpAdmin.deleteQueue("ocr_status_update_response_dql");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import java.time.temporal.ChronoUnit;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@ -26,6 +27,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@ConditionalOnProperty(prefix = "persistence-service", name = "migrateOnly", havingValue = "false")
|
||||
@RequiredArgsConstructor
|
||||
public class OCRProcessingMessageReceiver {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user