[rabbitmq-discuss] Controlling rate of callbacks
Simon MacMullen
simon at rabbitmq.com
Tue Jun 15 12:47:03 BST 2010
Hi Andreas.
You could use queue polling; if you're only going to check every 15 min
then the slight loss in efficiency should not be a big deal. Overall I'd
say use basic.consume if you want to consume at a fixed rate but fairly
fast-ish, and basic.get if you want to consume very slowly or at fixed
times.
If you want to do this with basic.consume:
* Set basic.qos with a prefetch_count of 1 (so the server will only push
one unacked message to you at a time).
* basic.consume with no_acks turned off.
* Each time you consume, set up a timer to send the ack after 15 min or
whenever - don't just sleep in the consume callback as this will block
the connection.
Unfortunately I'm not very familiar with carrot so I can't give you
direct samples.
See the recent thread "chan.flow and vm_memory_high_watermark",
particularly here:
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2010-June/007528.html
and here:
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2010-June/007537.html
although the GC-related stuff shouldn't apply to you.
Cheers, Simon
On 08/06/10 09:47, Andreas Jung wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> We are using RabbitMQ + consumers implemented in Python on top of
> carrot and called through RabbitMQ as a callback.
> Is there some configuration option on a per-queue basis e.g. for
> controlling how or when consumers are called? For examples some queues
> must not be processed immediately but could be processed e.g. over night
> or every 15 minutes...
> Or is the recommended solution to implement arbitary logic on the
> application level and switching to queue polling?
>
> Andreas
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkwOA5IACgkQCJIWIbr9KYxNoACgmXT9WRYzmwdIL1jPbxOTB5E8
> oasAoLCTYBG+GVDFFI+Z8G5Y/krIKHwV
> =4784
> -----END PGP SIGNATURE-----
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list