On 25/07/12 09:03, Toralf Lund wrote:
On 23/07/12 16:33, Gordon Sim wrote:
On 07/23/2012 01:58 PM, Toralf Lund wrote:
On 23/07/12 10:42, Gordon Sim wrote:
On 07/23/2012 08:27 AM, Toralf Lund wrote:
Hi.

In my C++ messaging client, I'm reading data from a last-value queue via
a loop that's essentially as follows:

while(1) {
    try
       session.sync();
qpid::messaging::Receiver receiver=session.nextReceiver(timeout);

       message=receiver.fetch(qpid::messaging::Duration::IMMEDIATE);
       session.acknowledge();
messageType=message.getProperties()["message_type"].asString();
< handle the data... >

    } catch(const qpid::messaging::NoMessageAvailable &error) {
    }
}

[ ... ]



What capacity are you using on the receiver?
At the moment, just 1 - to make sure nextReceiver() will actually return
something... Perhaps this makes the message reception very inefficient?

It can certainly slow down the browser quite a lot.
I changed it to 1000, but it didn't really make a lot of difference.

I can extract messages only at a rate of about 25 messages a second, even when a lot of them are already queued, and the queue resides on the local host. The messages aren't that large, either - content size ranges from around 10 to 120 or so.

Maybe I'm doing this the wrong way...
The problem appears to be that I call qpid::Messaging::session::acknowledge() every time a new message has been received. If I just comment out this call, I can read all the 1288 messages that are currently sitting on my queue in something like 175 ms...

So, I suppose I still don't quite understand how the acknowledgement logic works. I mean, isn't it supposed to be possible to acknowledge messages as they are received? Maybe it's right to just leave out the call in any case, when browsing the messages via "mode: browse" in receiver arguments?


- Toralf


- Toralf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



This e-mail, including any attachments and response string, may contain proprietary information which is confidential and may be legally privileged. It is for the intended recipient only. If you are not the intended recipient or transmission error has misdirected this e-mail, please notify the author by return e-mail and delete this message and any attachment immediately. If you are not the intended recipient you must not use, disclose, distribute, forward, copy, print or rely on this e-mail in any way except as permitted by the author.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org



This e-mail, including any attachments and response string, may contain 
proprietary information which is confidential and may be legally privileged. It 
is for the intended recipient only. If you are not the intended recipient or 
transmission error has misdirected this e-mail, please notify the author by 
return e-mail and delete this message and any attachment immediately. If you 
are not the intended recipient you must not use, disclose, distribute, forward, 
copy, print or rely on this e-mail in any way except as permitted by the author.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to