Skip to content

[Symfony] Try to check private service existence from container #621

Closed
@Gnucki

Description

@Gnucki

I was trying to migrate a bundle to enqueue 0.9 (from 0.8) in order to use symfony 4.2 messaging component instead of 4.1.

I did not changed my enqueue config:

enqueue:
    async_events:
        enabled: false
    transport:
        default: rabbitmq_amqp
        rabbitmq_amqp:
            dsn: '%env(BROKER_DSN)%'
    client: ~

But got this strange exception:

RuntimeException: Can't find Enqueue's transport named "default": Service "enqueue.transport.default.context" is not found.

Then, I tried to trace the exception. It is coming from messenger-adapter:

if (!$this->container->has($contextService = 'enqueue.transport.'.$enqueueContextName.'.context')) {

The problem is that context services are private so they are not accessible from container get method.

Am I missing something?
If not, I made a PR: #622

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions