Closed noniagriconomie closed 6 years ago
Hi
According to your configuration, processors will be called in this order:
In your case, you received message number 19. Your processor did the job, the max messages processor have been called but your still under the limit you defined. Then the ack processor did it's job. Then, you received message number 20. Your processor did the job. The max processor have been called and as you've reached you limit it did it's job (log + prevent other message). Then ack processor have been called and ack'ed the message.
I would recommend you to use this order:
This way:
hi @odolbeau,
first thank for you explanations and your time.
Just a point I am not sure to understand properly on the stack processor.
According to your configuration, processors will be called in this order: signal_handler exception_catcher ack max_messages your processor max_messages ack exception_catcher signal _handler
This means that for every message consumption, we ack 2 times (before and after our internal processor) ? we catch any ex before and after our internal processor?
I though it is just a "one pass" processor stack I am a little bit confused right now
When using a stack, your processor is decorated by others processors.
If you use only the ack processor:
Take a look a the implementation: https://github.com/swarrot/swarrot/blob/master/src/Swarrot/Processor/Ack/AckProcessor.php#L47-L63
This way, all processors can do some job before and / or after calling the next processor.
Not sure my explanations are really clear. :/ Does it makes sense?
@odolbeau thank you again for your time
what i mean is, seeing your comment (cf my previous post) i understood that the processors stack defined is call before and after our processor
that is why i asked for "clarification" after your comment, because seeing the code and the picture on the readme of the lib (https://camo.githubusercontent.com/8ac89cd415aebfb1026b2278093dbcc986b126da/68747470733a2f2f646f63732e676f6f676c652e636f6d2f64726177696e67732f642f3145615f514a486f2d3970375957386c5f62793753344e494430652d41477058527a7a6974416c59593543632f7075623f773d39363026683d373230) seems weird
Thanks
This means that for every message consumption, we ack 2 times (before and after our internal processor) ? we catch any ex before and after our internal processor?
no, we don't ack twice. We run the AckProcessor logic in a specific place of the stack. But the AckProcessor is not acking the message both before and after calling the inner processing (actually, the AckProcessor does nothing before calling the inner processing, but it is still reached in the stack)
@stof ok understood Thank you both
Hi
According to https://github.com/swarrot/swarrot#using-a-stack, the order of the stacked processors is important.
Given this config: (v1.5.1)
What is the best order? from top (last processor executed) to bottom (first executed after our processor) I ask this question because checking my logs today, I've seen this:
and the logic would be:
Is there a good practice for this kind of stack? (exception, handling signal, max execution and ack of course)
Thank you for your time