-
1. Re: ack messages individually
ataylor Jun 25, 2011 2:55 AM (in response to grgptch)is it possible to ack messages in a queue individually eventhough they are of same priority?
Im not really sure what you mean by this, however when a message is acked it acks that message plus evry message thats been consumed but not acked before it.
-
2. Re: ack messages individually
grgptch Jun 25, 2011 10:48 AM (in response to ataylor)basically i'd like to consume messages in some random order from teh queue. let's say i have 10 messages in the queue: 1, 2, 3, 4, ...., 10. i'd like to consume just messages 5 and 6 while the rest will still stay in the queue, so i can consume them some time later (again in some random order depending on the application's business logic).
-
3. Re: ack messages individually
clebert.suconic Jun 25, 2011 1:26 PM (in response to grgptch)In JMS terms, an ACK will ack all the previous messages.
We may introduce individual ACK options on the core-api. At this point this is not an option. You may add a JIRA with a feature request if you like.
-
4. Re: ack messages individually
grgptch Jun 25, 2011 7:14 PM (in response to clebert.suconic)Thanks Clebert, will do that.
-
5. Re: ack messages individually
timfox Jun 26, 2011 3:57 AM (in response to grgptch)george pitich wrote:
basically i'd like to consume messages in some random order from teh queue. let's say i have 10 messages in the queue: 1, 2, 3, 4, ...., 10. i'd like to consume just messages 5 and 6 while the rest will still stay in the queue, so i can consume them some time later (again in some random order depending on the application's business logic).
Seems like you want to use the message queueing system like a database.
-
6. Re: ack messages individually
ataylor Jun 26, 2011 6:03 AM (in response to timfox)Tim is rigt, if you dont want some sort of ordering then why use a queue, i would just write to a database.
-
7. Re: ack messages individually
grgptch Jun 26, 2011 11:19 AM (in response to ataylor)makes sense what you guys are saying. i was just exploring the above mentioned option in a queue scenario. requirement was to use the queue mechanism instead of distributed db which was first obvious mentioned solution.
i tried removing messages from the queue (http://community.jboss.org/thread/168298?tstart=0) in some random order and it worked (jmx) provided queue has never been read (consumed without acking). once you read the queue (consume with no acking, messages stay in the queue), "boolean removeMessage(long messageID)" always removes first message in the queue? i was expecting that as long as you provide correct message messageID, hornetq would remove it regardless of whether queue has been read or not (no ack).