How to configure messages to be re-sent in case Queue size limit Exceeded

31 views
Skip to first unread message

Arun Sathayanarayanan

unread,
Jan 3, 2024, 5:46:51 AM1/3/24
to rabbitmq-c-users
Hi Everyone,
I want to design a retry mechanism in case of the messages are undelivered  because  of queue already holding a x-max-length-bytes of contents.

When i go thru literature, i understand that we can set the mandatory field in amqp_basic_publish method and broker would respond with amqp_basic_return_t frame to indicate the reply code set to 311 content-too-large . Reference
(https://www.rabbitmq.com/amqp-0-9-1-reference.html#domain.reply-code)

The psuedo code would look like below at the client side

//sending the message to the broker
amqp_basic_publish(conn,chan,exchange,route_key,1,0, prop,body);

//wait for frame to ensure there is no ExceedResource indicators
amqp_simple_wait_frame(conn,&frame)


if( frqme.tye is AMQP_FRAME_METHOD and  method id is AMQP_BASIC_RETURN_METHOD and reply_code is 311)
   resend the frame

My Question
In case broker delivers the message to the queues successfully, will client be intimated with a success. Can we do this without enabling  publish confirm.  
 
Using amqp_simple_wait_frame in publisher side throttles it, and will have impacts in terms of performance. Are there any alternatives to this strategy.

Thanks in Advance 
Regards 

Arun Sathyanarayanan
Reply all
Reply to author
Forward
0 new messages