You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by IBeaumont <IB...@categoric.com> on 2009/01/13 16:38:16 UTC

Q Consumers stop receiving messages

I've got a fairly complex app, that takes msgs, processing them and sticks
them on the same or different queues.

The queues are pre-loaded with persistent messages before the application
starts (50000).  Once it starts processing things work fine for a while and
then the consumers stop receiving any messages.  I have a 4 consumers for
each queue, and there are 3 different queues.

Looking at jconsole all consumes are waiting here:

State: WAITING on java.lang.Object@1801d4a
Total blocked: 20  Total waited: 158

Stack trace: 
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:485)
org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)


If I look at the broker (and I'm not really sure what to look at here), the
thread for my queue that should be dispatching messages looks like this 
Name: QueueThread:queue://csPIQ
State: WAITING on
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
Total blocked: 2,365  Total waited: 6,717

Stack trace: 
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(Unknown Source)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
Source)
java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)

The broker is configured with producerFlowControl="false", using TCP, a
pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".

Any ideas on what my problem is or how/where I look in ActiveMQ to find the
cause, or if the problem is with the consumer.

TIA
Ian

-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438163.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by drunkenman <ma...@yahoo.com>.
Hmm have you tried configuring the app?

Regards,
Phillip Mugal
http://makemoneyfromhome.com/ Make Money From Home 


IBeaumont wrote:
> 
> I've got a fairly complex app, that takes msgs, processing them and sticks
> them on the same or different queues.
> 
> The queues are pre-loaded with persistent messages before the application
> starts (50000).  Once it starts processing things work fine for a while
> and then the consumers stop receiving any messages.  I have a 4 consumers
> for each queue, and there are 3 different queues.
> 
> Looking at jconsole all consumes are waiting here:
> 
> State: WAITING on java.lang.Object@1801d4a
> Total blocked: 20  Total waited: 158
> 
> Stack trace: 
> java.lang.Object.wait(Native Method)
> java.lang.Object.wait(Object.java:485)
> org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
> com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)
> 
> 
> If I look at the broker (and I'm not really sure what to look at here),
> the thread for my queue that should be dispatching messages looks like
> this 
> Name: QueueThread:queue://csPIQ
> State: WAITING on
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
> Total blocked: 2,365  Total waited: 6,717
> 
> Stack trace: 
> sun.misc.Unsafe.park(Native Method)
> java.util.concurrent.locks.LockSupport.park(Unknown Source)
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
> Source)
> java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
> java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> java.lang.Thread.run(Unknown Source)
> 
> The broker is configured with producerFlowControl="false", using TCP, a
> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
> 
> Any ideas on what my problem is or how/where I look in ActiveMQ to find
> the cause, or if the problem is with the consumer.
> 
> TIA
> Ian
> 
> 

-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p23365503.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Norbert Pfistner <np...@picturesafe.de>.
Hi,

we're experiencing the same problem.

We also use ActiveMQ 5.1 with jdbc persistant adapter and we use
and a queuePrefetch=1 on consumer side.

Our Broker waits at the same Unsafe.park as shown in jconsole:
Name: QueueThread:queue://NEW_FILE
State: WAITING
Total blocked: 120  Total waited: 15.149

Stack trace:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1841)
java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:359)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:470)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:674)
java.lang.Thread.run(Thread.java:595)


Also jconsole states a QueueSize=6 but browsing the queue via jconsoe 
shows no entries at all. Having a direct look at the DB the 6 messages 
exist in the activemq msg table.




shridharv schrieb:
> Hi,
> Was this issue figured out ?
> We have the same problem, wherein a consumer stops receiving further
> messages, as it has not committed after receiving around 1000 messages.  We
> cannot commit until we get a set of messages and hence the consume is
> waiting indefinitely.
> 
> Any suggestions welcome.
> AmQ 5.2 in Windows.
> -----------------------------------------------
> 
> 
> IBeaumont wrote:
>> I'm sending a mixture of persistent and non persistent messages.
>>
>> I have seen a negative queue count before so will look at the trunk.
>>
>> Can't see anything unusal in JConsole, but I have just downlaoded the
>> source and in the ActiveMQMessageConsumer.receiveNoWait there are these
>> lines...
>>         if (info.getPrefetchSize() == 0) {
>>             md = dequeue(-1); // We let the broker let us know when we
>>             // timeout.
>>         } else {
>>             md = dequeue(0);
>>         }
>>
>> So that explains why my consumes seem to hang when things go wrong -
>> because they wait forever because I have a prefetchSize of zero.
>>
>> I've now changed me code so that instead of using receiveNoWait, I'll use
>> "receive" with a short timeout.  Hopefully then things will timeout and
>> messages will contiue to be processed.  I'll then need to find out if all
>> any messages get skipped.   ALthough that doesn't help find the cause.
>>
>>
>>
>>
>>
>> Gary Tully wrote:
>>> Your use case sounds typical and reasonable but just to understand,
>>> are you sending persistent and non persistent messages to the same
>>> queue?
>>>
>>> Can you check in Jconsole, in the ActiveMQ BrokerView - Queues and
>>> Subscriptions:
>>> Do the queue metrics (size, dispatched) look as expected?
>>> A negative queue size is indicative of a issue that was resolved on
>>> trunk recently. If you see that you could try a snapshot.
>>>
>>> Re: prefetch==0. ok, yea, you need that if you want to depende on
>>> redelivered(). tThat is a known issue, prefetched messages that are
>>> not consumed are deemed redelivered when they are dispatched to the
>>> next consumer.
>>> ActiveMQ redelivered means delivered to a amq consumer, not delivered
>>> to the end user. see:
>>> https://issues.apache.org/activemq/browse/AMQ-1952
>>>
>>> 2009/1/13 IBeaumont <IB...@categoric.com>:
>>>> Hi Gary,
>>>> Thanks for the feedback.
>>>> As you can see from my stack traces earlier in jconsole, the consumers
>>>> are
>>>> stuck on pulling messages from the queues, they are in:
>>>> org.apache.activemq.MessageDispatchChannel.dequeue
>>>>
>>>>
>>>> The reason I've ended up with the settings I have as so far they seem to
>>>> be
>>>> give me the desired results (apart from this last problem).  Maybe it
>>>> would
>>>> be easier to explain the behaviur I need and someone might be able to
>>>> advise
>>>> on the best settings...
>>>>
>>>> So most messages sent are persistent, and I need to process every
>>>> message -
>>>> I can't afford to drop any.  I may have slow "consumers", and I might be
>>>> putting messages on to the queues at a far greater rate than they can
>>>> get
>>>> processed (I want any available harddisk space to be used for message
>>>> storage).  There are a a number of consumers and producers, and a number
>>>> of
>>>> different queues.
>>>>
>>>>
>>>> The pre-fetch size was set to zero to overcome an issue I was having
>>>> with
>>>> redelivery count.  Our application uses the JMS redelivered to see if it
>>>> has
>>>> already tried processing the message.  Using a pre-fetch size bigger
>>>> than 0
>>>> was causing me some issues with this.  Out of interest, do you know what
>>>> happens to messages that are pre-fetched and then the consumer dies.  Do
>>>> they get flagged as redelivered when a new consumer picks them up?
>>>>
>>>>
>>>>
>>>>
>>>> Gary Tully wrote:
>>>>> A good place to start is with JCosole, to have a look at the queues
>>>>> and consumers to see how many messages are currently in the queues.
>>>>>
>>>>>> The broker is configured with producerFlowControl="false", using TCP, a
>>>>>> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>>>>>
>>>>> The sendFailIfNoSpace is disabled if producerFlowControl==false, so
>>>>> your producers will hang if memory for the queues are exhausted.
>>>>> sendFailIfNoSpace is considered a flowControl mechanism that does not
>>>>> block so it needs producerFlowControl to be enabled (the default) and
>>>>> no producer window to be set (also the default).
>>>>>
>>>>> Just a thought, but is it possible that the consumers are blocking
>>>>> when trying to "stick messages" back on a queue?
>>>>>
>>>>> Out of interest, why are you using prefetch==0?
>>>>>
>>>>> 2009/1/13 IBeaumont <IB...@categoric.com>:
>>>>>> I've got a fairly complex app, that takes msgs, processing them and
>>>>>> sticks
>>>>>> them on the same or different queues.
>>>>>>
>>>>>> The queues are pre-loaded with persistent messages before the
>>>>>> application
>>>>>> starts (50000).  Once it starts processing things work fine for a
>>>>>> while
>>>>>> and
>>>>>> then the consumers stop receiving any messages.  I have a 4 consumers
>>>>>> for
>>>>>> each queue, and there are 3 different queues.
>>>>>>
>>>>>> Looking at jconsole all consumes are waiting here:
>>>>>>
>>>>>> State: WAITING on java.lang.Object@1801d4a
>>>>>> Total blocked: 20  Total waited: 158
>>>>>>
>>>>>> Stack trace:
>>>>>> java.lang.Object.wait(Native Method)
>>>>>> java.lang.Object.wait(Object.java:485)
>>>>>> org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
>>>>>> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
>>>>>> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
>>>>>> com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)
>>>>>>
>>>>>>
>>>>>> If I look at the broker (and I'm not really sure what to look at
>>>>>> here),
>>>>>> the
>>>>>> thread for my queue that should be dispatching messages looks like
>>>>>> this
>>>>>> Name: QueueThread:queue://csPIQ
>>>>>> State: WAITING on
>>>>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
>>>>>> Total blocked: 2,365  Total waited: 6,717
>>>>>>
>>>>>> Stack trace:
>>>>>> sun.misc.Unsafe.park(Native Method)
>>>>>> java.util.concurrent.locks.LockSupport.park(Unknown Source)
>>>>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
>>>>>> Source)
>>>>>> java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
>>>>>> java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>>>>>> java.lang.Thread.run(Unknown Source)
>>>>>>
>>>>>> The broker is configured with producerFlowControl="false", using TCP,
>>>>>> a
>>>>>> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>>>>>
>>>>>> Any ideas on what my problem is or how/where I look in ActiveMQ to
>>>>>> find
>>>>>> the
>>>>>> cause, or if the problem is with the consumer.
>>>>>>
>>>>>> TIA
>>>>>> Ian
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438163.html
>>>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> http://blog.garytully.com
>>>>>
>>>>> Open Source SOA
>>>>> http://FUSESource.com
>>>>>
>>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21440240.html
>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>> -- 
>>> http://blog.garytully.com
>>>
>>> Open Source SOA
>>> http://FUSESource.com
>>>
>>>
>>
> 

-- 

Dipl.-Ing. Norbert Pfistner
Softwareentwicklung

picturesafe GmbH
Simon-von-Utrecht-Straße 31-37
D-20359 Hamburg
http://www.picturesafe.de

fon: +49 40 374127 901
fax: +49 40 374127 999
npfistner@picturesafe.de

Sitz der Gesellschaft: Hannover
Geschäftsführer: Herbert Wirth
HR: Amtsgericht Hannover HR B 53 366

Re: Q Consumers stop receiving messages

Posted by IBeaumont <IB...@categoric.com>.

James.Strachan wrote:
> 
> Which version?
> 

ActiveMQ 5.2


I've also found that restarting the broker doesn't seem to make any
difference.  The consumes are still stuck on the same call, which makes me
think the problem is with the consumers.
-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438570.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by James Strachan <ja...@gmail.com>.
Which version?

2009/1/13 IBeaumont <IB...@categoric.com>:
>
> I've got a fairly complex app, that takes msgs, processing them and sticks
> them on the same or different queues.
>
> The queues are pre-loaded with persistent messages before the application
> starts (50000).  Once it starts processing things work fine for a while and
> then the consumers stop receiving any messages.  I have a 4 consumers for
> each queue, and there are 3 different queues.
>
> Looking at jconsole all consumes are waiting here:
>
> State: WAITING on java.lang.Object@1801d4a
> Total blocked: 20  Total waited: 158
>
> Stack trace:
> java.lang.Object.wait(Native Method)
> java.lang.Object.wait(Object.java:485)
> org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
> com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)
>
>
> If I look at the broker (and I'm not really sure what to look at here), the
> thread for my queue that should be dispatching messages looks like this
> Name: QueueThread:queue://csPIQ
> State: WAITING on
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
> Total blocked: 2,365  Total waited: 6,717
>
> Stack trace:
> sun.misc.Unsafe.park(Native Method)
> java.util.concurrent.locks.LockSupport.park(Unknown Source)
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
> Source)
> java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
> java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> java.lang.Thread.run(Unknown Source)
>
> The broker is configured with producerFlowControl="false", using TCP, a
> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>
> Any ideas on what my problem is or how/where I look in ActiveMQ to find the
> cause, or if the problem is with the consumer.
>
> TIA
> Ian
>
> --
> View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438163.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Re: Q Consumers stop receiving messages

Posted by shridharv <Sh...@NeemTree.com>.
Hi,
Was this issue figured out ?
We have the same problem, wherein a consumer stops receiving further
messages, as it has not committed after receiving around 1000 messages.  We
cannot commit until we get a set of messages and hence the consume is
waiting indefinitely.

Any suggestions welcome.
AmQ 5.2 in Windows.
-----------------------------------------------


IBeaumont wrote:
> 
> I'm sending a mixture of persistent and non persistent messages.
> 
> I have seen a negative queue count before so will look at the trunk.
> 
> Can't see anything unusal in JConsole, but I have just downlaoded the
> source and in the ActiveMQMessageConsumer.receiveNoWait there are these
> lines...
>         if (info.getPrefetchSize() == 0) {
>             md = dequeue(-1); // We let the broker let us know when we
>             // timeout.
>         } else {
>             md = dequeue(0);
>         }
> 
> So that explains why my consumes seem to hang when things go wrong -
> because they wait forever because I have a prefetchSize of zero.
> 
> I've now changed me code so that instead of using receiveNoWait, I'll use
> "receive" with a short timeout.  Hopefully then things will timeout and
> messages will contiue to be processed.  I'll then need to find out if all
> any messages get skipped.   ALthough that doesn't help find the cause.
> 
> 
> 
> 
> 
> Gary Tully wrote:
>> 
>> Your use case sounds typical and reasonable but just to understand,
>> are you sending persistent and non persistent messages to the same
>> queue?
>> 
>> Can you check in Jconsole, in the ActiveMQ BrokerView - Queues and
>> Subscriptions:
>> Do the queue metrics (size, dispatched) look as expected?
>> A negative queue size is indicative of a issue that was resolved on
>> trunk recently. If you see that you could try a snapshot.
>> 
>> Re: prefetch==0. ok, yea, you need that if you want to depende on
>> redelivered(). tThat is a known issue, prefetched messages that are
>> not consumed are deemed redelivered when they are dispatched to the
>> next consumer.
>> ActiveMQ redelivered means delivered to a amq consumer, not delivered
>> to the end user. see:
>> https://issues.apache.org/activemq/browse/AMQ-1952
>> 
>> 2009/1/13 IBeaumont <IB...@categoric.com>:
>>>
>>> Hi Gary,
>>> Thanks for the feedback.
>>> As you can see from my stack traces earlier in jconsole, the consumers
>>> are
>>> stuck on pulling messages from the queues, they are in:
>>> org.apache.activemq.MessageDispatchChannel.dequeue
>>>
>>>
>>> The reason I've ended up with the settings I have as so far they seem to
>>> be
>>> give me the desired results (apart from this last problem).  Maybe it
>>> would
>>> be easier to explain the behaviur I need and someone might be able to
>>> advise
>>> on the best settings...
>>>
>>> So most messages sent are persistent, and I need to process every
>>> message -
>>> I can't afford to drop any.  I may have slow "consumers", and I might be
>>> putting messages on to the queues at a far greater rate than they can
>>> get
>>> processed (I want any available harddisk space to be used for message
>>> storage).  There are a a number of consumers and producers, and a number
>>> of
>>> different queues.
>>>
>>>
>>> The pre-fetch size was set to zero to overcome an issue I was having
>>> with
>>> redelivery count.  Our application uses the JMS redelivered to see if it
>>> has
>>> already tried processing the message.  Using a pre-fetch size bigger
>>> than 0
>>> was causing me some issues with this.  Out of interest, do you know what
>>> happens to messages that are pre-fetched and then the consumer dies.  Do
>>> they get flagged as redelivered when a new consumer picks them up?
>>>
>>>
>>>
>>>
>>> Gary Tully wrote:
>>>>
>>>> A good place to start is with JCosole, to have a look at the queues
>>>> and consumers to see how many messages are currently in the queues.
>>>>
>>>>>The broker is configured with producerFlowControl="false", using TCP, a
>>>>>pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>>>>
>>>> The sendFailIfNoSpace is disabled if producerFlowControl==false, so
>>>> your producers will hang if memory for the queues are exhausted.
>>>> sendFailIfNoSpace is considered a flowControl mechanism that does not
>>>> block so it needs producerFlowControl to be enabled (the default) and
>>>> no producer window to be set (also the default).
>>>>
>>>> Just a thought, but is it possible that the consumers are blocking
>>>> when trying to "stick messages" back on a queue?
>>>>
>>>> Out of interest, why are you using prefetch==0?
>>>>
>>>> 2009/1/13 IBeaumont <IB...@categoric.com>:
>>>>>
>>>>> I've got a fairly complex app, that takes msgs, processing them and
>>>>> sticks
>>>>> them on the same or different queues.
>>>>>
>>>>> The queues are pre-loaded with persistent messages before the
>>>>> application
>>>>> starts (50000).  Once it starts processing things work fine for a
>>>>> while
>>>>> and
>>>>> then the consumers stop receiving any messages.  I have a 4 consumers
>>>>> for
>>>>> each queue, and there are 3 different queues.
>>>>>
>>>>> Looking at jconsole all consumes are waiting here:
>>>>>
>>>>> State: WAITING on java.lang.Object@1801d4a
>>>>> Total blocked: 20  Total waited: 158
>>>>>
>>>>> Stack trace:
>>>>> java.lang.Object.wait(Native Method)
>>>>> java.lang.Object.wait(Object.java:485)
>>>>> org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
>>>>> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
>>>>> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
>>>>> com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)
>>>>>
>>>>>
>>>>> If I look at the broker (and I'm not really sure what to look at
>>>>> here),
>>>>> the
>>>>> thread for my queue that should be dispatching messages looks like
>>>>> this
>>>>> Name: QueueThread:queue://csPIQ
>>>>> State: WAITING on
>>>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
>>>>> Total blocked: 2,365  Total waited: 6,717
>>>>>
>>>>> Stack trace:
>>>>> sun.misc.Unsafe.park(Native Method)
>>>>> java.util.concurrent.locks.LockSupport.park(Unknown Source)
>>>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
>>>>> Source)
>>>>> java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
>>>>> java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>>>>> java.lang.Thread.run(Unknown Source)
>>>>>
>>>>> The broker is configured with producerFlowControl="false", using TCP,
>>>>> a
>>>>> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>>>>
>>>>> Any ideas on what my problem is or how/where I look in ActiveMQ to
>>>>> find
>>>>> the
>>>>> cause, or if the problem is with the consumer.
>>>>>
>>>>> TIA
>>>>> Ian
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438163.html
>>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> http://blog.garytully.com
>>>>
>>>> Open Source SOA
>>>> http://FUSESource.com
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21440240.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> 
>> -- 
>> http://blog.garytully.com
>> 
>> Open Source SOA
>> http://FUSESource.com
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p23346978.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by sweetjonnie <jo...@yahoo.com>.

Gary Tully wrote:
> 
> in transacted mode, who is managing the transaction demarcation? In
> other words, where is the session.commit() call?
> 

it turns out that this issue was not related to the other issues in this
thread.

i had failed to make the message-producers commit and this was responsible
for what appeared to be dead lock.
-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21971637.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by sweetjonnie <jo...@yahoo.com>.

Gary Tully wrote:
> 
> in transacted mode, who is managing the transaction demarcation? In
> other words, where is the session.commit() call?
> 

This is a session based transaction as opposed to an external JTA operation.

The COMMIT is, therefore, made against the jms session object.

The call is made within the MessageListener's onMessage method.

Thank you for your response.

Sincerely,
jonnie savell
-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21919955.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Gary Tully <ga...@gmail.com>.
Jonnie,
in transacted mode, who is managing the transaction demarcation? In
other words, where is the session.commit() call?

2009/2/8 sweetjonnie <jo...@yahoo.com>:
>
> at least one in the thread mentioned persistence and i wonder if my problem
> is related.
>
> i am newbie/retarded and cannot get my embedded broker to deliver transacted
> messages to my async client in my ActiveMQ 5.2 environment.
>
> connection.createSession(false, Session.AUTO_ACKNOWLEDGE) works: message is
> delivered.
> connection.createSession(true, Session.SESSION_TRANSACTED) fails: message is
> not delivered although no errors appear.
>
> When a transacted session is created, the bad behavior is detected
> regardless of whether amqPersistenceAdapter or journaledJDBC is specified as
> the persistence method.
>
> Would someone be willing to take a look at the following excerpts and tell
> me if they spot an error (and if so, what it is)? I thank all for their
> time.
>
> What follows are the contents of two configuration files:
> (1) application configuration:
> <beans>
>    <bean id="broker"
>          class="org.apache.activemq.xbean.BrokerFactoryBean">
>        <property name="config" value="classpath:QueueConfiguration.xml" />
>        <property name="start" value="true"/>
>    </bean>
>
>    <bean id="connectionFactory"
>          class="org.apache.activemq.ActiveMQConnectionFactory"
>          depends-on="broker">
>        <property name="brokerURL" value="vm://localhost"/>
>    </bean>
>
>    <!-- autowire="constructor" -->
>    <bean id="staging"
>          class="org.apache.activemq.command.ActiveMQQueue">
>        <constructor-arg index="0" value="internal"/>
>    </bean>
> </beans>
>
> (2) the configuration file above references QueueConfiguration.xml which is
> listed below:
> <beans>
>    <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>        <property name="locations">
>
> <value>classpath:com.indigententerprises.configuration.internalqueuing.properties</value>
>        </property>
>    </bean>
>
>    <bean id="derby-ds"
>          class="org.apache.derby.jdbc.EmbeddedDataSource">
>        <property name="databaseName" value="derbydb"/>
>        <property name="createDatabase" value="create"/>
>    </bean>
>
>    <!-- embedded -->
>    <amq:broker useJmx="false"
>                brokerName="localhost"
>                dataDirectory="${brokerdirectory}"
>                persistent="true">
>        <amq:persistenceAdapter>
>            <!-- amq:amqPersistenceAdapter syncOnWrite="true"
>
> directory="${amqpersistencedirectory}"
>                                           maxFileLength="20 mb"/ -->
>
>            <amq:journaledJDBC dataDirectory="${amqpersistencedirectory}"
> dataSource="#derby-ds"/>
>        </amq:persistenceAdapter>
>        <amq:transportConnectors/>
>    </amq:broker>
> </beans>
>
>
> --
> View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21895847.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Re: Q Consumers stop receiving messages

Posted by sweetjonnie <jo...@yahoo.com>.
at least one in the thread mentioned persistence and i wonder if my problem
is related.

i am newbie/retarded and cannot get my embedded broker to deliver transacted
messages to my async client in my ActiveMQ 5.2 environment.

connection.createSession(false, Session.AUTO_ACKNOWLEDGE) works: message is
delivered.
connection.createSession(true, Session.SESSION_TRANSACTED) fails: message is
not delivered although no errors appear.

When a transacted session is created, the bad behavior is detected
regardless of whether amqPersistenceAdapter or journaledJDBC is specified as
the persistence method.

Would someone be willing to take a look at the following excerpts and tell
me if they spot an error (and if so, what it is)? I thank all for their
time.

What follows are the contents of two configuration files:
(1) application configuration:
<beans>
    <bean id="broker"
          class="org.apache.activemq.xbean.BrokerFactoryBean">
        <property name="config" value="classpath:QueueConfiguration.xml" />
        <property name="start" value="true"/>
    </bean>

    <bean id="connectionFactory"
          class="org.apache.activemq.ActiveMQConnectionFactory"
          depends-on="broker">
        <property name="brokerURL" value="vm://localhost"/>
    </bean>

    <!-- autowire="constructor" -->
    <bean id="staging"
          class="org.apache.activemq.command.ActiveMQQueue">
        <constructor-arg index="0" value="internal"/>
    </bean>
</beans>

(2) the configuration file above references QueueConfiguration.xml which is
listed below:
<beans>
    <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
           
<value>classpath:com.indigententerprises.configuration.internalqueuing.properties</value>
        </property>
    </bean>

    <bean id="derby-ds"
          class="org.apache.derby.jdbc.EmbeddedDataSource">
        <property name="databaseName" value="derbydb"/>
        <property name="createDatabase" value="create"/>
    </bean>

    <!-- embedded -->
    <amq:broker useJmx="false"
                brokerName="localhost"
                dataDirectory="${brokerdirectory}"
                persistent="true">
        <amq:persistenceAdapter>
            <!-- amq:amqPersistenceAdapter syncOnWrite="true"
                                          
directory="${amqpersistencedirectory}"
                                           maxFileLength="20 mb"/ -->

            <amq:journaledJDBC dataDirectory="${amqpersistencedirectory}"
dataSource="#derby-ds"/>
        </amq:persistenceAdapter>
        <amq:transportConnectors/>
    </amq:broker>
</beans>


-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21895847.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Jim Gomes <e....@gmail.com>.
Hi Bill,

Thanks for the tips and suggestions.  I'll take a look at giving them a
try.  Right now our data store is the default Kaha data store.  I had
wondered if switching to some other data store might improve things.

- Jim

On Thu, Feb 5, 2009 at 4:41 AM, Bill Schuller <Bi...@intuit.com>wrote:

> We ran into a similar problem with one of our ActiveMQ implementations. My
> theory was that messages were being paged out of memory and the consumers
> were consuming faster than the dispatch queue could be re-filled. We made a
> plethora of changes all at once, but here was the tact I took:
>
> 1. Faster datastore (switch from journaled JDBC/Derby to AMQ Message Store)
>
> 2. Switch from store-based cursors to file-based cursors (if we were for
> some reason married to the JDBC datastore)
>
> 3. Increase the size of the dispatch queue, forcing a larger "store fetch"
> (default is 200 msgs): <policyEntry queue=">" maxPageSize="5000"/>
>
> 4. Increase the heap and memoryUsage limits to allow for more memory
> <memoryUsage limit="3 gb" />
>
> Since by default AMQ uses store-based cursors for persistent messages and
> only uses a special file-based cursor for non-persistent messages, a slow
> datastore could be your problem. Non-persistent message never hit the
> datastore, so the would not be affected.
>
> Best of luck, curious if this addresses your problem.
>
> On 1/30/09 6:02 PM, "Jim Gomes" <e....@gmail.com> wrote:
>
> > This seems very similar to a problem we are
> > experiencing with the broker halting dispatch of messages to consumers
> that
> > are ready and able to receive messages.
>
> ---
> Bill Schuller, Service Foundations Engineering, Intuit Inc.
>
>

Re: Q Consumers stop receiving messages

Posted by Diego Castorina <di...@func.nl>.
The test with prefetchLimit set to 1 has just completed successfully!!!

Just one last question.Suppose that prefetchLimit is 1 and one message is
sent to a queue that at the moment is not being used by the
DefaultMessageListenerContainer, than I would still have one message not
being processed until a new message is sent to the queue, right?
Would it be a solution to set the cacheConsumers property of the
DefaultMessageListenerContainer equal to false, since creating a new
consumer should  not be a really expensive operation?

Thanks a lot for your help!


rajdavies wrote:
> 
> could be prefetch limit  - the default is 1000 - would be worth trying  
> with 1
> 
> On 15 Dec 2009, at 13:54, Diego Castorina wrote:
> 
>>
>> I went a little bit further with my tests:
>> -the queue was containing 5219 messages and no one of them was  
>> distributed
>> to any of the listeners (I set the maxConcurrentConsumers property  
>> in the
>> DefaultMessageContainerListener of Spring to 20)
>> -I added 50 messages to the queue
>> -the first 50 message of the 5219 that were already in the queue  
>> were sent
>> to the listeners
>> -the queue hangs again, still containing 5219 message and the last 50
>> messages add during the second step are probably at the bottom of  
>> the queue
>>
>> I repeated those steps several times, obtaining always the same  
>> behavior.
>> it is like now the queue maintain the size it had as it started  
>> hanging.
>>
>> In my application I use
>> org.springframework.jms.connection.CachingConnectionFactory and set  
>> the
>> sessionCacheSize to 100. Is it related to connection timeout as  
>> reported in
>> http://jira.springframework.org/browse/SPR-5098? Has it something to  
>> do with
>> prefetchLimit? Or is it more a combination of both ???
>>
>> Please help :(
>> -- 
>> View this message in context:
>> http://old.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p26795148.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> Rob Davies
> http://twitter.com/rajdavies
> I work here: http://fusesource.com
> My Blog: http://rajdavies.blogspot.com/
> I'm writing this: http://www.manning.com/snyder/
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p26812140.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Rob Davies <ra...@gmail.com>.
could be prefetch limit  - the default is 1000 - would be worth trying  
with 1

On 15 Dec 2009, at 13:54, Diego Castorina wrote:

>
> I went a little bit further with my tests:
> -the queue was containing 5219 messages and no one of them was  
> distributed
> to any of the listeners (I set the maxConcurrentConsumers property  
> in the
> DefaultMessageContainerListener of Spring to 20)
> -I added 50 messages to the queue
> -the first 50 message of the 5219 that were already in the queue  
> were sent
> to the listeners
> -the queue hangs again, still containing 5219 message and the last 50
> messages add during the second step are probably at the bottom of  
> the queue
>
> I repeated those steps several times, obtaining always the same  
> behavior.
> it is like now the queue maintain the size it had as it started  
> hanging.
>
> In my application I use
> org.springframework.jms.connection.CachingConnectionFactory and set  
> the
> sessionCacheSize to 100. Is it related to connection timeout as  
> reported in
> http://jira.springframework.org/browse/SPR-5098? Has it something to  
> do with
> prefetchLimit? Or is it more a combination of both ???
>
> Please help :(
> -- 
> View this message in context: http://old.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p26795148.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Rob Davies
http://twitter.com/rajdavies
I work here: http://fusesource.com
My Blog: http://rajdavies.blogspot.com/
I'm writing this: http://www.manning.com/snyder/






Re: Q Consumers stop receiving messages

Posted by Diego Castorina <di...@func.nl>.
I went a little bit further with my tests:
-the queue was containing 5219 messages and no one of them was distributed
to any of the listeners (I set the maxConcurrentConsumers property in the
DefaultMessageContainerListener of Spring to 20)
-I added 50 messages to the queue
-the first 50 message of the 5219 that were already in the queue were sent
to the listeners
-the queue hangs again, still containing 5219 message and the last 50
messages add during the second step are probably at the bottom of the queue

I repeated those steps several times, obtaining always the same behavior.
it is like now the queue maintain the size it had as it started hanging.

In my application I use
org.springframework.jms.connection.CachingConnectionFactory and set the
sessionCacheSize to 100. Is it related to connection timeout as reported in
http://jira.springframework.org/browse/SPR-5098? Has it something to do with
prefetchLimit? Or is it more a combination of both ???

Please help :(
-- 
View this message in context: http://old.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p26795148.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Diego Castorina <di...@func.nl>.
Yes, it is.


rajdavies wrote:
> 
> Is this version 5.3 ?
> On 15 Dec 2009, at 10:50, Diego Castorina wrote:
> 
>>
>> We are experiencing similar problems.
>> We are informed by the mbean queueSize property that around 5000  
>> messages
>> are still in the queue.
>> This is the configuration of our broker:
>>
>> 	<amq:broker brokerName="mdms-broker" start="true"
>> dataDirectory="${importer.jms.directory}" >
>> 		<amq:destinationPolicy>
>> 			<amq:policyMap>
>> 				<amq:policyEntries>
>> 					<amq:policyEntry queue="*" producerFlowControl="false">
>> 						<amq:dispatchPolicy>
>> 							<amq:strictOrderDispatchPolicy/>							
>> 						</amq:dispatchPolicy>
>> 						<amq:subscriptionRecoveryPolicy>
>> 							<amq:lastImageSubscriptionRecoveryPolicy/>
>> 						</amq:subscriptionRecoveryPolicy>
>> 					</amq:policyEntry>
>> 				</amq:policyEntries>
>> 			</amq:policyMap>
>> 		</amq:destinationPolicy>
>> 		<amq:transportConnectors>
>> 			<amq:transportConnector
>> uri="${importer.jms.transportConnector.uri}"></amq:transportConnector>
>> 		</amq:transportConnectors>
>> 	</amq:broker>
>>
>> Is there any workaround for timeout issue?
>>
>> Thanks for any tip
>> -- 
>> View this message in context:
>> http://old.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p26792856.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> Rob Davies
> http://twitter.com/rajdavies
> I work here: http://fusesource.com
> My Blog: http://rajdavies.blogspot.com/
> I'm writing this: http://www.manning.com/snyder/
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p26794952.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Rob Davies <ra...@gmail.com>.
Is this version 5.3 ?
On 15 Dec 2009, at 10:50, Diego Castorina wrote:

>
> We are experiencing similar problems.
> We are informed by the mbean queueSize property that around 5000  
> messages
> are still in the queue.
> This is the configuration of our broker:
>
> 	<amq:broker brokerName="mdms-broker" start="true"
> dataDirectory="${importer.jms.directory}" >
> 		<amq:destinationPolicy>
> 			<amq:policyMap>
> 				<amq:policyEntries>
> 					<amq:policyEntry queue="*" producerFlowControl="false">
> 						<amq:dispatchPolicy>
> 							<amq:strictOrderDispatchPolicy/>							
> 						</amq:dispatchPolicy>
> 						<amq:subscriptionRecoveryPolicy>
> 							<amq:lastImageSubscriptionRecoveryPolicy/>
> 						</amq:subscriptionRecoveryPolicy>
> 					</amq:policyEntry>
> 				</amq:policyEntries>
> 			</amq:policyMap>
> 		</amq:destinationPolicy>
> 		<amq:transportConnectors>
> 			<amq:transportConnector
> uri="${importer.jms.transportConnector.uri}"></amq:transportConnector>
> 		</amq:transportConnectors>
> 	</amq:broker>
>
> Is there any workaround for timeout issue?
>
> Thanks for any tip
> -- 
> View this message in context: http://old.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p26792856.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Rob Davies
http://twitter.com/rajdavies
I work here: http://fusesource.com
My Blog: http://rajdavies.blogspot.com/
I'm writing this: http://www.manning.com/snyder/






Re: Q Consumers stop receiving messages

Posted by Diego Castorina <di...@func.nl>.
We are experiencing similar problems.
We are informed by the mbean queueSize property that around 5000 messages
are still in the queue.
This is the configuration of our broker:

	<amq:broker brokerName="mdms-broker" start="true"
dataDirectory="${importer.jms.directory}" >
		<amq:destinationPolicy>
			<amq:policyMap>
				<amq:policyEntries>
					<amq:policyEntry queue="*" producerFlowControl="false">
						<amq:dispatchPolicy>
							<amq:strictOrderDispatchPolicy/>							
						</amq:dispatchPolicy>
						<amq:subscriptionRecoveryPolicy>
							<amq:lastImageSubscriptionRecoveryPolicy/>
						</amq:subscriptionRecoveryPolicy>
					</amq:policyEntry>
				</amq:policyEntries>
			</amq:policyMap>
		</amq:destinationPolicy>
		<amq:transportConnectors>
			<amq:transportConnector
uri="${importer.jms.transportConnector.uri}"></amq:transportConnector>
		</amq:transportConnectors>
	</amq:broker>

Is there any workaround for timeout issue?

Thanks for any tip
-- 
View this message in context: http://old.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p26792856.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by ciAnd7 <ci...@gmail.com>.
We have similar problem with ActiveMQ 5.2 and Spring 2.5.6. I found the issue
in Spring JIRA
http://jira.springframework.org/browse/SPR-5110 ,
http://jira.springframework.org/browse/SPR-5098
that seems to be related to this one. May be one of developers takes the
look at it...
Thanks.



Bill Schuller wrote:
> 
> We ran into a similar problem with one of our ActiveMQ implementations. My
> theory was that messages were being paged out of memory and the consumers
> were consuming faster than the dispatch queue could be re-filled. We made
> a
> plethora of changes all at once, but here was the tact I took:
> 
> 1. Faster datastore (switch from journaled JDBC/Derby to AMQ Message
> Store)
> 
> 2. Switch from store-based cursors to file-based cursors (if we were for
> some reason married to the JDBC datastore)
> 
> 3. Increase the size of the dispatch queue, forcing a larger "store fetch"
> (default is 200 msgs): <policyEntry queue=">" maxPageSize="5000"/>
> 
> 4. Increase the heap and memoryUsage limits to allow for more memory
> <memoryUsage limit="3 gb" />
> 
> Since by default AMQ uses store-based cursors for persistent messages and
> only uses a special file-based cursor for non-persistent messages, a slow
> datastore could be your problem. Non-persistent message never hit the
> datastore, so the would not be affected.
> 
> Best of luck, curious if this addresses your problem.
> 
> On 1/30/09 6:02 PM, "Jim Gomes" <e....@gmail.com> wrote:
> 
>> This seems very similar to a problem we are
>> experiencing with the broker halting dispatch of messages to consumers
>> that
>> are ready and able to receive messages.
> 
> ---
> Bill Schuller, Service Foundations Engineering, Intuit Inc.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p24639295.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Bill Schuller <Bi...@intuit.com>.
We ran into a similar problem with one of our ActiveMQ implementations. My
theory was that messages were being paged out of memory and the consumers
were consuming faster than the dispatch queue could be re-filled. We made a
plethora of changes all at once, but here was the tact I took:

1. Faster datastore (switch from journaled JDBC/Derby to AMQ Message Store)

2. Switch from store-based cursors to file-based cursors (if we were for
some reason married to the JDBC datastore)

3. Increase the size of the dispatch queue, forcing a larger "store fetch"
(default is 200 msgs): <policyEntry queue=">" maxPageSize="5000"/>

4. Increase the heap and memoryUsage limits to allow for more memory
<memoryUsage limit="3 gb" />

Since by default AMQ uses store-based cursors for persistent messages and
only uses a special file-based cursor for non-persistent messages, a slow
datastore could be your problem. Non-persistent message never hit the
datastore, so the would not be affected.

Best of luck, curious if this addresses your problem.

On 1/30/09 6:02 PM, "Jim Gomes" <e....@gmail.com> wrote:

> This seems very similar to a problem we are
> experiencing with the broker halting dispatch of messages to consumers that
> are ready and able to receive messages.

---
Bill Schuller, Service Foundations Engineering, Intuit Inc.


Re: Q Consumers stop receiving messages

Posted by Jim Gomes <e....@gmail.com>.
Any updates on this issue?  This seems very similar to a problem we are
experiencing with the broker halting dispatch of messages to consumers that
are ready and able to receive messages.  Our problem definitely seems to be
surrounding the flagging of messages as persistent.  Our current work-around
is we installed a plug-in that turns off the persistent flag before the
message is inserted into the broker destinations.  This allowed us to avoid
any client-side code/logic changes.  Once we forced all messages to turn off
the persistent flag, then all of our messages are flowing without any
hiccups.

I am very suspect of the code logic inside ActiveMQ that handles persistent
message routing and delivery.  This is with the shipping 5.1.0, 5.2.0, and
previous 5.3-SNAPSHOT versions.  I haven't updated 5.3 in about a month, so
I can't speak to the very latest version.

- Jim

On Tue, Jan 13, 2009 at 12:02 PM, IBeaumont <IB...@categoric.com> wrote:

>
> The application is already written, and currently we use either MQSeries or
> SwiftMQ for the queue provider.  I tried to drop ActiveMQ in a few years
> back but the performance was awful.  With version 5 it seems the
> performance
> problems are sorted.  Implementing a MessageListener isn't an ideal
> solution
> as I'd need to change a lot of other code.  I'm trying to avoid any
> changes.
>
>
>
> bsnyder wrote:
> >
> > On Tue, Jan 13, 2009 at 12:35 PM, IBeaumont <IB...@categoric.com>
> > wrote:
> >>
> >> I'm sending a mixture of persistent and non persistent messages.
> >>
> >> I have seen a negative queue count before so will look at the trunk.
> >>
> >> Can't see anything unusal in JConsole, but I have just downlaoded the
> >> source
> >> and in the ActiveMQMessageConsumer.receiveNoWait there are these
> lines...
> >>        if (info.getPrefetchSize() == 0) {
> >>            md = dequeue(-1); // We let the broker let us know when we
> >>            // timeout.
> >>        } else {
> >>            md = dequeue(0);
> >>        }
> >>
> >> So that explains why my consumes seem to hang when things go wrong -
> >> because
> >> they wait forever because I have a prefetchSize of zero.
> >>
> >> I've now changed me code so that instead of using receiveNoWait, I'll
> use
> >> "receive" with a short timeout.  Hopefully then things will timeout and
> >> messages will contiue to be processed.  I'll then need to find out if
> all
> >> any messages get skipped.   ALthough that doesn't help find the cause.
> >
> > I'm just curious, instead of using the synchronous methods have you
> > considered using the asynchronous API by implementing a
> > MessageListener?
> >
> > Bruce
> > --
> > perl -e 'print
> > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> > );'
> >
> > Apache ActiveMQ - http://activemq.org/
> > Apache Camel - http://activemq.org/camel/
> > Apache ServiceMix - http://servicemix.org/
> >
> > Blog: http://bruceblog.org/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21443338.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: Q Consumers stop receiving messages

Posted by IBeaumont <IB...@categoric.com>.
The application is already written, and currently we use either MQSeries or
SwiftMQ for the queue provider.  I tried to drop ActiveMQ in a few years
back but the performance was awful.  With version 5 it seems the performance
problems are sorted.  Implementing a MessageListener isn't an ideal solution
as I'd need to change a lot of other code.  I'm trying to avoid any changes.



bsnyder wrote:
> 
> On Tue, Jan 13, 2009 at 12:35 PM, IBeaumont <IB...@categoric.com>
> wrote:
>>
>> I'm sending a mixture of persistent and non persistent messages.
>>
>> I have seen a negative queue count before so will look at the trunk.
>>
>> Can't see anything unusal in JConsole, but I have just downlaoded the
>> source
>> and in the ActiveMQMessageConsumer.receiveNoWait there are these lines...
>>        if (info.getPrefetchSize() == 0) {
>>            md = dequeue(-1); // We let the broker let us know when we
>>            // timeout.
>>        } else {
>>            md = dequeue(0);
>>        }
>>
>> So that explains why my consumes seem to hang when things go wrong -
>> because
>> they wait forever because I have a prefetchSize of zero.
>>
>> I've now changed me code so that instead of using receiveNoWait, I'll use
>> "receive" with a short timeout.  Hopefully then things will timeout and
>> messages will contiue to be processed.  I'll then need to find out if all
>> any messages get skipped.   ALthough that doesn't help find the cause.
> 
> I'm just curious, instead of using the synchronous methods have you
> considered using the asynchronous API by implementing a
> MessageListener?
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21443338.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Bruce Snyder <br...@gmail.com>.
On Tue, Jan 13, 2009 at 12:35 PM, IBeaumont <IB...@categoric.com> wrote:
>
> I'm sending a mixture of persistent and non persistent messages.
>
> I have seen a negative queue count before so will look at the trunk.
>
> Can't see anything unusal in JConsole, but I have just downlaoded the source
> and in the ActiveMQMessageConsumer.receiveNoWait there are these lines...
>        if (info.getPrefetchSize() == 0) {
>            md = dequeue(-1); // We let the broker let us know when we
>            // timeout.
>        } else {
>            md = dequeue(0);
>        }
>
> So that explains why my consumes seem to hang when things go wrong - because
> they wait forever because I have a prefetchSize of zero.
>
> I've now changed me code so that instead of using receiveNoWait, I'll use
> "receive" with a short timeout.  Hopefully then things will timeout and
> messages will contiue to be processed.  I'll then need to find out if all
> any messages get skipped.   ALthough that doesn't help find the cause.

I'm just curious, instead of using the synchronous methods have you
considered using the asynchronous API by implementing a
MessageListener?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Re: Q Consumers stop receiving messages

Posted by IBeaumont <IB...@categoric.com>.
I'm sending a mixture of persistent and non persistent messages.

I have seen a negative queue count before so will look at the trunk.

Can't see anything unusal in JConsole, but I have just downlaoded the source
and in the ActiveMQMessageConsumer.receiveNoWait there are these lines...
        if (info.getPrefetchSize() == 0) {
            md = dequeue(-1); // We let the broker let us know when we
            // timeout.
        } else {
            md = dequeue(0);
        }

So that explains why my consumes seem to hang when things go wrong - because
they wait forever because I have a prefetchSize of zero.

I've now changed me code so that instead of using receiveNoWait, I'll use
"receive" with a short timeout.  Hopefully then things will timeout and
messages will contiue to be processed.  I'll then need to find out if all
any messages get skipped.   ALthough that doesn't help find the cause.





Gary Tully wrote:
> 
> Your use case sounds typical and reasonable but just to understand,
> are you sending persistent and non persistent messages to the same
> queue?
> 
> Can you check in Jconsole, in the ActiveMQ BrokerView - Queues and
> Subscriptions:
> Do the queue metrics (size, dispatched) look as expected?
> A negative queue size is indicative of a issue that was resolved on
> trunk recently. If you see that you could try a snapshot.
> 
> Re: prefetch==0. ok, yea, you need that if you want to depende on
> redelivered(). tThat is a known issue, prefetched messages that are
> not consumed are deemed redelivered when they are dispatched to the
> next consumer.
> ActiveMQ redelivered means delivered to a amq consumer, not delivered
> to the end user. see:
> https://issues.apache.org/activemq/browse/AMQ-1952
> 
> 2009/1/13 IBeaumont <IB...@categoric.com>:
>>
>> Hi Gary,
>> Thanks for the feedback.
>> As you can see from my stack traces earlier in jconsole, the consumers
>> are
>> stuck on pulling messages from the queues, they are in:
>> org.apache.activemq.MessageDispatchChannel.dequeue
>>
>>
>> The reason I've ended up with the settings I have as so far they seem to
>> be
>> give me the desired results (apart from this last problem).  Maybe it
>> would
>> be easier to explain the behaviur I need and someone might be able to
>> advise
>> on the best settings...
>>
>> So most messages sent are persistent, and I need to process every message
>> -
>> I can't afford to drop any.  I may have slow "consumers", and I might be
>> putting messages on to the queues at a far greater rate than they can get
>> processed (I want any available harddisk space to be used for message
>> storage).  There are a a number of consumers and producers, and a number
>> of
>> different queues.
>>
>>
>> The pre-fetch size was set to zero to overcome an issue I was having with
>> redelivery count.  Our application uses the JMS redelivered to see if it
>> has
>> already tried processing the message.  Using a pre-fetch size bigger than
>> 0
>> was causing me some issues with this.  Out of interest, do you know what
>> happens to messages that are pre-fetched and then the consumer dies.  Do
>> they get flagged as redelivered when a new consumer picks them up?
>>
>>
>>
>>
>> Gary Tully wrote:
>>>
>>> A good place to start is with JCosole, to have a look at the queues
>>> and consumers to see how many messages are currently in the queues.
>>>
>>>>The broker is configured with producerFlowControl="false", using TCP, a
>>>>pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>>>
>>> The sendFailIfNoSpace is disabled if producerFlowControl==false, so
>>> your producers will hang if memory for the queues are exhausted.
>>> sendFailIfNoSpace is considered a flowControl mechanism that does not
>>> block so it needs producerFlowControl to be enabled (the default) and
>>> no producer window to be set (also the default).
>>>
>>> Just a thought, but is it possible that the consumers are blocking
>>> when trying to "stick messages" back on a queue?
>>>
>>> Out of interest, why are you using prefetch==0?
>>>
>>> 2009/1/13 IBeaumont <IB...@categoric.com>:
>>>>
>>>> I've got a fairly complex app, that takes msgs, processing them and
>>>> sticks
>>>> them on the same or different queues.
>>>>
>>>> The queues are pre-loaded with persistent messages before the
>>>> application
>>>> starts (50000).  Once it starts processing things work fine for a while
>>>> and
>>>> then the consumers stop receiving any messages.  I have a 4 consumers
>>>> for
>>>> each queue, and there are 3 different queues.
>>>>
>>>> Looking at jconsole all consumes are waiting here:
>>>>
>>>> State: WAITING on java.lang.Object@1801d4a
>>>> Total blocked: 20  Total waited: 158
>>>>
>>>> Stack trace:
>>>> java.lang.Object.wait(Native Method)
>>>> java.lang.Object.wait(Object.java:485)
>>>> org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
>>>> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
>>>> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
>>>> com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)
>>>>
>>>>
>>>> If I look at the broker (and I'm not really sure what to look at here),
>>>> the
>>>> thread for my queue that should be dispatching messages looks like this
>>>> Name: QueueThread:queue://csPIQ
>>>> State: WAITING on
>>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
>>>> Total blocked: 2,365  Total waited: 6,717
>>>>
>>>> Stack trace:
>>>> sun.misc.Unsafe.park(Native Method)
>>>> java.util.concurrent.locks.LockSupport.park(Unknown Source)
>>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
>>>> Source)
>>>> java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
>>>> java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>>>> java.lang.Thread.run(Unknown Source)
>>>>
>>>> The broker is configured with producerFlowControl="false", using TCP, a
>>>> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>>>
>>>> Any ideas on what my problem is or how/where I look in ActiveMQ to find
>>>> the
>>>> cause, or if the problem is with the consumer.
>>>>
>>>> TIA
>>>> Ian
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438163.html
>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> http://blog.garytully.com
>>>
>>> Open Source SOA
>>> http://FUSESource.com
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21440240.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source SOA
> http://FUSESource.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21442857.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Gary Tully <ga...@gmail.com>.
Your use case sounds typical and reasonable but just to understand,
are you sending persistent and non persistent messages to the same
queue?

Can you check in Jconsole, in the ActiveMQ BrokerView - Queues and
Subscriptions:
Do the queue metrics (size, dispatched) look as expected?
A negative queue size is indicative of a issue that was resolved on
trunk recently. If you see that you could try a snapshot.

Re: prefetch==0. ok, yea, you need that if you want to depende on
redelivered(). tThat is a known issue, prefetched messages that are
not consumed are deemed redelivered when they are dispatched to the
next consumer.
ActiveMQ redelivered means delivered to a amq consumer, not delivered
to the end user. see:
https://issues.apache.org/activemq/browse/AMQ-1952

2009/1/13 IBeaumont <IB...@categoric.com>:
>
> Hi Gary,
> Thanks for the feedback.
> As you can see from my stack traces earlier in jconsole, the consumers are
> stuck on pulling messages from the queues, they are in:
> org.apache.activemq.MessageDispatchChannel.dequeue
>
>
> The reason I've ended up with the settings I have as so far they seem to be
> give me the desired results (apart from this last problem).  Maybe it would
> be easier to explain the behaviur I need and someone might be able to advise
> on the best settings...
>
> So most messages sent are persistent, and I need to process every message -
> I can't afford to drop any.  I may have slow "consumers", and I might be
> putting messages on to the queues at a far greater rate than they can get
> processed (I want any available harddisk space to be used for message
> storage).  There are a a number of consumers and producers, and a number of
> different queues.
>
>
> The pre-fetch size was set to zero to overcome an issue I was having with
> redelivery count.  Our application uses the JMS redelivered to see if it has
> already tried processing the message.  Using a pre-fetch size bigger than 0
> was causing me some issues with this.  Out of interest, do you know what
> happens to messages that are pre-fetched and then the consumer dies.  Do
> they get flagged as redelivered when a new consumer picks them up?
>
>
>
>
> Gary Tully wrote:
>>
>> A good place to start is with JCosole, to have a look at the queues
>> and consumers to see how many messages are currently in the queues.
>>
>>>The broker is configured with producerFlowControl="false", using TCP, a
>>>pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>>
>> The sendFailIfNoSpace is disabled if producerFlowControl==false, so
>> your producers will hang if memory for the queues are exhausted.
>> sendFailIfNoSpace is considered a flowControl mechanism that does not
>> block so it needs producerFlowControl to be enabled (the default) and
>> no producer window to be set (also the default).
>>
>> Just a thought, but is it possible that the consumers are blocking
>> when trying to "stick messages" back on a queue?
>>
>> Out of interest, why are you using prefetch==0?
>>
>> 2009/1/13 IBeaumont <IB...@categoric.com>:
>>>
>>> I've got a fairly complex app, that takes msgs, processing them and
>>> sticks
>>> them on the same or different queues.
>>>
>>> The queues are pre-loaded with persistent messages before the application
>>> starts (50000).  Once it starts processing things work fine for a while
>>> and
>>> then the consumers stop receiving any messages.  I have a 4 consumers for
>>> each queue, and there are 3 different queues.
>>>
>>> Looking at jconsole all consumes are waiting here:
>>>
>>> State: WAITING on java.lang.Object@1801d4a
>>> Total blocked: 20  Total waited: 158
>>>
>>> Stack trace:
>>> java.lang.Object.wait(Native Method)
>>> java.lang.Object.wait(Object.java:485)
>>> org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
>>> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
>>> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
>>> com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)
>>>
>>>
>>> If I look at the broker (and I'm not really sure what to look at here),
>>> the
>>> thread for my queue that should be dispatching messages looks like this
>>> Name: QueueThread:queue://csPIQ
>>> State: WAITING on
>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
>>> Total blocked: 2,365  Total waited: 6,717
>>>
>>> Stack trace:
>>> sun.misc.Unsafe.park(Native Method)
>>> java.util.concurrent.locks.LockSupport.park(Unknown Source)
>>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
>>> Source)
>>> java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
>>> java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>>> java.lang.Thread.run(Unknown Source)
>>>
>>> The broker is configured with producerFlowControl="false", using TCP, a
>>> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>>
>>> Any ideas on what my problem is or how/where I look in ActiveMQ to find
>>> the
>>> cause, or if the problem is with the consumer.
>>>
>>> TIA
>>> Ian
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438163.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> http://blog.garytully.com
>>
>> Open Source SOA
>> http://FUSESource.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21440240.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Re: Q Consumers stop receiving messages

Posted by IBeaumont <IB...@categoric.com>.
Hi Gary,
Thanks for the feedback.
As you can see from my stack traces earlier in jconsole, the consumers are
stuck on pulling messages from the queues, they are in:
org.apache.activemq.MessageDispatchChannel.dequeue


The reason I've ended up with the settings I have as so far they seem to be
give me the desired results (apart from this last problem).  Maybe it would
be easier to explain the behaviur I need and someone might be able to advise
on the best settings...

So most messages sent are persistent, and I need to process every message -
I can't afford to drop any.  I may have slow "consumers", and I might be
putting messages on to the queues at a far greater rate than they can get
processed (I want any available harddisk space to be used for message
storage).  There are a a number of consumers and producers, and a number of
different queues.


The pre-fetch size was set to zero to overcome an issue I was having with
redelivery count.  Our application uses the JMS redelivered to see if it has
already tried processing the message.  Using a pre-fetch size bigger than 0
was causing me some issues with this.  Out of interest, do you know what
happens to messages that are pre-fetched and then the consumer dies.  Do
they get flagged as redelivered when a new consumer picks them up?




Gary Tully wrote:
> 
> A good place to start is with JCosole, to have a look at the queues
> and consumers to see how many messages are currently in the queues.
> 
>>The broker is configured with producerFlowControl="false", using TCP, a
>>pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>
> The sendFailIfNoSpace is disabled if producerFlowControl==false, so
> your producers will hang if memory for the queues are exhausted.
> sendFailIfNoSpace is considered a flowControl mechanism that does not
> block so it needs producerFlowControl to be enabled (the default) and
> no producer window to be set (also the default).
> 
> Just a thought, but is it possible that the consumers are blocking
> when trying to "stick messages" back on a queue?
> 
> Out of interest, why are you using prefetch==0?
> 
> 2009/1/13 IBeaumont <IB...@categoric.com>:
>>
>> I've got a fairly complex app, that takes msgs, processing them and
>> sticks
>> them on the same or different queues.
>>
>> The queues are pre-loaded with persistent messages before the application
>> starts (50000).  Once it starts processing things work fine for a while
>> and
>> then the consumers stop receiving any messages.  I have a 4 consumers for
>> each queue, and there are 3 different queues.
>>
>> Looking at jconsole all consumes are waiting here:
>>
>> State: WAITING on java.lang.Object@1801d4a
>> Total blocked: 20  Total waited: 158
>>
>> Stack trace:
>> java.lang.Object.wait(Native Method)
>> java.lang.Object.wait(Object.java:485)
>> org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
>> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
>> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
>> com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)
>>
>>
>> If I look at the broker (and I'm not really sure what to look at here),
>> the
>> thread for my queue that should be dispatching messages looks like this
>> Name: QueueThread:queue://csPIQ
>> State: WAITING on
>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
>> Total blocked: 2,365  Total waited: 6,717
>>
>> Stack trace:
>> sun.misc.Unsafe.park(Native Method)
>> java.util.concurrent.locks.LockSupport.park(Unknown Source)
>> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
>> Source)
>> java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
>> java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>> java.lang.Thread.run(Unknown Source)
>>
>> The broker is configured with producerFlowControl="false", using TCP, a
>> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>>
>> Any ideas on what my problem is or how/where I look in ActiveMQ to find
>> the
>> cause, or if the problem is with the consumer.
>>
>> TIA
>> Ian
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438163.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source SOA
> http://FUSESource.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21440240.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Q Consumers stop receiving messages

Posted by Gary Tully <ga...@gmail.com>.
A good place to start is with JCosole, to have a look at the queues
and consumers to see how many messages are currently in the queues.

>The broker is configured with producerFlowControl="false", using TCP, a
>pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>
The sendFailIfNoSpace is disabled if producerFlowControl==false, so
your producers will hang if memory for the queues are exhausted.
sendFailIfNoSpace is considered a flowControl mechanism that does not
block so it needs producerFlowControl to be enabled (the default) and
no producer window to be set (also the default).

Just a thought, but is it possible that the consumers are blocking
when trying to "stick messages" back on a queue?

Out of interest, why are you using prefetch==0?

2009/1/13 IBeaumont <IB...@categoric.com>:
>
> I've got a fairly complex app, that takes msgs, processing them and sticks
> them on the same or different queues.
>
> The queues are pre-loaded with persistent messages before the application
> starts (50000).  Once it starts processing things work fine for a while and
> then the consumers stop receiving any messages.  I have a 4 consumers for
> each queue, and there are 3 different queues.
>
> Looking at jconsole all consumes are waiting here:
>
> State: WAITING on java.lang.Object@1801d4a
> Total blocked: 20  Total waited: 158
>
> Stack trace:
> java.lang.Object.wait(Native Method)
> java.lang.Object.wait(Object.java:485)
> org.apache.activemq.MessageDispatchChannel.dequeue(MessageDispatchChannel.java:75)
> org.apache.activemq.ActiveMQMessageConsumer.dequeue(ActiveMQMessageConsumer.java:412)
> org.apache.activemq.ActiveMQMessageConsumer.receiveNoWait(ActiveMQMessageConsumer.java:560)
> com.xalert.server.queuing.SessionManager.getAlert(SessionManager.java:236)
>
>
> If I look at the broker (and I'm not really sure what to look at here), the
> thread for my queue that should be dispatching messages looks like this
> Name: QueueThread:queue://csPIQ
> State: WAITING on
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0a518
> Total blocked: 2,365  Total waited: 6,717
>
> Stack trace:
> sun.misc.Unsafe.park(Native Method)
> java.util.concurrent.locks.LockSupport.park(Unknown Source)
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown
> Source)
> java.util.concurrent.LinkedBlockingQueue.take(Unknown Source)
> java.util.concurrent.ThreadPoolExecutor.getTask(Unknown Source)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> java.lang.Thread.run(Unknown Source)
>
> The broker is configured with producerFlowControl="false", using TCP, a
> pre-fetch size of 0 and I've also set sendFailIfNoSpace="true".
>
> Any ideas on what my problem is or how/where I look in ActiveMQ to find the
> cause, or if the problem is with the consumer.
>
> TIA
> Ian
>
> --
> View this message in context: http://www.nabble.com/Q-Consumers-stop-receiving-messages-tp21438163p21438163.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com