RabbitMQ C++ Client consumer_cancel_notify -
following guidelines here i'm able set "consumer_cancel_notify" property client connection, when queue deleted client still isn't noticing. i'm guessing have override method or set callback somewhere, after digging through source code i'm lost i'd this. offhand know i'd listen notification?
ok here's how got work:
- when creating queue (i.e. "declaring" queue), add callback "amqp_cancel" messages.
inside amqpqueue::sendconsumecommand(), inside while(1) loop code checks different *frame.payload.method.id*s, add check amqp_basic_cancel_method, e.g.
if (frame.payload.method.id == amqp_basic_cancel_method){ cout << "amqp_basic_cancel_method received" << endl; if ( events.find(amqp_cancel) != events.end() ) { (*events[amqp_cancel])(pmessage); } continue; }
that's it.
for purposes wanted redeclare queue if got deleted keep consuming messages, inside callback redeclared queue, set bindings, added events, set consumer tag, , consumed.
Comments
Post a Comment