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..
Hello all, I am trying to add a test message to queue via a glue endpoint, I get the following erro
Hello all,
I am trying to add a test message to queue via a glue endpoint, I get the following error:
Glue.ERROR: Default queue connection not found. You can fix this by adding `RabbitMqEnv::RABBITMQ_DEFAULT_CONNECTION = true` in your queue connection in `config_*.php` files {"trace":"#0 /data/vendor/spryker/rabbit-mq/src/Spryker/Client/RabbitMq/Model/Connection/ConnectionManager.php(163): Spryker\\Client\\RabbitMq\\Model\\Connection\\ConnectionManager->getDefaultQueueConnectionTransfer() ...
I just have the following code in the getAction() method of resource controller which leads the the error above.
$queueData[] = (new QueueSendMessageTransfer())->setBody("hello!"); $queueClient = $this->getFactory()->getQueueClient(); $queueClient->sendMessages( AntelopesImportRestApiConstants::ANTELOPE_API_IMPORT_QUEUE, $queueData ); return $response;
Can someone please help?
Comments
-
Probably the queue you try to publish to does not exist.
You can try to create it withdocker/sdk console queue:setup
0 -
@UL6DGRULR I tried running
docker/sdk console queue:setup
The queue exists. I can see it in RabbitMQ url.0 -
If you didn't modified the config_default from the demoshop in terms of RABBITMQ_CONNECTIONS there should be at least one:
$config[RabbitMqEnv::RABBITMQ_CONNECTIONS] = array_map(static function ($storeName) { return [ RabbitMqEnv::RABBITMQ_CONNECTION_NAME => $storeName . '-connection', RabbitMqEnv::RABBITMQ_HOST => 'localhost', RabbitMqEnv::RABBITMQ_PORT => '5672', RabbitMqEnv::RABBITMQ_PASSWORD => 'mate20mg', RabbitMqEnv::RABBITMQ_USERNAME => $storeName . '_development', RabbitMqEnv::RABBITMQ_VIRTUAL_HOST => '/' . $storeName . '_development_zed', RabbitMqEnv::RABBITMQ_STORE_NAMES => [$storeName], RabbitMqEnv::RABBITMQ_DEFAULT_CONNECTION => $storeName === APPLICATION_STORE, ]; }, $stores);
0 -
@UL6DGRULR I am sorry I am a beginner so I do not understand what you mean. I have all the default config files that come with B2C demo shop running on docker:
0 -
You could try to debug from
\Spryker\Client\RabbitMq\Model\Connection\ConnectionManager::getDefaultConnection
why it does not work.0 -
@UL6DGRULR Thanks for the help. I think the problem is we can not use Queue depensies in Glue's scope. So Glue should talk to a module in Zed for such operations. I am going to try it in Zed and see if it works.
0 -
As you said, Glue should talk to Zed via the Client, which in turn talks to the Queue. A good picture that shows this is here: https://spryker.s3.eu-central-1.amazonaws.com/docs/Glue+API/Glue+API+Developer+Guides/Glue+Infrastructure/communication.png
0 -
It's possible to publish events to the queue from Glue, in one project we cloned glue and have build a asynchronous API using the queue. But it was a good amount of work (several weeks) to end up with a working solution. So as long as you don't really need to publish from Glue to the Queue it might be easier to call Zed and Zed will put the event in the queue, if you need a queue at all
0 -
yeah technically a client can talk directly to the Queue
0 -
but in terms of best practices it is recommended to go via Zed I guess
0 -
Thank you very much @U03V0SXHU13 and @UL6DGRULR
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random