You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jainmanglesh <ja...@rediffmail.com> on 2013/01/14 15:24:17 UTC

exception thrown on activemq server crash

Hi,

I am sending 5000 messages (in loop, all in separate session) to activemq. 
I have following entry in my activemq.xml file:
<policyEntry queue=">" producerFlowControl="false" memoryLimit="1mb" >
                  
                </policyEntry>

and I am sending messages using persistent delivery mode. 

My query is : I tried to stopped the activemq server during the sending
message. what kind of exception I would get. i could not see any exception
raised when I stopped the server instead the producer resumed sending
message when I re-started the activemq server. (I tried with delivery mode
as non_persistent as well).

I need to throw exception, if in case of server crash to notify producer
that something went wrong (so producer can notify service about this and
hence service can rollback the transaction).

I know if I use persistence delivery mode, I would not be loosing any
message and all message (in my case 5000 msgs) would be delivered to
queue(s)
what kind of setting I need to perform to make activemq server raising an
exception in case of server crash.





--
View this message in context: http://activemq.2283324.n4.nabble.com/exception-thrown-on-activemq-server-crash-tp4661708.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: exception thrown on activemq server crash

Posted by jainmanglesh <ja...@rediffmail.com>.
Thank you very much Tim for pointing this out. I didnt notice that I was
using activemq default url (which has failover appended with the localhost).
Now I can see exception when I stop the server during sending of messages.
Now I would be able to handle the transaction at the service side (by
throwing the exception back to service through producer.

Thanks for your quick reply



--
View this message in context: http://activemq.2283324.n4.nabble.com/exception-thrown-on-activemq-server-crash-tp4661708p4661710.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: exception thrown on activemq server crash

Posted by Timothy Bish <ta...@gmail.com>.
On Mon, 2013-01-14 at 06:24 -0800, jainmanglesh wrote: 
> Hi,
> 
> I am sending 5000 messages (in loop, all in separate session) to activemq. 
> I have following entry in my activemq.xml file:
> <policyEntry queue=">" producerFlowControl="false" memoryLimit="1mb" >
>                   
>                 </policyEntry>
> 
> and I am sending messages using persistent delivery mode. 
> 
> My query is : I tried to stopped the activemq server during the sending
> message. what kind of exception I would get. i could not see any exception
> raised when I stopped the server instead the producer resumed sending
> message when I re-started the activemq server. (I tried with delivery mode
> as non_persistent as well).
> 
> I need to throw exception, if in case of server crash to notify producer
> that something went wrong (so producer can notify service about this and
> hence service can rollback the transaction).
> 
> I know if I use persistence delivery mode, I would not be loosing any
> message and all message (in my case 5000 msgs) would be delivered to
> queue(s)
> what kind of setting I need to perform to make activemq server raising an
> exception in case of server crash.
> 

Sounds as though you are using the failover transport on your connection
URI.  This means the client will pause when the server goes down and
resume sending as soon as it returns.  You can remove 'failover:' from
your URI to stop allowing the connection to automatically reconnect. 

> 
> 
> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/exception-thrown-on-activemq-server-crash-tp4661708.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/