Я настраиваю параметры PrefetchCount и Concepttive Active Trigger для RabbitMQ с помощью Sprint.
Пожалуйста, не могли бы вы сказать мне разницу между этими двумя параметрами?
@Bean
public SimpleRabbitListenerContainerFactory rabbitListenerReceiveError(ConnectionFactory connectionFactory) {
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
factory.setConnectionFactory(connectionFactory);
int concurrentConsumers = Integer.parseInt(PropertiesLoader.getProperty("queue.receive_error.concurrent-consumers"));
int maxConcurrentConsumers = Integer.parseInt(PropertiesLoader.getProperty("queue.receive_error.max-concurrent-consumers"));
int consecutiveActiveTrigger = Integer.parseInt(PropertiesLoader.getProperty("queue.receive_error.consecutive-active-trigger"));
int prefectCount = Integer.parseInt(PropertiesLoader.getProperty("queue.receive_error.prefetch_count"));
factory.setPrefetchCount(prefectCount);
factory.setConcurrentConsumers(concurrentConsumers);
factory.setMaxConcurrentConsumers(maxConcurrentConsumers);
factory.setConsecutiveActiveTrigger(consecutiveActiveTrigger);
return factory;
}
Информация из.файл свойств
queue.receive_error.name=queue.receive_error
queue.receive_error.exchange=auto.receive_error
queue.receive_error.routingKey=receive_error
queue.receive_error.concurrent-consumers=1
queue.receive_error.max-concurrent-consumers=30
queue.receive_error.consecutive-active-trigger=5
queue.receive_error.prefetch_count=1