Batching RabbitListener not working List<Message<Object>> messages #2559
Answered
by
garyrussell
adityaparikh91087
asked this question in
Q&A
-
Had a Spring Amqp Question. When enabling batching
In the RabbitListener I directly get the payload of the message |
Beta Was this translation helpful? Give feedback.
Answered by
garyrussell
Nov 21, 2023
Replies: 1 comment 3 replies
-
You also need to set factory.setConsumerBatchEnabled(true); /**
* Set to true to present a list of messages based on the {@link #setBatchSize(Integer)},
* if the listener supports it. Starting with version 3.0, setting this to true will
* also {@link #setBatchListener(boolean)} to true.
* @param consumerBatchEnabled true to create message batches in the container.
* @since 2.2
* @see #setBatchSize(Integer)
* @see #setBatchListener(boolean)
*/
public void setConsumerBatchEnabled(boolean consumerBatchEnabled) { |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
adityaparikh91087
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You also need to set
consumerBatchEnabled
to enable batching.