I think I followed your use case, but I'm not sure I fully understand your explanation of the problem you're seeing.
So you have 10 consumers, but only 2-3 of them are connected? What's happening with the other consumers, such that they stop being connected? Is this the crux of your question, i.e. "Why do my consumers keep dying?" I also think that I understand that when most of your consumers are disconnected, the dispatch queue on the broker gets completely full of messages not for the 2-3 consumers who are connected. Did I understand that right? If so, this surprises me, since http://activemq.apache.org/message-groups.html indicates that a new consumer will be assigned to the message group when "the consumer closes (or the client which created the consumer dies etc)." So I'd expect that when you're down to only 2-3 consumers, all of the message groups would be assigned to those consumers, and they'd be getting messages dispatched to them. If that's not happening, then maybe the broker's failing to detect that the consumer is disconnected? Did you tweak anything that would affect the broker's ability to detect a disconnected consumer, such as TCP timeout settings, the inactivity checking within ActiveMQ, etc.? Can you tell us more about your configuration? What version of ActiveMQ, what transport protocol are you using, how have you configured your prefetch buffer sizes for your consumers, etc.? And is there anything unusual in the broker or consumer logs that might shed any light onto what's going on? Tim On Tue, Mar 26, 2019 at 12:39 AM drunkKnight <upadhyaya.p...@gmail.com> wrote: > Hello, > I have set up a project that uses ActiveMQ for messaging. My configurations > are the following: > Producer Side: > producerSession: transacted= false and Acknowledgment = > CLIENT_ACKNOWLEDGEMENT > > Consumer Side: > setQueuePrefetch = 1; > > Whenever there is an event like generate OTP for a phone number. the > producer generates a message with required fields, adding the phone number > as JMSXGroupId and posts it to the queue. After this, the producer gets > offline until a new event generation is required. There are multiple types > of events and our user base is around 15k. > > Now, on the consumer side, I have 10 consumers that use receive() method > without any timeout mentioned. Now this message is received and converted > to > the respective event and passed into a Service that consumes this message. > There could be three responses from the service: > 1. The event is executed successfully and returns true. In this case, I > invoke the *consumer.acknowledge()* method. > 2. The event execution is not successful and returns false. In this case, I > again invoke the *consumer.acknowledge() *method and post a delayed message > (AMQ_Scheduled_Delay as 1 hour) to the queue. > 3. While executing the event, it threw an exception. Now this exception, if > a JMSException then I reestablish the consumer connections to the broker, > if > not then, I explicitly *acknowledge* the message and post a delayed message > after 6 hours. > > Now the issue I'm facing is that the dispatch queue gets filled up with > value as 2 for most of the consumers (We have around 25K events a day > normally). And out of these 10, only 2 or 3 consumers with dispatch queue > count as 0 are present. I could not figure out what is the issue. Could > anyone please help me as I need to restart the server twice a day so that > the consumers start consuming? > > > > -- > Sent from: > http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html >