Skip to content

Commit

Permalink
Added more config exclusion
Browse files Browse the repository at this point in the history
Added Transactional to message receiver
  • Loading branch information
cgendreau committed Feb 5, 2024
1 parent 8690a66 commit 9ff05c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import ca.gc.aafc.dina.DinaBaseApiAutoConfiguration;
import ca.gc.aafc.dina.search.common.config.SearchQueueConsumerConfiguration;
import ca.gc.aafc.dina.search.messaging.consumer.DocumentOperationNotificationConsumer;
import ca.gc.aafc.dina.service.JaversDataService;

import static ca.gc.aafc.dina.export.api.config.DataExportConfig.DINA_THREAD_POOL_BEAN_NAME;

@Configuration
@ComponentScan(basePackageClasses = DinaBaseApiAutoConfiguration.class,
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = DocumentOperationNotificationConsumer.class))
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,
value = {DocumentOperationNotificationConsumer.class, SearchQueueConsumerConfiguration.class}))
@ImportAutoConfiguration(DinaBaseApiAutoConfiguration.class)
@MapperScan(basePackageClasses = JaversDataService.class)
@EnableAsync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Map;
import javax.inject.Named;
import javax.transaction.Transactional;
import lombok.extern.log4j.Log4j2;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
Expand Down Expand Up @@ -32,6 +33,7 @@ public ObjectExportNotificationConsumer(@Named("exportQueueProperties") RabbitMQ
}

@RabbitListener(queues = "#{exportQueueProperties.getQueue()}")
@Transactional
@Override
public void receiveMessage(ObjectExportNotification objectExportNotification) {
log.info("Received message and deserialized to : {}", objectExportNotification::toString);
Expand Down

0 comments on commit 9ff05c2

Please sign in to comment.