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 @@ -292,16 +292,22 @@ do is to write your own CSV receiver::
292292
293293 class NewOrdersFromCsvFileReceiver implements ReceiverInterface
294294 {
295+ private $connection;
296+
295297 public function __construct(
296298 private SerializerInterface $serializer,
297299 private string $filePath,
298300 ) {
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 */;
299304 }
300305
301306 public function get(): iterable
302307 {
303308 // Receive the envelope according to your transport ($yourEnvelope here),
304309 // in most cases, using a connection is the easiest solution.
310+ $yourEnvelope = $this->connection->get();
305311 if (null === $yourEnvelope) {
306312 return [];
307313 }
@@ -327,7 +333,9 @@ do is to write your own CSV receiver::
327333 public function reject(Envelope $envelope): void
328334 {
329335 // 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);
331339 }
332340 }
333341
You can’t perform that action at this time.
0 commit comments