Solution Strategies
Central communications module
In order to reduce the implementation overhead when linking a new remote API provided by Dynamics BC, a central communications module was conceived. This module wraps all low level communication and provides facilities that allow developers to focus on dealing with the data.
Tasks of the communications module:
-
Perform request authentication
-
Send data to Dynamics BC
-
Fetch data from Dynamics BC
Providing the data to be sent and the mechanisms to deal with exchanged data is the task of external modules and must not be added to the communications module.
A detailed glance at the architecture of the module responsible for the communication is found in the chapter Dynamics BC API Client
Data import via Pacemaker
Even though it would be possible to simply create Magento cron jobs in order to periodically import data from Dynamics BC, it is preferable to use Pacemaker pipelines for this purpose. The main disadvantage of cron jobs is that there is no possibility to easily check whether they were started, what their status is, whether there were errors and if so, which errors occurred. All of this can only be found in the log files, which is rather tedious to gather. Especially when running the shop in the Adobe Commerce Cloud, the log files of multiple servers have to be inspected in order to find information on the cron jobs, since the cron jobs are not always being run on the same server. Pacemaker Pipelines can be monitored in the admin area of Magento, making it easy for a shop administrator to find out what is happening, thus developers are advised to create import pipelines.