RabbitMQ prefetchCount and txSize in spring-rabbit

 Due to following implementation in SimpleMessageListenerContainer of spring-rabbit(1.1.2-RELEASE at this point) library, you should always change txSize as well if you want to decrease prefetchCount for some reason, otherwise txSize will override prefetchCount value.

    protected BlockingQueueConsumer createBlockingQueueConsumer() {
        BlockingQueueConsumer consumer;
        String[] queues = getRequiredQueueNames();
        // There's no point prefetching less than the tx size, otherwise the consumer will stall because the broker
        // didn't get an ack for delivered messages
        int actualPrefetchCount = prefetchCount > txSize ? prefetchCount : txSize;
        consumer = new BlockingQueueConsumer(getConnectionFactory(), this.messagePropertiesConverter, cancellationLock,
                getAcknowledgeMode(), isChannelTransacted(), actualPrefetchCount, this.defaultRequeueRejected, queues);
        return consumer;

댓글 없음:

댓글 쓰기

UIUC MCS-DS첫번째 날 시작

오늘이 학생들에게 UIUC MCS-DS 의 코세라 수업이 할당되고 공식적으로 일정이 시작된 (Aug 27, 2018) 첫날이다. 아직까지 기존에 공개되어 있어 진도를 나갈 수 있었던 specialization 클래스들의 진행상황이 MCS-DS 과정으...