activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Producer Acknowledge in NMS ?
Date Wed, 27 May 2009 15:17:05 GMT
On Wed, 2009-05-27 at 08:06 -0700, mvhoof wrote:
> 
> 
> Timothy Bish wrote:
> > 
> > On Wed, 2009-05-27 at 03:20 -0700, mvhoof wrote:
> >> Hi,
> >> 
> >> I have a requirement to built a message queue Consumer/producer which
> >> works
> >> on flaky connections. Now this consumer/producer could be rebooted at all
> >> times (we have no control over this). So my challenge is this:
> >> 
> >> 
> >> Simply sending the Message using a MessageProducer, i know when a message
> >> is
> >> actually sent, however, this could block the application if the
> >> connection
> >> is down AND, if the machine is rebooted, i could loose the messages .
> >> 
> >> Using RequestTimeOut, i could bypass the locking issue, however.. how can
> >> i
> >> find out if a message has been sent or not ? I've read just about
> >> everything
> >> i could find on ActiveMQ and NMS but this does not show up anywhere ? For
> >> building a trusty system, i really need to know if the message has been
> >> sent
> >> and if not, i can cache it locally until connection is restored.
> >> 
> >> Secondly, is there any way to monitor the connection with the broker
> >> using
> >> NMS (we are using the failover protocol) so i can retry sending the
> >> chached
> >> messages as soon as connection is up again ?
> >> 
> >> Many thanks in advance !
> > 
> > If you are disabling the blocking sends then there really isn't a way to
> > check that its been sent.  The blocking send is waiting for
> > acknowledgment from the broker that it received the message if you use
> > async sends or use the request timeout option then you give up the
> > reliability built into the send mechanism.
> > 
> > Regards
> > Tim.
> > 
> > 
> > -- 
> > Tim Bish
> > http://fusesource.com
> > http://timbish.blogspot.com/
> > 
> > 
> > 
> > 
> > 
> Hmm.. ok.. thanks for the answer. 
> 
> So i can only try to mimic this by controlling the connection myself instead
> of using the failover protocol and then try to send the message only if a
> connection can be made right ?

When you send a message when using the Failover transport the Message
will be sent if the client is currently disconnected and later
reconnects or if the connection is lost mid send.  If the blocking
nature of the send call is unacceptable then you could of course
relegate your sends to a separate thread.  Depends on the problem you
are trying to solve.

Regards
Tim.


-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message