File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -282,23 +282,38 @@ do is to write your own CSV receiver::
282282 $this->filePath = $filePath;
283283 }
284284
285- public function receive(callable $handler ): void
285+ public function get( ): void
286286 {
287287 $ordersFromCsv = $this->serializer->deserialize(file_get_contents($this->filePath), 'csv');
288288
289289 foreach ($ordersFromCsv as $orderFromCsv) {
290290 $order = new NewOrder($orderFromCsv['id'], $orderFromCsv['account_id'], $orderFromCsv['amount']);
291291
292- $handler(new Envelope($order));
292+ $envelope = new Envelope($order);
293+
294+ $handler($envelope);
293295 }
296+
297+ return [$envelope];
294298 }
295299
296- public function stop( ): void
300+ public function ack(Envelope $envelope ): void
297301 {
298- // noop
302+ // Add information about the handled message
303+ }
304+
305+ public function reject(Envelope $envelope): void
306+ {
307+ // Reject the message if needed
299308 }
300309 }
301310
311+ .. versionadded :: 4.3
312+
313+ In Symfony 4.3, the ``ReceiverInterface `` has changed its methods as shown
314+ in the example above. You may need to update your code if you used this
315+ interface in previous Symfony versions.
316+
302317Receiver and Sender on the same Bus
303318~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304319
You can’t perform that action at this time.
0 commit comments