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::
302302 {
303303 private $serializer;
304304 private $filePath;
305+ private $connection;
305306
306307 public function __construct(SerializerInterface $serializer, string $filePath)
307308 {
308309 $this->serializer = $serializer;
309310 $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 */;
310315 }
311316
312317 public function get(): iterable
313318 {
314319 // Receive the envelope according to your transport ($yourEnvelope here),
315320 // in most cases, using a connection is the easiest solution.
321+ $yourEnvelope = $this->connection->get();
316322 if (null === $yourEnvelope) {
317323 return [];
318324 }
@@ -338,7 +344,9 @@ do is to write your own CSV receiver::
338344 public function reject(Envelope $envelope): void
339345 {
340346 // 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);
342350 }
343351 }
344352
You can’t perform that action at this time.
0 commit comments