File tree 1 file changed +9
-1
lines changed 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -292,16 +292,22 @@ do is to write your own CSV receiver::
292
292
293
293
class NewOrdersFromCsvFileReceiver implements ReceiverInterface
294
294
{
295
+ private $connection;
296
+
295
297
public function __construct(
296
298
private SerializerInterface $serializer,
297
299
private string $filePath,
298
300
) {
301
+ // Available connection bundled with the Messenger component
302
+ // can be found in "Symfony\Component\Messenger\Bridge\*\Transport\Connection".
303
+ $this->connection = /* create your connection */;
299
304
}
300
305
301
306
public function get(): iterable
302
307
{
303
308
// Receive the envelope according to your transport ($yourEnvelope here),
304
309
// in most cases, using a connection is the easiest solution.
310
+ $yourEnvelope = $this->connection->get();
305
311
if (null === $yourEnvelope) {
306
312
return [];
307
313
}
@@ -327,7 +333,9 @@ do is to write your own CSV receiver::
327
333
public function reject(Envelope $envelope): void
328
334
{
329
335
// In the case of a custom connection
330
- $this->connection->reject($this->findCustomStamp($envelope)->getId());
336
+ $id = /* get the message id thanks to information or stamps present in the envelope */;
337
+
338
+ $this->connection->reject($id);
331
339
}
332
340
}
333
341
You can’t perform that action at this time.
0 commit comments