On 01/07/2010 08:48 AM, denny86 wrote:

Hi,

I stumbled upon following error while listening to messages

Listening for messages [Press Ctrl+C to Quit]...2010-jan-07 13:45:13 error
FAIL
[2737 192.168.99.44:5672]: bad allocation (.\qpid\client\Connector.cpp:396)
2010-jan-07 13:45:13 warning Connection closed
Connection closed

Sounds like your client process is running out of memory(?). This is using the 0.5 code, right?

  I'm using Qpid C++ Broker and C++ client running on win32 platform.

  I have a subscription manager subscribing to three subjects and with
following settings:

             SubscriptionSettings settings;
             settings.exclusive=false;
             settings.acceptMode = ACCEPT_MODE_EXPLICIT;
             settings.acquireMode = ACQUIRE_MODE_NOT_ACQUIRED;
             settings.autoAck=0;

Well i'm not using any local queues. Just working on topic_listener example.
In which i am processing messages at Listener::received() function. There i
wud check for each messages' destination routing key and then process the
message as accordingly.

After that, i would acknowledges those messages with session.messageAccept.
There lies the problem

ie, On each message arrival, i would do this
seqNSEMsgAck.add(message.getId());  [Declarations: SequenceSet  seqNSEMsgAck
and Message message ]

  Then when i tried to perform accept, i receive this error after some
successfully retrieval plus accepting prior messages.

            session.messageAcquire(seqMsgAck);
            session.messageAccept(seqMsgAck);
                    session.sendCompletion();
            session.sync();

Try changing this to use the acquire() and accept() messages on the Subscription class (you get an instance of this returned when you call subscribe() on SubscriptionManager. The subscription tracks all unaquired and unaccepted messages and if you are directly invoking the methods on the session as above it will not update those sets to reflect successfully acquired and accepted ids. In other words the sets held in the subscription will continue to grow - in your case the unacquired set.

This is probably something that we should address in the code somehow, e.g. having a flag in subscription settings that indicates the subscription should not try to do any tracking.

If that doesn't help perhaps running with valgrind might help determine if there are any leaks. Is there anything in your application that might be continually growing as messages arrive?

When i get this error, queuestats program [from qmf console example] reports
increase in queue depth. Otherwise it would show max queue depth of 1 only,
after enqueue and dequeue.

Also i tired to accept after listening to 1000 messages. But still same
result. But here i noted that this error will occur after a very long time.

Am I missing out anything?

Please reply...

I am getting used to Qpid. Hope some wud help, thanks :handshake:




---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscr...@qpid.apache.org

Reply via email to