-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BulkConsumer doesn't produce errors #63
Comments
Well, it will definitivly swallow the exception, but how you imagine this will work? If exception is thrown, and 2 messages did pass and third have exception and $ waiting, should we send 2 acks and then nacks with exceptions? |
I reached similar problem, although first I tried to ask nicely and sent out IConsumer::MESSAGE_REJECT_AND_TERMINATE in the array or responses and when that didn't work, I tried resorting to throwing an exception. In my case, database was temporarily too busy and EntityManager closed. Considering messages that already passed, the code should never resort to throwing an exception, it should handle them and pass one of the status codes. |
Well, problem with _AND_TERMINATE is, it is handled after all messages are completed... Right now,i belive the proper behavior is, you throw exceptions when BulkConsumer try to process data, on every message that have error, bulkConsumer should send NACK, and if one of messages is _AND_TERMINATE, it should kill itself after sending response. EntityManager can be reopen, and you can even tell Container to flush instance and create new one, you can do so via removeService() method of container. Right now, I do not contribute to this package anymore, made myself a fork (bckp/rabbitmq) and implemented some ideas I have in mind, now im in process of complete rewriting code, to bring plugins into play, so you can create BulkConsumer, DlxConsumer etc by yourself :) but there is NO ETA, simply when it will be ready, it will be ready :D |
But quick look into code, you are indeed right, BulkConsumer does ignore AND_TERMINATE completly... I will think about that |
I have suspicious about BulkConsumer which silently skips throwable errors. I quickly looked into the code and there is the try-catch block in the BulkConsumer.php which probably cause this.
I would prefer to remove this block and let control returning values by man.
rabbitmq/src/Consumer/BulkConsumer.php
Line 104 in 96a55a9
The text was updated successfully, but these errors were encountered: