If you started working with Sitecore commerce 9.0 or later, you might have noticed there are a lot of connection points among different roles of Sitecore XP, solr, Sitecore Identity Server and Sitecore Commerce.
It’s important to understand the communication points and how this communication is made secure. Sometimes we face the issues due to wrong configurations of those communication points. Since I went through a bit of pain while configuring Staging and Production environments, I thought to share how communication takes place
- From Sitecore XP to Commerce Engine(CE)
- From Commerce Engine to XP(Content Synchronization)
- Commerce Engine to Solr
- Commerce Engine Plugins to Sql
- Bizfx to Commerce Engine
Sitecore XP to CE:
The communication takes place through Commerce Eninge Connect layer. In Sitecore installation directory(at path App_Config\Include\Y.Commerce.Engine) we have Sitecore.Commerce.Engine.Connect.config which defines the communication configurations from XP to CE.
The configuration defines shopsServiceUrl which is used to send any shops related read/write requests from XP to CE for example, get catalogs or categories. Then it defines certain defaults like defaultEnvironment, defaultShopName etc. These settings are passed as part of the context of each request from XP to CE. We can define these configurations on the Storefront itself under the commerce control panel.
The communication is made secure with a certificate. The thumbprint of the certificate is saved in the configuration of engine connect in Sitecore XP(above image) as well as in all the CE roles configurations(config.json). The certificate thumbprint and header name configuration should match on both sides(XP, CE) for successful communication. The below screen shot is from config.json of a CE role.
From CE to XP:
Sometimes, the commerce engine needs to know the path to XP for certain operations like Sync the content. Read more about content synchronization here. In CE policies, we have got PlugIn.Content.PolicySet-1.0.0.json. This policy defines certain parameters like Host, SitecoreDatabase, UserName, and Password etc to access the commerce content and sync it back to Commerce Engine.