/**
  * Check if the validate Request Information method does accept RequestInformation
  * @throws ValidationException
  */
 public function testValidateHttpRequestInformationMethodDoesExceptRequestInformation()
 {
     MessageValidator::validateHttpRequestInformation(new RequestInformation());
 }
Ejemplo n.º 2
0
 /**
  * Sends message if it's valid. Return false on failure
  * 
  * @param MessageInterface $message
  * 
  * @return bool
  */
 protected function sendMessage(MessageInterface $message)
 {
     try {
         MessageValidator::validate($message);
         $this->queue->sendmulti([$this->application . '-' . $this->environment, 'logs.' . $this->application . '.' . $this->environment, json_encode($message)]);
         $sent = true;
     } catch (ZMQSocketException $exception) {
         // we cannot connect, make sure application does not exit
         $this->addDispatchException($exception);
         $sent = false;
     } catch (LogjamDispatcherException $e) {
         $this->addDispatchException($e);
         $sent = false;
     }
     return $sent;
 }