protected function findNextMessages($types)
    {
        return $this->messageManager->findByAttempts(
            $this->types,
            MessageInterface::STATE_ERROR,
            $this->batchSize,
            $this->maxAttempts,
            $this->attemptDelay
        );
    }
protected function findNextMessages($types)
    {
        return $this->messageManager->findByAttempts(
            $this->types,
            MessageInterface::STATE_ERROR,
            $this->batchSize,
            $this->maxAttempts,
            $this->attemptDelay
        );
    }
protected function findNextMessages ( $ types ) { return $ this -> messageManager -> findByAttempts ( $ this -> types , MessageInterface :: STATE_ERROR , $ this -> batchSize , $ this -> maxAttempts , $ this -> attemptDelay ) ; }
Find messages in error.

@param $types

@return mixed
Find messages in error .