You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Artur Siekielski <ar...@gmail.com> on 2008/08/21 14:52:46 UTC

LIFO (not FIFO) queues

Hi.
Is it possible to change JMS queues semantics to Last In, First Out (ie.
stack)? Would it be difficult to patch ActiveMQ sources to achieve this?

Another solution to our problem is using priority queues. But ActiveMQ
doesn't support priorities. Only Oracle's AQs support this...

A bigger picture: we are using JMS for grid computations, task have subtasks
and subtasks have to be computed first. It would be nice to have a general
solution for this using JMS.
-- 
View this message in context: http://www.nabble.com/LIFO-%28not-FIFO%29-queues-tp19088116p19088116.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: LIFO (not FIFO) queues

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
What about using Camel to implement a resequencer?

http://activemq.apache.org/camel/resequencer.html

Joe
http://www.ttmsolutions.com


Artur Siekielski wrote:
> 
> Hi.
> Is it possible to change JMS queues semantics to Last In, First Out (ie.
> stack)? Would it be difficult to patch ActiveMQ sources to achieve this?
> 
> Another solution to our problem is using priority queues. But ActiveMQ
> doesn't support priorities. Only Oracle's AQs support this...
> 
> A bigger picture: we are using JMS for grid computations, task have
> subtasks and subtasks have to be computed first. It would be nice to have
> a general solution for this using JMS.
> 

-- 
View this message in context: http://www.nabble.com/LIFO-%28not-FIFO%29-queues-tp19088116p19088336.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: LIFO (not FIFO) queues

Posted by Artur Siekielski <ar...@gmail.com>.

James.Strachan wrote:
> 
> 2008/8/25 Artur Siekielski <ar...@gmail.com>:
>>
>> From what I've understood the Camel Resequencer is not a solution for us,
>> because it collects items for some time (defined by timeout) and then
>> sends
>> them to output queue. We need a real priority queue where even old
>> messages
>> can be reordered.
> 
> How can you possibly implement any kind of queue reordering without
> waiting until you've more than one message to reorder them? :)
> 
> 

If your problem is "queue reordering", ie. sending sorted contents of one
queue to another, I don't see other solutions too. We would like to have
such a queue that when a consumer consumes a messages, it gets a message
with highest priority. So the difference is that Resequencer's output is a
queue, while the output of our potential priority queue is a consumer.
-- 
View this message in context: http://www.nabble.com/LIFO-%28not-FIFO%29-queues-tp19088116p19158762.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: LIFO (not FIFO) queues

Posted by James Strachan <ja...@gmail.com>.
2008/8/25 Artur Siekielski <ar...@gmail.com>:
>
> From what I've understood the Camel Resequencer is not a solution for us,
> because it collects items for some time (defined by timeout) and then sends
> them to output queue. We need a real priority queue where even old messages
> can be reordered.

How can you possibly implement any kind of queue reordering without
waiting until you've more than one message to reorder them? :)

The Camel resequencer implementation allows you to wait for a
specified amount of time - or a specified amount of messages then
reorder them. If you can come up with any other way or resequencing a
queue based on a priority rating that would work for your requirements
I'm all ears and I'm sure we could add to Camel - I just don't know
any other way we could implement it.

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

Open Source Integration
http://open.iona.com

Re: LIFO (not FIFO) queues

Posted by Artur Siekielski <ar...@gmail.com>.
>From what I've understood the Camel Resequencer is not a solution for us,
because it collects items for some time (defined by timeout) and then sends
them to output queue. We need a real priority queue where even old messages
can be reordered.
-- 
View this message in context: http://www.nabble.com/LIFO-%28not-FIFO%29-queues-tp19088116p19141241.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: LIFO (not FIFO) queues

Posted by Artur Siekielski <ar...@gmail.com>.
Hi, thanks for answer.
The first solution with selectors is too static for us - max. priority is
unknown. The second solution - using resequencer - should be tested by us
but I'm afraid of bad efficiency. How does it behave with millions of
messages in queues and hundreds of consumers/producers?


James.Strachan wrote:
> 
> I wrote a FAQ entry on implementing priority queues with ActiveMQ...
> http://activemq.apache.org/how-can-i-support-priority-queues.html
> 
> 

-- 
View this message in context: http://www.nabble.com/LIFO-%28not-FIFO%29-queues-tp19088116p19090578.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: LIFO (not FIFO) queues

Posted by James Strachan <ja...@gmail.com>.
I wrote a FAQ entry on implementing priority queues with ActiveMQ...
http://activemq.apache.org/how-can-i-support-priority-queues.html

2008/8/21 Artur Siekielski <ar...@gmail.com>:
>
> Hi.
> Is it possible to change JMS queues semantics to Last In, First Out (ie.
> stack)? Would it be difficult to patch ActiveMQ sources to achieve this?
>
> Another solution to our problem is using priority queues. But ActiveMQ
> doesn't support priorities. Only Oracle's AQs support this...
>
> A bigger picture: we are using JMS for grid computations, task have subtasks
> and subtasks have to be computed first. It would be nice to have a general
> solution for this using JMS.
> --
> View this message in context: http://www.nabble.com/LIFO-%28not-FIFO%29-queues-tp19088116p19088116.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



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

Open Source Integration
http://open.iona.com

Re: LIFO (not FIFO) queues

Posted by Rob Davies <ra...@gmail.com>.
On 21 Aug 2008, at 13:52, Artur Siekielski wrote:

>
> Hi.
> Is it possible to change JMS queues semantics to Last In, First Out  
> (ie.
> stack)? Would it be difficult to patch ActiveMQ sources to achieve  
> this?
>
> Another solution to our problem is using priority queues. But ActiveMQ
> doesn't support priorities. Only Oracle's AQs support this...
>
> A bigger picture: we are using JMS for grid computations, task have  
> subtasks
> and subtasks have to be computed first. It would be nice to have a  
> general
> solution for this using JMS.
> -- 
> View this message in context: http://www.nabble.com/LIFO-%28not-FIFO%29-queues-tp19088116p19088116.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Nice idea! Priorities for messages on Queues are really hard to  
implement - but a potential option would be to have different priority  
Queues - that level of granularity is a lot easier - I'll investigate  
it.

The LIFO  does seem a little wacky  though.



cheers,

Rob

Rob Davies
http://rajdavies.blogspot.com/