FINERACT-1694-ActiveMQ-failover-transport-support
This commit is contained in:
committed by
Arnold Gálovics
parent
3d332f0840
commit
04e07890a4
+8
-2
@@ -53,14 +53,20 @@ public class SendAsynchronousEventsTasklet implements Tasklet {
|
||||
@Override
|
||||
public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) {
|
||||
try {
|
||||
List<ExternalEvent> events = getQueuedEventsBatch();
|
||||
processEvents(events);
|
||||
if (isDownstreamChannelEnabled()) {
|
||||
List<ExternalEvent> events = getQueuedEventsBatch();
|
||||
processEvents(events);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Error occurred while processing events: ", e);
|
||||
}
|
||||
return RepeatStatus.FINISHED;
|
||||
}
|
||||
|
||||
private boolean isDownstreamChannelEnabled() {
|
||||
return fineractProperties.getEvents().getExternal().getProducer().getJms().isEnabled();
|
||||
}
|
||||
|
||||
private List<ExternalEvent> getQueuedEventsBatch() {
|
||||
int readBatchSize = getBatchSize();
|
||||
Pageable batchSize = PageRequest.ofSize(readBatchSize);
|
||||
|
||||
Reference in New Issue
Block a user