What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hey there I'm somewhat stuck... I've implemented a GatewayController on the zed level. I think it is

U01BLK1U2RY
U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet
edited November 2020 in Help

Hey there I'm somewhat stuck... I've implemented a GatewayController on the zed level. I think it is correctly located. However the routes does not seem to get registered. Is there anything else, that i have to do? Like registering the controller manually? or adding a route?

Comments

  • Alberto Reyer
    Alberto Reyer Posts: 690 πŸͺ - Explorer

    Does vendor/bin/console console router:cache:warm-up solves your problem?

  • Alberto Reyer
    Alberto Reyer Posts: 690 πŸͺ - Explorer

    Zed Controllers do not need to be registered

  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    nope

  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    does not help

  • Eugenia Poidenko
    Eugenia Poidenko Sprykee Posts: 145 πŸ§‘πŸ»β€πŸš€ - Cadet

    You are using AbstractGatewayController right? It was one of my own latest things to get stuck on πŸ˜‚

  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes

  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    here the calling function;

    /**
     * @param FirstSpiritDataImportJobTransfer $firstSpiritDataImportJobTransfer
     * @return DataImporterReportTransfer
     */
    public function processDataImportRequest(FirstSpiritDataImportJobTransfer $firstSpiritDataImportJobTransfer) : DataImporterReportTransfer
    {
        $this->getLogger()->warning("Calling Zed with request to '/first-spirit-data-import/gateway/process-data-import-request'.", ["transferType" => $firstSpiritDataImportJobTransfer->getImportType()]);
        /** @var DataImporterReportTransfer $dataImporterReportTransfer */
        $dataImporterReportTransfer = $this->zedRequestClient->call('/first-spirit-data-import/gateway/process-data-import-request', $firstSpiritDataImportJobTransfer);
    

    here the gateway:

    namespace FirstSpirit\Zed\FirstSpiritDataImport\Communication\Controller;
    
    ... some imports here ...
    
    /**
     * @method FirstSpiritDataImportFacadeInterface getFacade()
     */
    class GatewayController extends AbstractGatewayController
    {
        /**
         * @param FirstSpiritDataImportJobTransfer $firstSpiritDataImportJobTransfer
         * @return DataImporterReportTransfer
         */
        public function processDataImportRequestAction(FirstSpiritDataImportJobTransfer $firstSpiritDataImportJobTransfer)
        {
    
  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    what console says:

    [25-Nov-2020 15:05:53] WARNING: [pool worker] child 13 said into stderr: "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException: No route found for "POST /first-spirit-data-import/gateway/process-data-import-request" in file /data/vendor/symfony/http-kernel/EventListener/RouterListener.php on line 136"
    [25-Nov-2020 15:05:53] WARNING: [pool worker] child 13 said into stderr: ""
    [25-Nov-2020 15:05:53] WARNING: [pool worker] child 13 said into stderr: "Caused by"
    [25-Nov-2020 15:05:53] WARNING: [pool worker] child 13 said into stderr: "Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException: None of the routers in the chain matched this request"
    [25-Nov-2020 15:05:53] WARNING: [pool worker] child 13 said into stderr: "POST /first-spirit-data-import/gateway/process-data-import-request HTTP/1.1
    "
    
  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    do you have any clue how class and methodname would be translated?

  • Alberto Reyer
    Alberto Reyer Posts: 690 πŸͺ - Explorer

    I guess that the different namespace (FirstSpirit) will not be considered by the mechanism to find Zed controllers.
    AbstractControllerResolver would be a good place to start debugging this through

  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    AbstractControllerResolver sounds good to me

  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    thanks for the hint

  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    In the end i've found the answer in the RouterConfig

  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet
    namespace Spryker\Zed\Router;
    
  • U01BLK1U2RY
    U01BLK1U2RY Posts: 16 πŸ§‘πŸ»β€πŸš€ - Cadet

    in the end it was a typo