[openamq-dev] queue_bind, size and consume/cancel

Dmitri Tsyganov dmitri.tsyganov at dowjones.com
Wed Nov 7 23:08:58 CET 2007


Hello,

I have a publisher, which sends big volume of messages to OpenAMQ topic
queue with some routing key. It does it in a "fire-and-forget" fashion -
mandatory=0 and deliverable=0 - so it does not care if there is a client
or if client is slow.

Problem 1:

On consuming side, I have an application that declares a queue, creates
binding and starts consuming.

I have noticed that OpenAMQ topic queue starts accumulate messages right
after the binding was created, even there is no consumer - client didn't
call ..._consume yet. So what happens on high volume messages load, is
that queue size reaches the limit and gets killed by server, before
client starts consuming from it.

I thought that queue profile will help me
    <queue_profile name = "shared">
        <limit name = "warn" value = "50000" />
        <limit name = "trim" value = "100000" />
    </queue_profile>

but I noticed that my Queue still gets killed, even I set it to trim.
Does "trim" works for shared queues? Is there another way to postpone
consumption from the bound queue?

Problem 2:

When my client wants to stop consuming queue messages, it calls
amq_client_session_basic_cancel. I noticed that this call takes
significant amount of time on high volume queues. When it waits
on ...basic_cancel call, I still see messages going to it from OpenAMQ
server. 

I tried ..._nowait version of cancel and it helps my application, but I
am not sure if I play nice to amq server. 

Is there a proper and fast way to cancel consumption. I've looked at
amq_client_session_channel_flow... but I am not sure - or I should be
prepared to wait for several seconds on that call?

I can probably work around both problems, just wanted to see what the
experts think about it. 

Sincerely,

Dmitri


More information about the openamq-dev mailing list