You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Fred Crable <fr...@hotmail.com> on 2007/10/17 16:47:07 UTC

How to get a message redelivered in CMS c++

Hi, I'm using activemq-cpp-2.1.  It is working great, thanks to all!  I have
a system that consumes messages and does network provisoning against network
devices which may be locked for a very long time.  I still need to perform
the work in the message, but I need to do it later after the lock is cleared
(usually because someone has requested to do work against the same device).

Questions are:

Is there a way to requeue the message for redelivery on the same queue?   I
see a rollback method and transactions, but they seem to be internal to the
ActiveMQ library and not on the cms available side.

If so, can I queue it up for delivery later either by priority (pushing it
down to lower priority) or by time (say 2 minutes later?)

If the answers to either of these are no, is the best alternative is to
requeue it to myself on a "slowly polled" queue that I get to later?  Is
there a slick way to just "move" messages if I have both a consumer &
provider opened?

Thanks, Fred
-- 
View this message in context: http://www.nabble.com/How-to-get-a-message-redelivered-in-CMS-c%2B%2B-tf4640926s2354.html#a13254835
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: How to get a message redelivered in CMS c++

Posted by Nathan Mittler <na...@gmail.com>.
>
> Okay, that is what I was afraid of :)  Its more like I can process all the
> messages, it's just one device the message is designated for is busy.  I
> can
> still process the other 100's of pending requests.   So, option #2 is not
> viable becuase I still need to service the messages I can work on.  So I'm
> thinking #1 is probably where I'd go and I'll either queue the internally
> &
> not ack them or put them on another queue back to myself to check on later
> via a synchronous poll.



Would it make sense to simply have a queue per device.  That way you could
control queue consumption on a per-device basis.  If you need something in
the middle to fan out the data into multiple queues, consider using Apache
Camel's content-based router (
http://activemq.apache.org/camel/content-based-router.html).

Thank you for the repsonse.  On the 3rd question though, is there a way to
> "Move" messages from one queue to another once I've dequeued via async
> (onMessage)?
>
>
>
I think the only way you could achieve something like this would be to
resend the message on another channel.

Nate

RE: How to get a message redelivered in CMS c++

Posted by Fred Crable <fr...@hotmail.com>.
Okay, that is what I was afraid of :)  Its more like I can process all the
messages, it's just one device the message is designated for is busy.  I can
still process the other 100's of pending requests.   So, option #2 is not
viable becuase I still need to service the messages I can work on.  So I'm
thinking #1 is probably where I'd go and I'll either queue the internally &
not ack them or put them on another queue back to myself to check on later
via a synchronous poll.

Thank you for the repsonse.  On the 3rd question though, is there a way to
"Move" messages from one queue to another once I've dequeued via async
(onMessage)?


Mittler, Nathan wrote:
> 
> It sounds to me like the solution needs to be at the application-level.
> Here's a few ideas that come to mind:
> 
> 1) Asynchronous delivery: you could queue them up until you're system is
> ready to process them.
> 
> 2) Asynchronous delivery: When you are in a state to process messages,
> you could register the message listener, thus starting the flow of
> message events.  When you are no longer able to process messages, remove
> the message listener - this will cause messages to internally queue up
> until you're ready to process them again.
> 
> 3) You could do synchronous polling of the queue when you are in a state
> to handle the messages
> 
> Regards,
> Nate
> 
>> -----Original Message-----
>> From: Fred Crable [mailto:fredcrable@hotmail.com] 
>> Sent: Wednesday, October 17, 2007 10:47 AM
>> To: users@activemq.apache.org
>> Subject: How to get a message redelivered in CMS c++
>> 
>> 
>> Hi, I'm using activemq-cpp-2.1.  It is working great, thanks 
>> to all!  I have a system that consumes messages and does 
>> network provisoning against network devices which may be 
>> locked for a very long time.  I still need to perform the 
>> work in the message, but I need to do it later after the lock 
>> is cleared (usually because someone has requested to do work 
>> against the same device).
>> 
>> Questions are:
>> 
>> Is there a way to requeue the message for redelivery on the 
>> same queue?   I
>> see a rollback method and transactions, but they seem to be 
>> internal to the ActiveMQ library and not on the cms available side.
>> 
>> If so, can I queue it up for delivery later either by 
>> priority (pushing it down to lower priority) or by time (say 
>> 2 minutes later?)
>> 
>> If the answers to either of these are no, is the best 
>> alternative is to requeue it to myself on a "slowly polled" 
>> queue that I get to later?  Is there a slick way to just 
>> "move" messages if I have both a consumer & provider opened?
>> 
>> Thanks, Fred
>> --
>> View this message in context: 
>> http://www.nabble.com/How-to-get-a-message-redelivered-in-CMS-
>> c%2B%2B-tf4640926s2354.html#a13254835
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-a-message-redelivered-in-CMS-c%2B%2B-tf4640926s2354.html#a13262513
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


RE: How to get a message redelivered in CMS c++

Posted by "Mittler, Nathan" <na...@sensis.com>.
It sounds to me like the solution needs to be at the application-level.
Here's a few ideas that come to mind:

1) Asynchronous delivery: you could queue them up until you're system is
ready to process them.

2) Asynchronous delivery: When you are in a state to process messages,
you could register the message listener, thus starting the flow of
message events.  When you are no longer able to process messages, remove
the message listener - this will cause messages to internally queue up
until you're ready to process them again.

3) You could do synchronous polling of the queue when you are in a state
to handle the messages

Regards,
Nate

> -----Original Message-----
> From: Fred Crable [mailto:fredcrable@hotmail.com] 
> Sent: Wednesday, October 17, 2007 10:47 AM
> To: users@activemq.apache.org
> Subject: How to get a message redelivered in CMS c++
> 
> 
> Hi, I'm using activemq-cpp-2.1.  It is working great, thanks 
> to all!  I have a system that consumes messages and does 
> network provisoning against network devices which may be 
> locked for a very long time.  I still need to perform the 
> work in the message, but I need to do it later after the lock 
> is cleared (usually because someone has requested to do work 
> against the same device).
> 
> Questions are:
> 
> Is there a way to requeue the message for redelivery on the 
> same queue?   I
> see a rollback method and transactions, but they seem to be 
> internal to the ActiveMQ library and not on the cms available side.
> 
> If so, can I queue it up for delivery later either by 
> priority (pushing it down to lower priority) or by time (say 
> 2 minutes later?)
> 
> If the answers to either of these are no, is the best 
> alternative is to requeue it to myself on a "slowly polled" 
> queue that I get to later?  Is there a slick way to just 
> "move" messages if I have both a consumer & provider opened?
> 
> Thanks, Fred
> --
> View this message in context: 
> http://www.nabble.com/How-to-get-a-message-redelivered-in-CMS-
> c%2B%2B-tf4640926s2354.html#a13254835
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> 
>