Message Broker application is a mediator between Catalog StoreFront Application and Magento Backoffice.
- Listen to changes from Magento Backoffice
- Pull data from Magento backoffice
- Push data with gRPC to Storefront service
Related repositories
- https://github.com/magento/commerce-data-export Extension to Magento. Provides API to Export entities from Magento to any subscribed consumer
- https://github.com/magento/catalog-storefront Catalog Storefront Service. gRPC server, provides API for Catalog domain area
- magento/framework
- magento/amqp
- magento/message-queue
Message Broker can be installed in 2 ways:
- Monolithic installation: just copy files to your Magento root folder. This is for development purposes only, do not use in production.
- Standalone installation: recommended approach, install Message Broker as a standalone installation
- Add Magento authentication keys to access the Magento Commerce repository
- with auth.json: copy the contents of
auth.json.dist
to newauth.json
file and replace placeholders with your credentials - with environment variable: specify environment variable
COMPOSER_AUTH
according to documentation
- Run
bash ./dev/tools/make_standalone_app.sh
- Run
composer install
- Run
bin/command message-broker:install
with all required arguments.
There are 2 modes how Message broker can talk to Storefront Service:
- "in-memory": direct call of PHP class. This will work only with Monolithic Installation.
- "network": do gRPC call to Storefront Service.
In order to change mode you can use environment variable: export GRPC_CONNECTION_TYPE=<mode>
To add gRPC server configuration please run next command:
bin/command message-broker:grpc-connection:add --name={some_name} --grpc-port={some-port} --grpc-host={some_host}
If at least one server added, communication mode will be automatically changed to "network"
In order to make Magento Framework work in a standalone installation without relying on Magento modules, there were created few stubs:
\Magento\MessageBroker\Stub\CustomAttributesDefaultTypeLocator
On bootstrap Magento tries to load all dependencies, that are required for WebAPI. One of such dependency is CustomAttributesDefaultTypeLocator.\Magento\MessageBroker\Stub\Encoder
Magento framework tries not only to encode, but also to translate JSON. We don't need this functionality.\Magento\MessageBroker\Stub\Amqp\ResourceModel\MessageQueueLock
Message queue lock mechanism is utilizing Magento database, in order to get rid of database, we need to get rid of MessageQueueLock
Contributions are welcomed! Read the Contributing Guide for more information.
This project is licensed under the OSL-3.0 License. See LICENSE for more information.