@@ -80,7 +80,7 @@ public function pop($queue = null)
80
80
: $ this ->container ['config ' ]->get ('sqs-queue-reader.default-handler ' );
81
81
82
82
$ response = $ this ->modifyPayload ($ response ['Messages ' ], $ class );
83
- Log::debug ('New $response == ' , [$ response ]);
83
+ Log::debug ('New $responseV2 == ' , [$ response ]);
84
84
if (preg_match ('/(5\.[4-8]\..*)|(6\.[0-9]*\..*)|(7\.[0-9]*\..*)|(8\.[0-9]*\..*)/ ' , $ this ->container ->version ())) {
85
85
return new SqsJob ($ this ->container , $ this ->sqs , $ response , $ this ->connectionName , $ queue );
86
86
}
@@ -112,21 +112,28 @@ private function modifyPayload($payload, $class)
112
112
*/
113
113
114
114
$ body = [];
115
+ $ attributes = [];
115
116
foreach ($ payload as $ item ) {
116
117
//Log::debug('Each Messages==', [$item]);
117
118
$ body [] = json_decode ($ item ['Body ' ], true );
118
119
$ attributes = $ item ['Attributes ' ];
120
+ $ messageId = $ item ['MessageId ' ];
121
+ $ receiptHandle = $ item ['ReceiptHandle ' ];
119
122
}
120
123
121
124
$ body = [
122
125
'job ' => $ class . '@handle ' ,
123
126
'data ' => $ body ,
124
127
];
125
128
126
- $ newPayload ['Body ' ] = json_encode ($ body );
127
- $ newPayload ['Attributes ' ] = $ attributes ;
129
+ return [
130
+ 'MessageId ' => $ messageId ,
131
+ 'ReceiptHandle ' => $ receiptHandle ,
132
+ 'Body ' => json_encode ($ body ),
133
+ 'Attributes ' => $ attributes
134
+ ];
128
135
129
- return $ newPayload ;
136
+ // return $newPayload;
130
137
}
131
138
132
139
/**
0 commit comments