You unserstood me correctly.
But suggested solution doesn't work.
What I did:

        pn_messenger_t* messenger = pn_messenger();
        pn_messenger_start(messenger);
        
        pn_messenger_subscribe(_pm.messenger, <someaddress>);
        pn_messenger_set _timeout(messenger, 1000);

        int _getcount = <messages_count_to_receive>;
        int _gotcount = 0;
        while (_gotcount < _getcount)
        {
                pn_messenger_recv(messenger, _getcount - _gotcount);
                //this line checks if nothing was received (maybe messages have 
ended)
                // Again, I get only 1 message. If I comment this line the
program enters
                // an infinite loop but my queue are full of messages.
                // IS IT CORRECT BEHAVIOUR?
                if (_gotcount == pn_messenger_incoming(messenger)) 
                        break;
                _gotcount = pn_messenger_incoming(messenger);
        }



--
View this message in context: 
http://qpid.2158936.n2.nabble.com/Receiving-messages-with-PROTON-messenger-tp7593934p7593949.html
Sent from the Apache Qpid Proton mailing list archive at Nabble.com.

Reply via email to