qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joakim Sernbrant <Joakim.Sernbr...@trioptima.com>
Subject Unacknowledged messages locking up the journal?
Date Tue, 24 Apr 2012 12:10:34 GMT
Qpid 0.12

Scenario:

Fill a queue with durable messages
Receive one message but defer acknowledge of it
Drain the queue of the remaining messages

Sending a message on the queue will now generate an "Enqueue capacity threshold exceeded on
queue" error. The queue now contains one message but the journal is full it seems.

Is this "working as expected"?
Is there a way to set a timeout on how long a message can go unacknowledged?
Is there a way to monitor journal free space?

See example blow for how to reproduce.

Regards,

Joakim

import qpid.messaging

addr = 'ack-test; { create: always, node: {type: queue, durable: True, x-declare: {arguments:
{"qpid.file_count": 4, "qpid.file_size": 1}}}}'

def fill():
    conn = qpid.messaging.Connection('localhost')
    conn.open()
    ssn = conn.session()
    snd = ssn.sender(addr)
    n = 0
    while True:
        try:
            msg = qpid.messaging.Message(durable=True, content='foo')
            snd.send(msg)
            #print "fill:", msg
            n += 1
        except qpid.messaging.exceptions.ConnectionError, e:
            print e
            break
    print "sent %d messages"% n

def drain(count=None, ack=True):
    conn = qpid.messaging.Connection('localhost')
    conn.open()
    ssn = conn.session()
    rcv = ssn.receiver(addr)
    while count == None or count > 0:
        try:
            msg = rcv.fetch(timeout=0)
            if ack:
                ssn.acknowledge()
            if count != None:
                count -= 1
        except qpid.messaging.Empty:
            break

if __name__=="__main__":
    drain() # start with an empty queue
    fill()
    drain(count=1, ack=False)
    drain()
    fill() # will not be able to send any message


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message