many thanks.In this mode, If I create a session and receive message1,message2 and message3 and I only acknowledge on message3, then if the client crashed. I will get message1 and message2 redeliveryed? if it's true, that's what I want. I only learned the standard acknowledge mode in the JMS spec
On Wed, Mar 5, 2014 at 5:08 PM, Noel OConnor <noel.ocon...@gmail.com> wrote: > have you seen ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE > > see > http://activemq.apache.org/maven/apidocs/org/apache/activemq/ActiveMQSession.html#INDIVIDUAL_ACKNOWLEDGE > > > On Wed, Mar 5, 2014 at 6:48 PM, Li Li <fancye...@gmail.com> wrote: > >> hi all, >> I want to process a batch of message using my own priority >> algorithm. But in JMS, I can't acknowledge a single message and can >> only acknowledge a session. So I decide to do it like this: >> 1. Create N(=10000) sessions >> 2. using a thread to manage session acknowledge like: >> for(int i=0;i<N;i++){ >> if session acknowledged{ >> receive A Message without waiting; >> put this message to my own priority queue; >> } >> } >> 3. using another thread to process my own queue; >> get a message from my own queue; >> process this message; >> get the session of this message; >> acknowledge this session; >> >> because a session will receive only a message a time and it >> will be blocked until this message is processed. I need create many >> sessions(maybe I can make session a pool) . I don't know whether >> activemq can deal with so much session. for a single consumer, I will >> create 10000 session. if I have ten consumers, then 100,000 session be >> created at the same time. >>