protected function buildAdapter($queueType, $queueConnect, $databaseName)
    {
        preg_match('/(.+):(.+)@(.+)/', $queueConnect, $connect);
        if (count($connect) < 4) {
            return false;
        }
        list($full, $username, $password, $host) = $connect;
        unset($full);

        switch(strtolower($queueType)) {
            case 'mongo':
                if (!extension_loaded('mongo')) {
                    return false;
                }
                $connectString = 'mongodb://'.$username.':'.$password.'@'.$host.'/'.$databaseName;
                $adapter = new \MongoClient($connectString);
                break;
            case 'mysql':
                if (!extension_loaded('mysqli')) {
                    return false;
                }
                $adapter = new \mysqli($host, $username, $password, $databaseName);
                break;
        }

        return $adapter;
    }