Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function process(CommandMessage $message, callable $next)
 {
     $name = $message->payloadType()->toString();
     $this->logger->info(sprintf('Command received {%s}', $name), ['message' => $message->toString()]);
     $next($message);
     $this->logger->info(sprintf('Command handled {%s}', $name), ['message' => $message->toString()]);
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function process(CommandMessage $message, callable $next)
 {
     $command = ClassName::short($message->payloadType()->toString());
     try {
         $this->logger->debug(sprintf('Command (%s) received: %s', $command, date(DATE_ATOM)), ['message' => $message->toString()]);
         $next($message);
         $this->logger->debug(sprintf('Command (%s) handled: %s', $command, date(DATE_ATOM)), ['message' => $message->toString()]);
     } catch (Exception $exception) {
         $this->logger->error(sprintf('Command (%s) failed: %s', $command, date(DATE_ATOM)), ['message' => $message->toString(), 'exception' => $exception]);
         throw $exception;
     }
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function process(CommandMessage $message, callable $next)
 {
     /** @var Command $command */
     $command = $message->payload();
     $this->commandBus->execute($command);
 }
Beispiel #4
0
 /**
  * {@inheritdoc}
  */
 public function process(CommandMessage $message, callable $next)
 {
     $command = $message->payload();
     $handler = $this->resolver->resolve($command);
     $handler->handle($command);
 }
Beispiel #5
0
 /**
  * @expectedException \AssertionError
  */
 public function test_that_compare_to_throws_exception_for_invalid_argument()
 {
     $this->message->compareTo(null);
 }