[rabbitmq-discuss] QoS prefetch and rabbitmq-c

Paul Pearcy paul.pearcy at wallst.com
Thu Dec 16 22:10:31 GMT 2010


Hey,
  Don't see a direct way via rabbitmq-c to setup QoS prefetch count for a consumer. Searching the lists, I came across this thread, which seemed to have a sample for how to do this:
http://old.nabble.com/problem-with-new-persiter-with-1000-topics-queues-td29434516.html#a29476031

Is rolling your own QoS via amqp_simple_rpc the current recommended (only?) way to do this?

Thanks!
Paul

Here is the chunk of code I am referring to:
/* amqp.h should support this */
static int _amqp_basic_qos(amqp_connection_state_t state,
                                   amqp_channel_t channel,
                                   uint32_t prefetch_size,
                                   uint16_t prefetch_count,
                                   amqp_boolean_t global)
{
  amqp_rpc_reply_t rpc_reply =
    AMQP_SIMPLE_RPC(state, channel, BASIC, QOS, QOS_OK,
                    amqp_basic_qos_t, prefetch_size, prefetch_count, global);

  if (rpc_reply.reply_type != AMQP_RESPONSE_NORMAL)
      return -1;
  return 0;
}



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20101216/a99d4934/attachment-0001.htm>


More information about the rabbitmq-discuss mailing list