@@ -154,13 +154,14 @@ private function batchConsume()
154
154
)
155
155
));
156
156
} catch (Exception \StopConsumerException $ e ) {
157
- $ this ->logger ->info ('Consumer requested restart ' , array (
157
+ $ this ->logger ->info ('Consumer requested stop ' , array (
158
158
'amqp ' => array (
159
159
'queue ' => $ this ->queueOptions ['name ' ],
160
160
'message ' => $ this ->messages ,
161
161
'stacktrace ' => $ e ->getTraceAsString ()
162
162
)
163
163
));
164
+ $ this ->handleProcessMessages ($ e ->getHandleCode ());
164
165
$ this ->resetBatch ();
165
166
$ this ->stopConsuming ();
166
167
} catch (\Exception $ e ) {
@@ -213,12 +214,14 @@ private function handleProcessFlag($deliveryTag, $processFlag)
213
214
if ($ processFlag === ConsumerInterface::MSG_REJECT_REQUEUE || false === $ processFlag ) {
214
215
// Reject and requeue message to RabbitMQ
215
216
$ this ->getMessageChannel ($ deliveryTag )->basic_reject ($ deliveryTag , true );
216
- } else if ($ processFlag === ConsumerInterface::MSG_SINGLE_NACK_REQUEUE ) {
217
+ } elseif ($ processFlag === ConsumerInterface::MSG_SINGLE_NACK_REQUEUE ) {
217
218
// NACK and requeue message to RabbitMQ
218
219
$ this ->getMessageChannel ($ deliveryTag )->basic_nack ($ deliveryTag , false , true );
219
- } else if ($ processFlag === ConsumerInterface::MSG_REJECT ) {
220
+ } elseif ($ processFlag === ConsumerInterface::MSG_REJECT ) {
220
221
// Reject and drop
221
222
$ this ->getMessageChannel ($ deliveryTag )->basic_reject ($ deliveryTag , false );
223
+ } elseif ($ processFlag == ConsumerInterface::MSG_ACK_SENT ) {
224
+ // do nothing, ACK should be already sent
222
225
} else {
223
226
// Remove message from queue only if callback return not false
224
227
$ this ->getMessageChannel ($ deliveryTag )->basic_ack ($ deliveryTag );
0 commit comments