Skip to content

Commit

Permalink
Merge pull request #78 from freenowtech/sergioasantiago/change_prefet…
Browse files Browse the repository at this point in the history
…ch_count

Change prefetch count
  • Loading branch information
sergioasantiago authored Sep 28, 2021
2 parents 99c3c41 + 6644a30 commit a8857e0
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.freenow.sauron.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -16,4 +18,12 @@ public Queue sauronQueue()
{
return new Queue(SAURON_QUEUE_NAME, true);
}


@Bean
public SimpleRabbitListenerContainerFactory eventBusPrefetchCount(@Qualifier("eventBus") SimpleRabbitListenerContainerFactory eventBus)
{
eventBus.setPrefetchCount(1);
return eventBus;
}
}

0 comments on commit a8857e0

Please sign in to comment.