File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -302,17 +302,23 @@ do is to write your own CSV receiver::
302
302
{
303
303
private $serializer;
304
304
private $filePath;
305
+ private $connection;
305
306
306
307
public function __construct(SerializerInterface $serializer, string $filePath)
307
308
{
308
309
$this->serializer = $serializer;
309
310
$this->filePath = $filePath;
311
+
312
+ // Available connection bundled with the Messenger component
313
+ // can be found in "Symfony\Component\Messenger\Bridge\*\Transport\Connection".
314
+ $this->connection = /* create your connection */;
310
315
}
311
316
312
317
public function get(): iterable
313
318
{
314
319
// Receive the envelope according to your transport ($yourEnvelope here),
315
320
// in most cases, using a connection is the easiest solution.
321
+ $yourEnvelope = $this->connection->get();
316
322
if (null === $yourEnvelope) {
317
323
return [];
318
324
}
@@ -338,7 +344,9 @@ do is to write your own CSV receiver::
338
344
public function reject(Envelope $envelope): void
339
345
{
340
346
// In the case of a custom connection
341
- $this->connection->reject($this->findCustomStamp($envelope)->getId());
347
+ $id = /* get the message id thanks to information or stamps present in the envelope */;
348
+
349
+ $this->connection->reject($id);
342
350
}
343
351
}
344
352
You can’t perform that action at this time.
0 commit comments