What is wrong with my SuluSyliusConsumerBundle configuration?

187 views Asked by At

I have a Sulu and a Sylius application which I am trying to integrate using the SuluSyliusBundle and RabbitMQ. I have added the following configs...

messenger.yaml

framework:
router:
    resource: "%kernel.project_dir%/config/routing_%sulu.context%.yml"
messenger:
    # Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
    # failure_transport: failed
    buses:
        message_bus:
            middleware:
                - doctrine_transaction
                - event_middleware
    # Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
    # failure_transport: failed

    transports:
        # https://symfony.com/doc/current/messenger.html#transport-configuration
        # async: '%env(MESSENGER_TRANSPORT_DSN)%'
        # failed: 'doctrine://default?queue_name=failed'
        # sync: 'sync://'

    routing:
        # Route your messages to the transports
        # 'App\Message\YourMessage': async

sulu_sylius_consumer.yaml

  sylius_base_url: 'http://127.0.0.1:8001'
  sylius_default_channel: 'default_channel'
  sylius_oauth_config:
    username: api
    password: api
    client_id: demo_client
    client_secret: secret_demo_client
  route_defaults_fallback:
    view: 'templates/products/default'
  firewall_provider_key: 'main'

The issue is that once I install the bundle and add these two configs, I get the following error enter image description here

I believe this is being caused by the config in the messenger. I have added the routes to routes_admin.yaml as it is show in the documentation here:

routes_admin.yaml


app_events:
    type: rest
    resource: App\Controller\Admin\EventController
    prefix: /admin/api
    name_prefix: app.
    options:
        expose: true

app_event_registrations:
    type: rest
    resource: App\Controller\Admin\EventRegistrationController
    prefix: /admin/api
    name_prefix: app.
    options:
        expose: true

app_locations:
    type: rest
    resource: App\Controller\Admin\LocationController
    prefix: /admin/api
    name_prefix: app.
    options:
        expose: true

app_products:
    type: rest
    resource: App\Controller\Admin\ProductsController
    prefix: /admin/api
    name_prefix: app.
    options:
        expose: true

sulu_route:
    mappings:
        Sulu\Bundle\SyliusConsumerBundle\Model\RoutableResource\RoutableResource:
            generator: schema
            resource_key: product_content
            options:
                route_schema: "/products/{object.getCode()}"

routes_website.yaml

app.event:
    path: /{_locale}/event/{id}
    controller: App\Controller\Website\EventWebsiteController::indexAction

app.product:
    path: /{_locale}/product/{id}
    controller: App\Controller\Website\ProductWebsiteController::indexAction

What can I do to fix this error? [edit: added routes_admin and routes_website yaml]

0

There are 0 answers