Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue: Add missing code to make it work outside of laravel #4401

Closed
wants to merge 1 commit into from
Closed

Queue: Add missing code to make it work outside of laravel #4401

wants to merge 1 commit into from

Conversation

Flynsarmy
Copy link
Contributor

The current readme presents the following error when using an iron queue with Illuminate/queue outside of Laravel

Fatal error: Uncaught exception 'ReflectionException' with message 'Class encrypter does not exist' in /vendor/illuminate/container/Illuminate/Container/Container.php on line 485

The attached commit fixes this.

@JosephSilber
Copy link
Member

Are you using the Iron queue?

I think that's the only one that uses the encrypter (though I'm not sure).

If so, that should be added to the readme.

@Flynsarmy
Copy link
Contributor Author

I haven't tested it but wouldn't SQS and any other external queue services need Request aswell? Figured they'd also encrypt their tasks.

@JosephSilber
Copy link
Member

I don't think the SQS driver uses encrypter. Read the code yourself.

@Flynsarmy
Copy link
Contributor Author

Why was this closed without a merge? It's clearly required for iron queues outside of laravel. You just get an error if you don't add it in...

@mnori
Copy link

mnori commented Sep 11, 2014

This issue also occurs when you want to use a Beanstalk queue. I got around it by using:

$this->queue->getContainer()->bind('encrypter', function() {
    return new \Illuminate\Encryption\Encrypter('clowdy');
});

Which is described here:
https://www.flynsarmy.com/2014/05/using-illuminatequeue-outside-laravel/

@Flynsarmy
Copy link
Contributor Author

Yea, it was pretty ridiculous that Taylor closed this without merging. Probably saw Joseph's entirely unhelpful and irrelevant messages and assumed nothing needed to be done.

@taylorotwell
Copy link
Member

Do I need to revisit?

On Sep 11, 2014, at 5:11 PM, Flynsarmy notifications@github.com wrote:

Yea, it was pretty ridiculous that Taylor closed this without merging. Probably saw Joseph's entirely unhelpful and irrelevant messages and assumed nothing needed to be done.


Reply to this email directly or view it on GitHub.

@Flynsarmy
Copy link
Contributor Author

That would be great. If you attempt to use certain drivers with Illuminate/Queue outside of laravel you just get an error message with nothing in the readme on how to fix it.

The lines in my PR are required for Iron queues to work. I've only tested Iron.io but I guess they'd be required for any queue service not on localhost to work.

@crynobone
Copy link
Member

The lines in my PR are required for Iron queues to work. I've only tested Iron.io but I'm fairly sure they'd be required for any queue service not on localhost to work.

https://github.com/laravel/framework/blob/4.2/src/Illuminate/Queue/QueueServiceProvider.php#L241 only Iron.io requires it.

But wait, https://github.com/laravel/framework/blob/4.2/src/Illuminate/Queue/QueueManager.php#L95 sneak in the "encryptor" on all queue connection.

@Flynsarmy
Copy link
Contributor Author

In any case, if a line is required for it to work it should be in the readme. Hence the PR

@taylorotwell
Copy link
Member

I think Request is just used by Iron for marshalling push queue request. So we can probably indicate that caveat in the readme.

@johnnye
Copy link

johnnye commented Oct 17, 2014

@taylorotwell it would be good to include this in the documentation. I'm running into problems with the encrypter not being present (easily solved), but it seems to be an issue if you're just using Capsule queue and an encrypter doesn't exist already. I would however use a bindIf(). Do I need to do another PR with a bit more detail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants