Skip to content

@RabbitListener with multiple queues and its concurrency #2555

Answered by artembilan
ddinde-mdsol asked this question in Q&A
Discussion options

You must be logged in to vote

Each queue is going to have that number of consumers:

				for (int i = 1; i <= this.concurrentConsumers; i++) {
					BlockingQueueConsumer consumer = createBlockingQueueConsumer();
...
	protected BlockingQueueConsumer createBlockingQueueConsumer() {
		BlockingQueueConsumer consumer;
		String[] queues = getQueueNames();
		// 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 = getPrefetchCount() > this.batchSize ? getPrefetchCount() : this.batchSize;
		consumer = new BlockingQueueConsumer(getConnectionFactory(), getMessagePropertiesConverter(),
				this.cancellation…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ddinde-mdsol
Comment options

Answer selected by ddinde-mdsol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants