Sitecore Publishing Service in local
I have two publishing targets
1. Web
2. Web_ap
After installing Sitecore Publishing Service, we will get a config file in the below path,
<your folder>\config\sitecore\publishing
Open the file name, sc.publishing.xml
Under the below node,
Sitecore > Publishing > Services > DefaultConnectionFactory > Options > Connections
<Web>
<!-- Should match the name of the publishing target configured in SC. -->
<Type>Sitecore.Framework.Publishing.Data.AdoNet.SqlDatabaseConnection, Sitecore.Framework.Publishing.Data</Type>
<LifeTime>Transient</LifeTime>
<Options>
<ConnectionString>${Sitecore:Publishing:ConnectionStrings:Web}</ConnectionString>
<DefaultCommandTimeout>120</DefaultCommandTimeout>
<Behaviours>
<backend>sql-backend-default</backend>
<api>sql-api-default</api>
</Behaviours>
</Options>
</Web>
<Web_ap>
<!-- Should match the name of the publishing target configured in SC. -->
<Type>Sitecore.Framework.Publishing.Data.AdoNet.SqlDatabaseConnection, Sitecore.Framework.Publishing.Data</Type>
<LifeTime>Transient</LifeTime>
<Options>
<ConnectionString>${Sitecore:Publishing:ConnectionStrings:Web_ap}</ConnectionString>
<DefaultCommandTimeout>120</DefaultCommandTimeout>
<Behaviours>
<backend>sql-backend-default</backend>
<api>sql-api-default</api>
</Behaviours>
</Options>
</Web_ap>
And add the below config under,
Sitecore > Publishing > Services > StoreFactory > Options > Stores > Targets
<Web>
<Type>Sitecore.Framework.Publishing.Data.TargetStore, Sitecore.Framework.Publishing.Data</Type>
<ConnectionName>Web</ConnectionName>
<FeaturesListName>TargetStoreFeatures</FeaturesListName>
<!-- The id of the target item definition in Sitecore. -->
<Id>{put your sitecore id here.. }</Id>
<!-- The name of the Database entity in Sitecore. -->
<ScDatabase>web</ScDatabase>
</Web>
<Web_ap>
<Type>Sitecore.Framework.Publishing.Data.TargetStore, Sitecore.Framework.Publishing.Data</Type>
<ConnectionName>Web_ap</ConnectionName>
<FeaturesListName>TargetStoreFeatures</FeaturesListName>
<!-- The id of the target item definition in Sitecore. -->
<Id>{put your sitecore id here.. }</Id>
<!-- The name of the Database entity in Sitecore. -->
<ScDatabase>web_ap</ScDatabase>
</Web_ap>
After adding the below configs, run the schema build one more time,
.\Sitecore.Framework.Publishing.Host.exe schema upgrade --force
and restart your instances, both Sitecore and Publishing Service.
Now, when you publish anything in Sitecore, it will reflect in the publishing services dashboard, as below,
<Web>
<Type>Sitecore.Framework.Publishing.Data.TargetStore, Sitecore.Framework.Publishing.Data</Type>
<ConnectionName>Web</ConnectionName>
<FeaturesListName>TargetStoreFeatures</FeaturesListName>
<!-- The id of the target item definition in Sitecore. -->
<Id>{put your sitecore id here.. }</Id>
<!-- The name of the Database entity in Sitecore. -->
<ScDatabase>web</ScDatabase>
</Web>
<Web_ap>
<Type>Sitecore.Framework.Publishing.Data.TargetStore, Sitecore.Framework.Publishing.Data</Type>
<ConnectionName>Web_ap</ConnectionName>
<FeaturesListName>TargetStoreFeatures</FeaturesListName>
<!-- The id of the target item definition in Sitecore. -->
<Id>{put your sitecore id here.. }</Id>
<!-- The name of the Database entity in Sitecore. -->
<ScDatabase>web_ap</ScDatabase>
</Web_ap>
After adding the below configs, run the schema build one more time,
.\Sitecore.Framework.Publishing.Host.exe schema upgrade --force
and restart your instances, both Sitecore and Publishing Service.
Now, when you publish anything in Sitecore, it will reflect in the publishing services dashboard, as below,

No comments:
Post a Comment