|
8 | 8 | use Illuminate\Queue\Jobs\SqsJob; |
9 | 9 | use Illuminate\Queue\SqsQueue; |
10 | 10 | use Illuminate\Support\Facades\Config; |
11 | | -use Illuminate\Support\Facades\Log; |
12 | 11 | use Illuminate\Support\Str; |
13 | 12 | use JsonException; |
14 | 13 | use palPalani\SqsQueueReader\Jobs\DispatcherJob; |
@@ -148,22 +147,22 @@ private function modifyMultiplePayload(array | string $payload, string $class): |
148 | 147 |
|
149 | 148 | foreach ($payload as $k => $item) { |
150 | 149 | try { |
151 | | - $body[$k] = [ |
152 | | - 'messages' => \json_decode($item['Body'], true, 512, JSON_THROW_ON_ERROR), |
153 | | - 'attributes' => $item['Attributes'], |
154 | | - 'batchIds' => [ |
155 | | - 'Id' => $item['MessageId'], |
156 | | - 'ReceiptHandle' => $item['ReceiptHandle'], |
157 | | - ], |
158 | | - ]; |
159 | | - $attributes = $item['Attributes']; |
160 | | - $messageId = $item['MessageId']; |
161 | | - $receiptHandle = $item['ReceiptHandle']; |
| 150 | + $message = \json_decode($item['Body'], true, 512, JSON_THROW_ON_ERROR); |
162 | 151 | } catch (JsonException $e) { |
163 | | - Log::warning('Invalid payload!', [$item]); |
164 | | - |
165 | | - continue; |
| 152 | + $message = []; |
166 | 153 | } |
| 154 | + |
| 155 | + $body[$k] = [ |
| 156 | + 'messages' => $message, |
| 157 | + 'attributes' => $item['Attributes'], |
| 158 | + 'batchIds' => [ |
| 159 | + 'Id' => $item['MessageId'], |
| 160 | + 'ReceiptHandle' => $item['ReceiptHandle'], |
| 161 | + ], |
| 162 | + ]; |
| 163 | + $attributes = $item['Attributes']; |
| 164 | + $messageId = $item['MessageId']; |
| 165 | + $receiptHandle = $item['ReceiptHandle']; |
167 | 166 | } |
168 | 167 |
|
169 | 168 | return [ |
|
0 commit comments