activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Clients not receiving ResourceAllocationException in transacted sessions
Date Thu, 29 Aug 2013 10:23:43 GMT
On 08/29/2013 05:54 AM, jvbrandis wrote:
> Good suggestion!! :)
> Yes, an ExceptionListener on the Connection does get the exception when ResourceAllocationException
is thrown.
>
> Of course, I could hack my way around it, notifying the client from the connection when
the connection receives the error, but that seems backwards to me…. the error is sent in
another thread, so I have no guarantee that the client is notified in time to avoid committing
after an error occurs.
>
> (and honestly, returning from commit() without errors when all my messages have been
discarded seems to be a strange transactional contract…. even if error notification is sent
in another channel)
>
> I could not find an existing issue that describes this problem, so I'm going to post
a bug report of the problem.
What's happening is that inside a transaction the normal behavior is to 
send messages without waiting for a response from the broker (async) 
which is why the only way the exception gets noticed is by an exception 
listener.  You can however configure this to work by using the option 
'setUseAsyncSend' on the ActiveMQConnectionFactory to force all send to 
wait for a response which will then cause the exception to be thrown 
from the producer send.

You can set this on the connection URI via: "tcp:xxx:x?useAsyncSend=false"

> On 28. Aug2013, at 22:26, "ceposta [via ActiveMQ]" <ml-node+s2283324n4670864h54@n4.nabble.com>
wrote:
>
>> Maybe set an exception listener on the connection and see if you get it
>> there?
>>
>> http://activemq.apache.org/maven/apidocs/org/apache/activemq/ActiveMQConnection.html#setExceptionListener(javax.jms.ExceptionListener)
>>
>>
>> On Wed, Aug 28, 2013 at 12:38 PM, [hidden email] <[hidden email]>wrote:
>>
>>> Hi all.
>>>
>>> I am fairly new to ActiveMQ, having used SwiftMQ for a long time.
>>> However, I am stuck with a problem which I think may be a bug, unless I
>>> have
>>> seriously misread some documentation... so any suggestions are welcome!
>>>
>>> Short environment description:
>>> Producers are sending messages to a topic, and a set of Durable Consumers
>>> are subscribing to these messages. Both Producer and Consumer sessions are
>>> transacted, and messages are persistent.
>>> When a Consumer falls behind, or becomes offline, the producer should STOP
>>> (when configured resource limits have been reached).
>>>
>>> To configure this in ActiveMQ, I have configured systemUsage
>>> sendFailIfNoSpace=true:
>>>
>>>
>>>
>>> However, when the storeUsage has been reached, ActiveMQ log tells me that
>>> the store is full, and the producer is being stopped, but the client does
>>> not get any hint of this!
>>>
>>>  From ActiveMQ log:
>>> javax.jms.ResourceAllocationException: Persistent store is Full, 100% of
>>> 209715200. Stopping producer (ID:Calvin.local-52167-1377716876253-5:1:1:1)
>>> to prevent flooding topic://nidstopic. See
>>> http://activemq.apache.org/producer-flow-control.html for more info
>>>
>>> However, the client just keeps sending messages, which are being discarded.
>>> I have debugged the client code into ActiveMQ classes, and the client is
>>> happily both sending the message, and commiting the transaction, without
>>> any
>>> exception being thrown.
>>>
>>> Changing to non-transacted session causes the producer to receive
>>> ResourceAllocationException when the store is full.
>>>
>>> I am running ActiveMQ 5.8.0 on Java 1.7 on Linux.
>>> I have tried both with LevelDB and KahaDB, just in case.
>>>
>>> Any suggestions?
>>>
>>>
>>>
>>> -- 
>>> View this message in context:
>>> http://activemq.2283324.n4.nabble.com/Clients-not-receiving-ResourceAllocationException-in-transacted-sessions-tp4670862.html
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>
>>
>> -- 
>> *Christian Posta*
>> http://www.christianposta.com/blog
>> twitter: @christianposta
>> http://www.christianposta.com/blog
>>
>>
>> If you reply to this email, your message will be added to the discussion below:
>> http://activemq.2283324.n4.nabble.com/Clients-not-receiving-ResourceAllocationException-in-transacted-sessions-tp4670862p4670864.html
>> To unsubscribe from Clients not receiving ResourceAllocationException in transacted
sessions, click here.
>> NAML
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Clients-not-receiving-ResourceAllocationException-in-transacted-sessions-tp4670862p4670895.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Mime
View raw message