/** * {@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()]); }
/** * {@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; } }
public function test_that_hash_value_returns_expected_value() { $this->assertSame($this->message->toString(), $this->message->hashValue()); }