Mixing queued commands with immediate commands
shadowhand opened this issue · 7 comments
From what I can tell, this package assumes that every command that goes into Tactician should be queued. This cannot work for us, as only some of our commands can be queued and the others must be executed immediately.
For instance, tactician-bernard provides a middleware that only sends Bernard\Message instances to the queue. If enqueue did this, it would be be suitable for our use case.
@shadowhand The extension was heavily reworked and now it contains what you need. Could you please take a look at #2.
Will be released as 0.2.0
From what I can tell, this is still missing a critical piece:
If the command has been queued, it should not be processed by the producing handler.
@shadowhand It shouldn't. Isn't this line is exactly for that purpose https://github.com/php-enqueue/tactician-queue-interop/blob/master/src/QueueMiddleware.php#L50?
- QueueMessage - Indicates that the message must be queued to a MQ broker.
- QueuedMessage - Indicates that the message has been sent to a MQ broker.
- ReceivedMessage - Indicates that the message is received from a MQ broker.
$next(new QueuedMessage($command));Will continue processing the message. If the goal is to abort processing, it should just return;
Got it. That's easy to fix.