prolic / HumusAmqp

PHP 7.4 AMQP library
https://humusamqp.readthedocs.io/
MIT License
76 stars 17 forks source link

Customizable the delivery result when handling exception #49

Closed yethee closed 7 years ago

yethee commented 7 years ago

Hi!

Currently, the CallbackConsumer always sends nack with requeue flag, when catch an exception. But we use DLX in our app, and need to shutdown consumer and send nack without requeue flag when an exception was not suppressed in the callback.

Can we change so that handleException method returns the delivery result? Then we would have an extension point - the error callback.

prolic commented 7 years ago

Sounds reasonable, are you able to provide a PR? I found two usages: 1) AbstractConsumer.php:149 2) AbstractConsumer.php:258

prolic commented 7 years ago

@yethee can you take care of it?

yethee commented 7 years ago

Sorry for delay. I will try to create PR in the coming days.