0

I am trying to impl pull mechanism using Spring DMLC, using qpid broker for queue. I am using setCnocurrency/setMaxConsurrentConsumer params to specify min and max consumers for my listener. I can see those consumers coming up when app starts, the problem here is I am not able to achieve all the active consumers receiving equal number of messages from queue. Listing different combinations that I tried.

maxprefetch(say n) param in connection url so that every pull request will get a max of n messages per one pull req

setReceiveTimeout in DMLC, assuming each pull request will have specified time intervel so that other consumers can start and read messages as well

Can someone please review the approach and help me if it is possible for consumers to share equal number of messages in pull mechanism

Also, if I want to verify the maxConsumerlimit that I can set for my system, how can I calculate that taking system config into consideration.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • See if `setMaxMessagesPerTask()` on the `DMLC` helps you somehow. The question has nothing to do with Spring AMQP though: that one doesn't not support AMQP 1.0 which is fully compatible with JMS spec. And that's why you good to go with that DMLC from `spring-jms` – Artem Bilan Jan 28 '22 at 16:03
  • Thank you for your response here, **setMaxMessagesPerTask()** is not really limiting the number of messages per consumer. I can see one consumer thread is receiving all the messages if I remove maxprefetch in connection url. In case of Push, I have seen all the consumers receiving equal number of messages and not more than maxprefecth at any point. How can I achieve the similar behaviour in pull. If I have multiple consumers running and when messages are coming in, I can see kind of message distribution behaviour. But cannot see when only one or two consumers running and others had to start. – harish bollina Jan 31 '22 at 11:23
  • I am actually much interested in understanding how prefetch works in case of pull with DMLC, it is that every pull request will get prefetch number of messages into consumer. Here by pull request, I mean a call to receiveNoWait, can you please suggest on this – harish bollina Feb 01 '22 at 11:31

0 Answers0