Showing posts with label Sitecore Practical. Show all posts
Showing posts with label Sitecore Practical. Show all posts

Friday, September 8, 2017

Sitecore- Inside Event Queue and Publish Queue(Master, Web, and Core).

Version: Sitecore.NET 8.2 (rev. 170407)
Here are some interesting information/working sessions about Sitecore #EventQuoueand #Publishing Queue, in case of #workflow, assigned and in case of #Normal and #schedule publishing.
EventQuoue- Just to update here about the EventQuoue - These Queue Sitecore use to maintain the communication between different- different databases - It captures the event and change/audit details, Core database capture event mostly related to Security and publishing(Rebuild indexes)
Before Sitecore 8.1, It only allows to clean up event older then 1 day, but that may create a problem when publishing is too much, especially if publish if very frequent. They have introduced IntervaleToKeep and that will help to determine ours to keep it alive.


  04:00:00
  1
Publishing Queue - This will be used mostly on Master and Web, a First time when the user does any change in the item, it stores details in publishing queue and event Queue and then will move to Web based on the publish type.

This is very useful in case of incremental publishing - As it only trigger and Async Sitecore changes, In case of Schedule publishing mostly this incremental publishing is being used, As most of the time it's required to enable future publishing for the whole site and comparing each change and publishing in a defined interval would be a performance issue, and secondly through incremental publishing the root can't be defined so this Queue will be helpful.
Sitecore keeps 30 days of publishing queue. We can change these configuration by


  10
#Important:- What if the content has been scheduled for publishing after 11days and publishing cleanup is setup for 10 days, that may create an issue so it should be communicated to the user that scheduled publishing maximum allow time will work based on this setting DayToKeep.
Sitecore has three key databases - Master, Web, and Core
Each database has these two tables. Will first clear these three tables and then run some scenarios and analyzed the data, isn't too exciting. Yes it's
Let's run this query - Please change your database name based on your local instance.
use localdevSitecore_Master
Delete from dbo.PublishQueue 
Delete from dbo.EventQueue
use localdevSitecore_Web
Delete from dbo.PublishQueue 
Delete from dbo.EventQueue
use localdevSitecore_Core
Delete from dbo.PublishQueue 
Delete from dbo.EventQueue
----------------------------------
use localdevSitecore_Master
select * from dbo.PublishQueue order by 1 desc
Select distinct *  from dbo.EventQueue
use localdevSitecore_Web
select * from dbo.PublishQueue order by 1 desc
Select distinct *  from dbo.EventQueue
use localdevSitecore_Core
select * from dbo.PublishQueue order by 1 desc
Select distinct *  from dbo.EventQueue
Make sure the result is blank for all these tables, PFB sample
Create the First item in Sitecore. - I got Item ID - {7F0D3720-9CC9-4D6C-9E80-0ABB8860C94B}
Master - dbo.PublishQueue - 3 Records - with actions below details.
Created, Saved and Version Added
Web- dbo.PublishQueue - 3 Records - with actions below details.
No Records
Core- dbo.PublishQueue - 0 Records but dbo.EventQueue got almost 21 records. Almost all are related to reference to index updations.
Point#1 - Master DB will have a reference for Item but Core DB will only have a reference for the Indexes ( Later on will discuss these indexes in context of multiple CD servers).
Point#2 - PublishingQueue will have high-level details and action like the item - added, saved etc.
EventQueue will have full details about field level change
Question#1 - There are four entries in Event Ques two are the almost same only difference in item name - Anyone knows why or any specific purpose?
Let's now publish this item -
I published this item in one language, here (out of the context) I got below message - One item created and one skipped
Question 2 - Why I got the message of one item skipped here? Many be will discuss this - let's continue here with the main topic.
As per my understanding, As we choose the smart publishing so only required changes moved from Master to the web or second we have only choose English - Not sure - Will review this in next session.
Result-
Master - dbo.PublishQueue - NO change.
#Question - What is DAC_Index?
#Question - What is Recovery ID - We noticed in instancdedatafield in CoreDatabase EventQueue

"EventName":"publish:startPublishing","Options":[{"CompareRevisions":true,"Deep":false,"FromDate":"\/Date(1504386516076)\/","LanguageName":"en","Mode":3,"PublishDate":"\/Date(1504391279790)\/","PublishRelatedItems":false,"PublishingTargets":["{8E080626-DDC3-4EF4-A1D1-F0BE4A200254}"],"RecoveryId":"0f06ba19-a91c-4b08-a7bf-54ebcb27572e","RepublishAll":false,"RootItemId":"7f0d3720-9cc9-4d6c-9e80-

Master - dbo.EventQueue- NO change.
Web- MasterPublishQueue - No change
Web- EventQueue - Got three records
First entry just for the publishing details, second for the item while field level details, third is high-level details of the events.
Core- PublishQueue- No change
Core- EventQueue - the last record was 21, not its 46 , Almost 21 new records are related to update the index but rest 4(46-(21+21)) are related to actual item event capture.
Let's review this four items.
First three are related to the user and the last one is related to job running status and owner is an Anonymous user.
{"EventName":"publish:statusUpdated","Status":{"CurrentLanguageName":"English","CurrentTargetName":"web","Expired":true,"Failed":false,"IsDone":true,"Messages":["Job started: Publish to 'web'","Items created: 1","Items deleted: 0","Items updated: 0","Items skipped: 1","Job ended: Publish to 'web' (units processed: 2)"],"Processed":2,"State":3},"StatusHandle":{"instanceName":"localdev","m_handle":"d0b296a2-a2ba-45d6-8d94-fa45c2452e85"}} localdev 1 1 default\Anonymous
What about in case of Schedule publishing -
Let's review this - First quickly enable the scheduled publishing, Add below configure in include folder, make sure it should have naming convention of z



 
   
     
        master
        web
        incremental
        en, ar
     
   
 

Now again flush all the content and quickly verify these transactions.
Let's observe the behavior of schedule publishing agent without any activities.
Notice - This agent will keep entering data in Code and Web EventQueu, As we have setup interval for 2 minutes and two languages it's entering 2 records in every two minutes.
I published this item.
Each item in event queue there is a field call Mode- which can be used to identify by what method this item get entered like smart, full or incremental(by Agent).
#Important - Sometimes we faced some issue where we identified record modified through custom utility or scheduling agent - this mode will be helpful If this is because of incremental publishing the most reason would be Schedule publishing agent.
Some useful References:-https://sdn.sitecore.net/upload/sitecore6/63/introducing_sitecore_cms_6.3_a4.pdf

Sunday, August 20, 2017

Sitecore Practical Series-1 Setup development machine and required software.

Sitecore Practical Series-1
Setup development machine and required software.
Visual Studio 2017, Sitecore 8.2 and Microsoft SQL Server 2016,IIS 8.5,Sitecore Rock


Overview
Agenda- Required software can be downloaded from the below links:-
  1. Visual Studio 2017 :- https://www.visualstudio.com/vs/whatsnew/
  2. SQL Server download link:- https://www.microsoft.com/en-gb/sql-server/sql-server-editions-express
  3. Sitecore 8.2-(rev. 170728) - https://dev.sitecore.net/Downloads.aspx
  4. IIS 8.5 - This can be enabled through the control panel - Window option.
  5. MongoDB.
  6. Sitecore Rock

Download and install all required software


1. Setup IIS
Setup IIS first on your local system, below are the steps. - Go to admin panel - installation software- window installation section and enable IIS settings as mention below.


2. Setup SQL Server

SQL server must be running in Mized Authentication mode, You should now the username and password for the server.

Note 1 - SQL server should be setup in MiedMode.

Tips 1 - In case if SQL setup not done in MixedMode, below are the steps to rest it without re installation.

Login to SQL through window mode and go to properties - Change the mode from here

 After enabling this option the current SA login needs to be enabled, below is the reference screen:-

Note 2 - As per my past experience SQL server should be installed first before the visual studio, As Visual studio will install some SQL supported files and after SQL installation the SQL installation may fail to override the existing setup files.

Tips 2 - Install SQL server before the Visual Studio.

3. Setup Visual Studio 2017
Download visual studio from the above link and setup, below are the steps and details.




3. Install Sitecore 8.2

Download Sitecore from the above link - Mention in this post.

Executable file for the Sitecore


Sitecore can be installed through various mode - like New instance will create altogether a new setup including database and configuration

It can override the existing instance by choosing Existing Instance option and can be installed client only.

Clint only option will discuss later when we configure the multiple CM and CD servers.




Backed database can be define here

Sitecore support both SQL server and Oracle database




4. Install Sitecore Rock


Sitecore rock will help for the easy development with Sitecore, this plugin easily connected Sitecore with Visual studio

Link to download :-
https://marketplace.visualstudio.com/items?itemName=JakobChristensen.SitecoreRocks




4. Installation and setup for MongoDB

MongoDB will required for the DMS configuration - Mostly used for the analytics, If you are using Sitecore 8.1 then this will also required to install sitecore packages.

Link to download :-http://www.mongodb.org/downloads

Required setup in the connection string

 
 
 

 

These are the default settings, If you install and setup MongoDB correctly then this should work.