sroze / messenger-enqueue-transport

Uses Enqueue with Symfony's Messenger component.
MIT License
191 stars 55 forks source link

"enqueue.locator" service does not exists #42

Closed Umair-Qadeer closed 5 years ago

Umair-Qadeer commented 5 years ago

Hi there. I followed this code example.
https://stefanoalletti.wordpress.com/2018/11/05/from-rabbitmq-to-phpenqueue-via-symfony-messenger/

When I try to run "php bin/console messenger:consume mailer" command I got following error.

In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
The service "enqueue.messenger_transport.factory" has a dependency on a non-existent service "enqueue.locator".

I don't know why enqueue locator is missing. Can anyone help me with this issue?

Thanks.

makasim commented 5 years ago

Have you registered\configured Enqueue bundle?

Umair-Qadeer commented 5 years ago

Ahh, You are right. Thanks I am new to Symfony and these packages. Now I am stuck at configurations. :( Here is my enqueue.yaml config file code

config/packages/enqueue.yaml

enqueue: amqp: transport: 'amqp://guest:guest@localhost:5672' client: transport: ~ default_client: transport: ~

Now i am getting Following error:

[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
You have requested a non-existent parameter "enqueue.default_client".

What are these config variable for? Don't know what to do about this.

Thanks again.

weaverryan commented 5 years ago

Please let us know if it's still not working

dfoster-cb911 commented 5 years ago

@Umair-Qadeer mentioned he still had the issue of:

[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException] You have requested a non-existent parameter "enqueue.default_client".

This is actually something that I am dealing with right now on symfony 4.2 flex. Enqueue bundle and sqs packages are installed, it skips over setting the enqueue.default_client service if there is no $defaultClient set, which is also only set if there are $clientNames available to choose from.

In my process the client names variable is an empty array, so it never gets set.

How can I set these for sqs?

Umair-Qadeer commented 5 years ago

Hi @dfoster-cb911,

Try this. This works for me.

enqueue:
  default:
    transport: '%env(ENQUEUE_DSN)%'
    client: ~
dfoster-cb911 commented 5 years ago

Ok great, this has worked for me, @Umair-Qadeer . Thank you kindly.

Umair-Qadeer commented 5 years ago

No problem. I have posted this on another issue. you should have found that on google.